/* 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;
}