/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--nav-bg);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    margin: 0;
    z-index: 1000;
    transition: none;
}

/* Desktop header with centered logo */
@media screen and (min-width: 1025px) {
    .header {
        min-height: 80px;
        justify-content: space-between;
        /* Space between logo and right nav */
        gap: 2rem;
    }

    .logo {
        margin: 0;
        justify-content: center;
        /* Center logo on desktop */
    }
}

.logo {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo a {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo-link {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    letter-spacing: -0.01em;
}

/* Logo image: maroon via CSS mask for exact #561023 (matches account icon / brand). */
.logo--maroon .logo-image-mask {
    display: block;
    width: 110px;
    height: 40px;
    background-color: var(--maroon);
    -webkit-mask-image: var(--logo-mask-url);
    mask-image: var(--logo-mask-url);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.header-nav-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    grid-column: 1;
}

.nav-links {
    display: none;
    /* Hide nav links, use hamburger menu instead */
    align-items: center;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--black);
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Nanum Myeongjo', serif;
    padding: 0;
    vertical-align: middle;
}

.nav-link:hover {
    color: var(--forest);
}

.nav-link i {
    margin-right: 6px;
}

.nav-link-highlight {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    min-height: 36px;
    background: var(--maroon, #561023);
    color: var(--cream, #ede6dc) !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none !important;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(86, 16, 35, 0.15);
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
    line-height: 1;
}

.nav-link-highlight:hover {
    background: #3f0c1a;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(86, 16, 35, 0.25);
}

/* Hamburger menu - always visible on desktop for toggling */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 40px;
    /* Fixed width to prevent growth */
    height: 40px;
    /* Fixed height to prevent growth */
}

/* Always show hamburger on desktop */
@media screen and (min-width: 1025px) {
    .hamburger-menu {
        display: flex;
    }
}

.hamburger-menu span {
    width: 24px;
    height: 2px;
    background-color: var(--black);
    transition: none;
}

/* Hamburger icon - positioned absolutely to overlap hamburger lines */
.hamburger-menu i {
    display: none;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--cream);
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0px;
    min-width: 260px;
    margin-top: 0;
    z-index: 1000;
    padding: 10px 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.header-nav-left {
    position: relative;
}

.mobile-menu.show {
    display: block;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--black);
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Nanum Myeongjo', serif;
    text-align: left;
    transition: background-color 0.2s;
}

.mobile-menu-item:hover {
    background-color: rgba(15, 58, 46, 0.06);
}

.mobile-menu-item i {
    width: 18px;
    color: var(--forest);
}

.header-nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    grid-column: 3;
    gap: 1rem;
    margin-left: auto;
    /* Push to the right end */
}

.nav-user-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-badge {
    position: relative;
    background-color: var(--maroon);
    color: var(--cream);
    -webkit-mask: url('/static/assets/motifs/seal.svg') center/contain no-repeat;
    mask: url('/static/assets/motifs/seal.svg') center/contain no-repeat;
    border-radius: 0;
    overflow: hidden;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Nanum Myeongjo', serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

/* Account Dropdown */
.account-dropdown-wrapper {
    position: relative;
    margin-left: 12px;
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0px;
    transition: background-color 0.2s;
}

.account-trigger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.account-trigger {
    color: var(--black);
    font-family: 'Nanum Myeongjo', serif;
}

.account-trigger .fa-chevron-down {
    font-size: 12px;
    color: var(--black);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    /* background: var(--cream); */
    border-radius: 0px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1000;
}

.account-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
}

.account-dropdown-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.account-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--black, #262e2e);
    text-align: left;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    text-transform: none;
    letter-spacing: normal;
}

.account-dropdown-email {
    font-size: 12px;
    font-weight: 400;
    color: #555555;
    text-align: left;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    text-transform: none;
    letter-spacing: normal;
}

/* User badge dropdown: clean DM Sans typography matching Image 4 reference */
.account-dropdown-wrapper .account-dropdown-name {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: capitalize;
    color: #262e2e;
}

.account-dropdown-wrapper .account-dropdown-email {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: #555555;
}

.account-dropdown-wrapper .account-dropdown .account-dropdown-item {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: capitalize;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    color: #262e2e;
}

.account-dropdown-separator {
    height: 1px;
    background-color: rgba(30, 30, 30, 0.12);
    margin: 0 8px;
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--black, #262e2e);
    font-size: 14px;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    text-transform: capitalize;
    letter-spacing: normal;
    transition: background-color 0.2s;
}

.account-dropdown-item:hover {
    background-color: rgba(15, 58, 46, 0.06);
    color: var(--forest);
}

.account-dropdown-item i {
    width: 18px;
    font-size: 14px;
    color: #6b7280;
}

.account-dropdown-item:last-child {
    border-radius: 0px;
}

.logout-link:hover {
    text-decoration: underline;
}

/* ============================================
   CURRENCY SELECTOR
   ============================================ */

.currency-selector {
    position: relative;
    display: inline-block;
}

.currency-selector select {
    background-color: var(--cream);
    border: 1px solid rgba(30, 30, 30, 0.15);
    border-radius: 0px;
    padding: 2px 2px;
    font-family: 'Nanum Myeongjo', serif;
    font-size: 14px;
    color: var(--black);
    cursor: pointer;
    transition: all 0.3s;
}

