/* ══════════════════════════════════════════════
   VOLNYN SHARED HEADER CSS
   Used by: main app, freelancer, property
   ══════════════════════════════════════════════ */

/* ── Font & box-model isolation ── */
#stickyHeader {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
    line-height: 1.5;
}
#stickyHeader *:not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-regular):not(.fa-brands):not([class*="fa-"]) {
    font-family: inherit;
    box-sizing: border-box;
}

.header-area {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    background: #fff !important;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    min-height: auto;
    max-height: none;
}
.header-area.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
}

.hdr-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 28px !important;
}

/* ── Navbar shell — locked height across all projects ── */
#stickyHeader .navbar,
#stickyHeader .navbar.navbar-expand-lg,
#stickyHeader.header-area .navbar,
.header-area .hdr-nav {
    display: flex !important;
    align-items: center;
    gap: 0;
    padding: 0 !important;
    flex-wrap: nowrap !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    --mdb-navbar-padding-y: 0;
    --mdb-navbar-padding-x: 0;
}

/* ── Prevent sub-app theme CSS from breaking navbar ── */
#stickyHeader .navbar-collapse { display: flex !important; }
#stickyHeader .navbar-toggler { display: none; }

/* ── All items inside navbar must respect height ── */
#stickyHeader .hdr-nav > *,
#stickyHeader .navbar > * {
    max-height: 56px;
}
#stickyHeader .hdr-collapse,
#stickyHeader .navbar-collapse {
    max-height: 56px;
    overflow: visible;
}

/* ── Logo — fixed height ── */
.hdr-brand { flex-shrink: 0; margin-right: 28px; padding: 0; }
.hdr-brand img { height: 36px; width: auto; display: block; }

