/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    margin: 0;
    padding: 0;
    max-width: none;
    flex-grow: 1;
}

/* ============================================================================
   HEADER / NAVBAR
   ============================================================================ */

.site-header {
    background-color: var(--primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 999;
}

[data-theme="dark"] .site-header {
    background-color: #111;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 20px;
    gap: 8px;
}

.logo-lockup {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 12px;
}

.logo-img {
    height: 34px;
    width: auto;
    display: block;
}

/* ============================================================================
   NAV LINKS
   ============================================================================ */

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: Cambria, serif;
    font-size: 14px;
    transition: color 0.15s, background-color 0.15s;
    white-space: nowrap;
    display: block;
    cursor: pointer;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.nav-link.active {
    color: white;
    background-color: transparent;
    border-bottom: 2px solid var(--secondary);
    border-radius: 0;
}

/* ============================================================================
   DROPDOWNS
   ============================================================================ */

.nav-dropdown {
    position: relative;
}

.nav-dropdown:hover .dropdown-content {
    display: block !important;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-bubble);
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-family: Cambria, serif;
    font-size: 14px;
    transition: background-color 0.15s;
}

.dropdown-content a:hover {
    background-color: var(--bg-hover);
}

.dropdown-divider {
    border-top: 1px solid var(--border);
}

/* ============================================================================
   NAV RIGHT
   ============================================================================ */

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.icon-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
    line-height: 1;
}

.icon-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.nav-logout-mobile {
    display: none;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    padding: 5px 14px;
    border-radius: 6px;
    font-family: Cambria, serif;
    font-size: 13px;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.logout-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.08);
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    transition: background-color 0.15s;
}

.hamburger-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   MOBILE OVERLAY
   ============================================================================ */

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 997;
}

.nav-overlay.active {
    display: block;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.site-footer {
    background-color: var(--primary);
    color: white;
    text-align: center;
    padding: 20px;
}

[data-theme="dark"] .site-footer {
    background-color: #111;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--tertiary);
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 4px;
        z-index: 998;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown:hover .dropdown-content {
        display: none !important;
    }

    .nav-dropdown.mobile-open .dropdown-content {
        display: block !important;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        border-left: 2px solid var(--secondary);
        margin-left: 16px;
        background-color: transparent;
    }

    .nav-dropdown.mobile-open .dropdown-content a {
        color: rgba(255, 255, 255, 0.85);
        font-size: 15px;
    }

    .nav-dropdown.mobile-open .dropdown-content a:hover {
        background-color: rgba(255, 255, 255, 0.08);
    }

    .logout-btn {
        display: none;
    }

    .nav-logout-mobile {
        display: block;
        margin-top: auto;
        border-bottom: none !important;
        color: rgba(255, 255, 255, 0.75);
    }
}