.currency-selector select:hover {
    background-color: rgba(15, 58, 46, 0.04);
    border-color: var(--forest);
}

.currency-selector select:focus {
    outline: none;
    border-color: var(--forest);
    box-shadow: 0 0 0 2px rgba(15, 58, 46, 0.2);
}

.currency-display {
    display: none;
}

/* Mobile currency selector and user badge styles */
@media screen and (max-width: 1024px) {
    .currency-selector {
        margin-right: 10px;
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    /* Hide the select dropdown visually on mobile, but keep it functional */
    .currency-selector select {
        position: absolute;
        opacity: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
        z-index: 2;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
    }

    /* Show the currency display on mobile */
    .currency-display {
        display: inline-block;
        background-color: var(--cream);
        border: 1px solid rgba(30, 30, 30, 0.15);
        border-radius: 0px;
        padding: 8px 12px;
        font-size: 18px;
        font-weight: 500;
        font-family: 'Nanum Myeongjo', serif;
        color: var(--black);
        min-width: 45px;
        text-align: center;
        pointer-events: none;
        z-index: 1;
    }

    /* Add dropdown arrow indicator */
    .currency-selector::after {
        content: '';
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        width: 0;
        height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid var(--forest);
        z-index: 1;
    }

    .user-badge {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}

/* Mobile Header Adjustments */
@media screen and (max-width: 1024px) {

    body.admin-page,
    body.has-sidepane,
    body.host-home-page {
        padding-top: 64px !important;
    }

    /* Header adjustments */
    .header {
        padding: 12px 20px;
        position: fixed;
        z-index: 1000;
        left: 0 !important;
        width: 100% !important;
        justify-content: flex-start;
        /* Align items to the left on mobile */
        gap: 1rem;
        /* Add gap between logo and right nav */
    }

    .logo {
        order: 2;
        flex: 0 0 auto;
        /* Don't grow or shrink, stay at natural size */
        justify-content: flex-start;
        /* Left-align logo on mobile */
        margin: 0;
    }

    .header-nav-left {
        order: 1;
    }

    .header-nav-right {
        order: 3;
    }

    /* Hide hamburger menu on mobile - using bottom menu instead */
    .hamburger-menu {
        display: none !important;
    }

    .hamburger-menu span {
        width: 24px;
        height: 2px;
        background-color: var(--black);
        transition: all 0.3s ease;
    }

    .header-nav-left .nav-links {
        display: none;
    }

    .header-nav-right {
        grid-column: 3;
        justify-content: flex-end;
    }

    /* Reduce gap between nav elements on mobile */
    .nav-links {
        gap: 15px;
    }

    .logo a {
        font-size: 1.5rem;
    }

    .logo-link {
        font-size: 1.5rem;
    }
}

/* Options dropdown (e.g. registry page when not logged in) */
.options-dropdown-wrapper {
    position: relative;
}

.options-dropdown-trigger {
    padding: 8px;
    min-width: 40px;
}

.options-dropdown-trigger .fa-ellipsis-h {
    font-size: 18px;
}

/* Registry page: header options trigger on mobile (bottom bar also has Options) */
.registry-mobile-options {
    display: none;
}

/* Standalone Login on registry: hidden on mobile (Login is in options dropdown) */
.registry-desktop-login {
    display: none;
}

@media screen and (min-width: 1025px) {
    .registry-desktop-login {
        display: inline-block;
    }
}

@media screen and (max-width: 1024px) {
    .registry-mobile-options {
        display: flex;
        align-items: center;
    }
}

/* Universal modal background scroll lock */
body.hzl-modal-open,
html.hzl-modal-open {
    overflow: hidden !important;
    touch-action: none;
    overscroll-behavior: contain;
}

/* ============================================
   CRITICAL HEADER CONTROL: NOTIFICATION BELL TRIGGER
   Guarantees zero FOUC / white-box glitch on initial frame paint.
   ============================================ */
.activity-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    z-index: 1;
}

.activity-bell-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 2px;
    background: transparent;
    color: var(--hzl-maroon, var(--maroon, #561023));
    cursor: pointer;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s ease;
}

body.host-home-page .activity-bell-trigger,
body.host-registry-page .activity-bell-trigger,
body.account-details-page .activity-bell-trigger {
    color: var(--hzl-cream, var(--cream, #ede6dc));
}

.activity-bell-trigger:hover,
.activity-bell-trigger[aria-expanded="true"] {
    background-color: color-mix(in oklab, currentColor 13%, transparent);
}

.activity-bell-icon {
    display: block;
    flex-shrink: 0;
}

.activity-count-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e45558;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}

.activity-panel {
    position: absolute;
    opacity: 0;
    visibility: hidden;
}

/* Account photos use the same circular crop at every size. */
.user-badge .user-badge-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-badge .user-badge-photo[hidden] { display: none; }

/* Keep the initial in the brand seal when a photo is absent or fails to load. */
.user-badge:has(> .user-badge-photo:not([hidden])) {
    -webkit-mask: none;
    mask: none;
    border-radius: 50% !important;
}