/* ── Custom toggler ── */
.hdr-toggler {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 10px;
    background: transparent;
    display: flex; flex-direction: column; gap: 4px;
    cursor: pointer;
}
.hdr-toggler:focus { box-shadow: none; outline: none; }
.hdr-toggler-bar {
    display: block; width: 20px; height: 2px;
    background: #374151; border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

/* ── Mobile right cluster ── */
.hdr-mobile-right {
    display: flex; align-items: center; gap: 10px;
    margin-left: auto;
}

/* ── Collapse panel ── */
.hdr-collapse {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}

/* ── Nav links ── */
.hdr-nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}
.hdr-link {
    font-size: 13.5px;
    font-weight: 600;
    color: #374151 !important;
    padding: 8px 14px !important;
    white-space: nowrap;
    border-radius: 7px;
    text-decoration: none;
    display: block;
    transition: background .2s, color .2s;
}
.hdr-link:hover { color: #6366f1 !important; background: rgba(99,102,241,.06); text-decoration: none; }
.hdr-link.active { color: #6366f1 !important; }

/* ── Search bar — flex-grow fills all remaining space ── */
.hdr-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    background: #f4f5f7;
    border: 1.5px solid #e8eaed;
    border-radius: 10px;
    padding: 0 6px 0 14px;
    height: 42px;
    margin: 0 20px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.hdr-search:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
    background: #fff;
}
.hdr-search-icon {
    color: #9ca3af;
    font-size: 13px;
    margin-right: 10px;
    flex-shrink: 0;
}
.hdr-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13.5px;
    color: #374151;
    min-width: 0;
}
.hdr-search input::placeholder { color: #b0b7c3; }
.hdr-search-submit {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border: none; border-radius: 7px;
    background: #6366f1;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.hdr-search-submit:hover { background: #4f46e5; }

/* ── Auth buttons ── */
.hdr-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.hdr-login-btn {
    display: inline-flex; align-items: center;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 18px;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .2s, color .2s;
    line-height: 1;
}
.hdr-login-btn:hover {
    border-color: #6366f1; color: #6366f1;
    text-decoration: none;
}
.hdr-signup-btn {
    display: inline-flex; align-items: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 20px;
    background: #09c76b;
    color: #fff !important;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    transition: background .2s, box-shadow .2s;
}
.hdr-signup-btn:hover {
    background: #059952;
    box-shadow: 0 4px 16px rgba(9,199,107,.35);
    color: #fff !important;
    text-decoration: none;
}
/* Main app Sign Up uses indigo */
.hdr-signup-btn--indigo { background: #6366f1; }
.hdr-signup-btn--indigo:hover { background: #4f46e5; box-shadow: 0 4px 16px rgba(99,102,241,.35); }

/* ── Logged-in user cluster ── */
.hdr-user-cluster {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.hdr-icon-btn {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: #f4f5f7; border: 1px solid #e8eaed;
    color: #6b7280; font-size: 15px; cursor: pointer;
    text-decoration: none; position: relative;
    transition: background .2s, color .2s, border-color .2s;
}
.hdr-icon-btn:hover { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.25); color: #6366f1; text-decoration: none; }
.hdr-icon-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 16px; height: 16px; border-radius: 50%;
    background: #ef4444; color: #fff;
    font-size: 9px; font-weight: 700; line-height: 16px;
    text-align: center; padding: 0 3px;
    border: 2px solid #fff;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 991px) {
    #stickyHeader .navbar,
    .hdr-nav { flex-wrap: wrap !important; padding-bottom: 0 !important; }
    .hdr-brand { margin-right: 0 !important; }

    #stickyHeader .navbar-toggler { display: flex !important; }
    #stickyHeader .navbar-collapse {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 12px 0 16px;
        border-top: 1px solid #f3f4f6;
        margin-top: 10px;
        flex-basis: 100%;
    }
    #stickyHeader .navbar-collapse.show,
    #stickyHeader .navbar-collapse.collapsing {
        display: flex !important;
    }

    .hdr-collapse {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0;
        padding: 12px 0 16px;
        border-top: 1px solid #f3f4f6;
        margin-top: 10px;
        flex-basis: 100%;
    }

    .hdr-nav-links {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 2px;
        margin-bottom: 12px;
    }
    .hdr-link {
        padding: 10px 12px !important;
        font-size: 14px;
    }

    .hdr-search {
        width: 100% !important;
        margin: 0 0 12px !important;
        height: 46px;
        flex: none !important;
    }

    .hdr-auth {
        width: 100%;
        justify-content: stretch;
    }
    .hdr-auth .hdr-login-btn,
    .hdr-auth .hdr-signup-btn {
        flex: 1;
        justify-content: center;
    }

    .hdr-user-cluster { padding: 8px 0; }
}

@media (max-width: 480px) {
    .hdr-container { padding: 0 16px !important; }
    .hdr-brand img { height: 30px !important; }
    .hdr-mobile-right { gap: 8px; }
    .hdr-login-btn { padding: 6px 14px; font-size: 12px; }
}

/* ══════════════════════════════════════════════
   PLATFORM STRIP
   ══════════════════════════════════════════════ */
.platform-strip {
    background: #1c1f2e;
    border-top: 1px solid rgba(255,255,255,.07);
}
.ps-inner {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ps-inner::-webkit-scrollbar { display: none; }

.ps-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 26px;
    text-decoration: none;
    border-right: 1px solid rgba(255,255,255,.05);
    flex: 1;
    transition: background .2s;
}
.ps-btn:last-child { border-right: none; }
.ps-btn:hover { text-decoration: none; }

.ps-btn-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    transition: transform .2s;
}
.ps-btn:hover .ps-btn-icon { transform: scale(1.12); }

.ps-btn-text { display: flex; flex-direction: column; gap: 2px; }
.ps-btn-label {
    font-size: 12.5px; font-weight: 700; color: #f0f0f0;
    line-height: 1; letter-spacing: .2px;
}
.ps-btn-tag {
    font-size: 10.5px; color: rgba(255,255,255,.35);
    font-weight: 500; line-height: 1; letter-spacing: .3px;
}

.ps-btn-freelancer .ps-btn-icon { background: rgba(9,199,107,.15);   color: #09c76b; }
.ps-btn-freelancer:hover         { background: rgba(9,199,107,.07); }
.ps-btn-freelancer:hover .ps-btn-label { color: #09c76b; }

.ps-btn-builder .ps-btn-icon    { background: rgba(99,102,241,.18);  color: #6366f1; }
.ps-btn-builder:hover            { background: rgba(99,102,241,.07); }
.ps-btn-builder:hover .ps-btn-label { color: #6366f1; }

.ps-btn-property .ps-btn-icon   { background: rgba(219,29,35,.14);   color: #DB1D23; }
.ps-btn-property:hover           { background: rgba(219,29,35,.07); }
.ps-btn-property:hover .ps-btn-label { color: #DB1D23; }

.ps-btn-games .ps-btn-icon      { background: rgba(139,92,246,.15);  color: #8b5cf6; }
.ps-btn-games:hover              { background: rgba(139,92,246,.07); }
.ps-btn-games:hover .ps-btn-label { color: #8b5cf6; }

.ps-btn-nft .ps-btn-icon        { background: rgba(245,158,11,.14);  color: #f59e0b; }
.ps-btn-nft:hover                { background: rgba(245,158,11,.07); }
.ps-btn-nft:hover .ps-btn-label { color: #f59e0b; }

.ps-btn-builder .ps-btn-icon    { background: rgba(99,102,241,.15);  color: #6366f1; }
.ps-btn-builder:hover            { background: rgba(99,102,241,.07); }
.ps-btn-builder:hover .ps-btn-label { color: #6366f1; }

@media (max-width: 480px) {
    .ps-btn { padding: 9px 16px; gap: 8px; }
    .ps-btn-tag { display: none; }
    .ps-btn-icon { width: 26px; height: 26px; font-size: 12px; }
    .ps-btn-label { font-size: 12px; }
}

/* ══════════════════════════════════════════════
   DROPDOWN MENUS
   ══════════════════════════════════════════════ */
.hdr-dropdown {
    position: relative;
}
.hdr-dropdown-toggle {
    display: flex !important;
    align-items: center;
    gap: 5px;
}
.hdr-dropdown-arrow {
    font-size: 9px;
    transition: transform .25s;
    opacity: .5;
}
.hdr-dropdown:hover .hdr-dropdown-arrow,
.hdr-dropdown-menu.show ~ .hdr-dropdown-toggle .hdr-dropdown-arrow {
    transform: rotate(180deg);
    opacity: .8;
}
.hdr-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.10);
    padding: 6px 0;
    z-index: 1050;
    list-style: none;
    margin: 4px 0 0;
}
.hdr-dropdown-menu.show {
    display: block;
}
.hdr-dropdown-item {
    display: block;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.hdr-dropdown-item:hover {
    background: rgba(99,102,241,.06);
    color: #6366f1;
    text-decoration: none;
}

/* ── Dropdown responsive ── */
@media (max-width: 991px) {
    .hdr-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0 16px;
        margin: 0;
        background: transparent;
    }
    .hdr-dropdown-menu.show {
        display: block;
    }
    .hdr-dropdown-item {
        padding: 8px 12px;
        font-size: 13.5px;
        color: #6b7280;
    }
    .hdr-dropdown-item:hover {
        background: rgba(99,102,241,.06);
    }
}
