/* General styles */
body,
input,
button,
select,
option {
    font-family: 'Arial', sans-serif;
    font-size: 12pt;
}

body {
    margin: 0;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.left-right {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

/* ── Header (matches GF viewer) ── */
.app-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    background: #0b4a53;
    padding: 0 24px;
    height: 100px;
    width: 100%;
    box-sizing: border-box;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.header-left a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.header-center {
    text-align: center;
    font-size: 30px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 16px;
}

.version-text {
    display: block;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Responsive header ── */
@media (max-width: 900px) {
    .header-logo {
        height: 60px;
    }
    .header-center {
        font-size: 24px;
    }
}

@media (max-width: 720px) {
    .header-logo {
        height: 48px;
    }
    .header-center {
        font-size: 20px;
        padding: 0 10px;
    }
}

@media (max-width: 560px) {
    .header-center {
        display: none;
    }
}

/* ── Navigation ── */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2px;
}

.nav-item {
    position: relative;
    cursor: pointer;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(200, 240, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.chevron {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-item:hover > .nav-link > .chevron {
    transform: rotate(180deg);
}

/* ── Dropdowns ── */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    background: #004F59;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: 4px 0;
    z-index: 1000;
    list-style: none;
}

.nav-item:hover > .dropdown {
    display: block;
}

.dropdown li {
    position: relative;
}

.dropdown li a,
.dropdown .nav-item > .nav-link {
    display: block;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    transition: background 0.15s;
}

.dropdown li a:hover,
.dropdown .nav-item > .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Nested dropdown (About → CRESCENT, CFM, CVM) */
.dropdown .dropdown {
    left: 0;
    top: 100%;
    border-radius: 0 0 6px 6px;
}

/* ── Info message ── */
.info-message {
    color: maroon;
    font-weight: bold;
}

/* ── Descriptions and filter styles ── */
.description,
.filter {
    padding: 10px 20px;
}

.description {
    background-color: #eee;
}

.filter {
    background-color: #fff;
}

#toggleSubductionInterface label {
    vertical-align: top;
    margin-right: 10px;
}

/* ── About modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 560px;
    max-width: 92vw;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #0b4a53;
    color: #fff;
}

.modal-header-bar h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body-content {
    padding: 20px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
}

.modal-body-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: #0b4a53;
    margin: 12px 0 6px;
}

.modal-body-content h4:first-child {
    margin-top: 0;
}

.modal-body-content hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 14px 0;
}

.modal-body-content ul {
    padding-left: 18px;
    margin: 6px 0;
}

.modal-body-content li {
    margin-bottom: 4px;
}

.modal-body-content a {
    color: #0b4a53;
    font-weight: 600;
}

/* ===== Header icon + About modal (matches the CVM viewer) ===== */
.nav-link.nav-icon {
    padding: 6px 9px;
}

.nav-link.nav-icon svg {
    display: block;
}

.about-box {
    background: rgba(242, 247, 249, 0.96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    max-width: 740px;
    width: 100%;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
}

.about-box .modal-body-content {
    padding: 34px 40px;
}

.about-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.about-modal-close:hover { color: #0b4a53; }

.about-box .modal-body-content h2 {
    color: #0e7490;
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.about-box .modal-body-content h3 {
    margin: 20px 0 8px;
    font-size: 16px;
    color: #0b4a53;
    font-weight: 600;
}

.about-box .modal-body-content p {
    color: #334155;
    font-size: 14.5px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.about-box .modal-body-content .about-links {
    margin: 20px 0 18px;
    text-align: center;
}

.about-box .modal-body-content .about-link-button {
    display: inline-block;
    background: linear-gradient(135deg, #0e7490 0%, #0b4a53 100%);
    color: #ffffff;
    padding: 13px 28px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(14, 116, 144, 0.35);
}

.about-box .modal-body-content .about-link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(14, 116, 144, 0.45);
}

.about-box .modal-body-content .contact-info {
    background: rgba(255, 255, 255, 0.55);
    border-left: 3px solid #0e7490;
    border-radius: 14px;
    padding: 18px 20px;
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.45;
}

.about-box .modal-body-content .contact-block {
    margin-bottom: 14px;
}

.about-box .modal-body-content .contact-block:last-child {
    margin-bottom: 0;
}

.about-box .modal-body-content .contact-block strong {
    font-size: 14px;
    font-weight: 600;
    color: #0b4a53;
    display: block;
    margin-bottom: 4px;
}

.about-box .modal-body-content .contact-block a {
    font-size: 13px;
    color: #0e7490;
    text-decoration: none;
    font-weight: 500;
}

.about-box .modal-body-content .contact-block a:hover {
    text-decoration: underline;
}

.about-box .modal-body-content .acknowledgment {
    font-size: 12.5px;
    color: #64748b;
    font-style: italic;
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.about-box .modal-body-content .about-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
