/* ==========================================================================
   NYOSA V2 — HEADER CSS
   Compatible with current /v2/header.php
   ========================================================================== */


/* ==========================================================================
   GLOBAL HEADER
   ========================================================================== */

.nyosa-header {
    position: relative;
    z-index: 1000;

    width: 100%;

    background: rgba(255, 255, 255, 0.98);

    border-bottom: 1px solid rgba(15, 23, 42, 0.08);

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 8px 30px rgba(15, 45, 80, 0.06);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}


/* ==========================================================================
   MAIN HEADER
   ========================================================================== */

.header-main {
    width: 100%;
}


.header-inner {
    width: min(100% - 40px, 1240px);

    min-height: 76px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    gap: 18px;

    box-sizing: border-box;
}


/* ==========================================================================
   LOGO
   ========================================================================== */

.nyosa-logo {
    display: inline-flex;

    align-items: center;

    flex-shrink: 0;

    text-decoration: none;

    line-height: 0;
}


.nyosa-logo img {
    display: block;

    width: auto;

    max-width: 155px;

    height: 48px;

    object-fit: contain;
}


/* ==========================================================================
   DESKTOP NAVIGATION
   ========================================================================== */

.desktop-navigation {
    display: flex;

    align-items: center;

    justify-content: center;

    flex: 1;

    min-width: 0;

    gap: 3px;
}


.desktop-navigation > a,
.nav-dropdown-button {
    position: relative;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 40px;

    padding: 0 11px;

    border: 0;

    border-radius: 9px;

    background: transparent;

    color: #334155;

    font-family: inherit;

    font-size: 13px;

    font-weight: 650;

    line-height: 1;

    white-space: nowrap;

    text-decoration: none;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.desktop-navigation > a:hover,
.nav-dropdown-button:hover {
    color: #1a5fb4;

    background: #f1f6fc;

    transform: translateY(-1px);
}


.desktop-navigation > a.active {
    color: #1a5fb4;

    background: #eef5fd;
}


.desktop-navigation > a.active::after {
    content: "";

    position: absolute;

    left: 50%;

    bottom: 3px;

    width: 18px;

    height: 2px;

    border-radius: 999px;

    background: #ffb84d;

    transform: translateX(-50%);
}


/* ==========================================================================
   OPPORTUNITIES DROPDOWN
   ========================================================================== */

.nav-dropdown {
    position: relative;

    display: flex;

    align-items: center;
}


.nav-dropdown-button {
    gap: 5px;
}


.dropdown-arrow {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    font-size: 14px;

    line-height: 1;

    transition:
        transform 0.2s ease;
}


.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}


.nav-dropdown-menu {
    position: absolute;

    top: calc(100% + 8px);

    left: 50%;

    width: 245px;

    padding: 8px;

    background: #ffffff;

    border: 1px solid #e3eaf2;

    border-radius: 14px;

    box-shadow:
        0 18px 45px rgba(15, 45, 80, 0.14);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translate(-50%, -6px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}


.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translate(-50%, 0);
}


.nav-dropdown-menu a {
    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    min-height: 42px;

    padding: 0 11px;

    border-radius: 9px;

    color: #334155;

    font-size: 13px;

    font-weight: 600;

    line-height: 1.2;

    text-decoration: none;

    box-sizing: border-box;

    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}


.nav-dropdown-menu a:hover {
    color: #1a5fb4;

    background: #f1f6fc;

    transform: translateX(2px);
}


.nav-dropdown-menu a span:first-child {
    width: 24px;

    min-width: 24px;

    text-align: center;

    font-size: 18px;
}


/* ==========================================================================
   HEADER ACTIONS
   ========================================================================== */

.header-actions {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 7px;

    flex-shrink: 0;
}


/* ==========================================================================
   SEARCH BUTTON
   ========================================================================== */

.header-icon-button {
    width: 40px;

    height: 40px;

    padding: 0;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #e2e9f1;

    border-radius: 11px;

    background: #ffffff;

    color: #334155;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


.header-icon-button:hover {
    color: #1a5fb4;

    background: #f6f9fd;

    border-color: #cbd9ea;

    box-shadow:
        0 5px 16px rgba(26, 95, 180, 0.10);

    transform: translateY(-1px);
}


.header-icon-button svg {
    width: 18px;

    height: 18px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;

    stroke-linejoin: round;
}


/* ==========================================================================
   LOGIN
   ========================================================================== */

.header-login {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 40px;

    padding: 0 14px;

    border: 1px solid #dbe4ef;

    border-radius: 10px;

    background: #ffffff;

    color: #1a5fb4;

    font-size: 13px;

    font-weight: 700;

    white-space: nowrap;

    text-decoration: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


.header-login:hover {
    background: #f2f7fd;

    border-color: #bcd0e6;

    box-shadow:
        0 6px 18px rgba(26, 95, 180, 0.10);

    transform: translateY(-1px);
}


/* ==========================================================================
   REGISTER
   ========================================================================== */

.header-register {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 40px;

    padding: 0 15px;

    border-radius: 10px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #1a5fb4,
            #174f97
        );

    font-size: 13px;

    font-weight: 750;

    white-space: nowrap;

    text-decoration: none;

    box-shadow:
        0 7px 18px rgba(26, 95, 180, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.header-register:hover {
    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 10px 24px rgba(26, 95, 180, 0.28);
}


/* ==========================================================================
   PROFILE
   ========================================================================== */

.header-profile {
    width: 40px;

    height: 40px;

    min-width: 40px;

    min-height: 40px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    border: 2px solid #ffffff;

    border-radius: 50%;

    background: #eef4fb;

    box-shadow:
        0 3px 12px rgba(15, 45, 80, 0.12);

    color: #ffffff;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.header-profile:hover {
    transform: translateY(-1px);

    box-shadow:
        0 6px 18px rgba(26, 95, 180, 0.16);
}


.profile-initials {
    width: 100%;

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #1a5fb4,
            #174f97
        );

    color: #ffffff;

    font-size: 12px;

    font-weight: 800;
}


/* ==========================================================================
   SEARCH PANEL
   ========================================================================== */

.header-search-panel {
    position: absolute;

    top: calc(100% + 10px);

    right: 20px;

    z-index: 1050;

    width: min(500px, calc(100vw - 40px));

    padding: 14px;

    background:
        rgba(255, 255, 255, 0.98);

    border: 1px solid #e3eaf2;

    border-radius: 16px;

    box-shadow:
        0 18px 45px rgba(15, 45, 80, 0.14);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform:
        translateY(-8px)
        scale(.98);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}


.header-search-panel.open,
.header-search-panel.is-open {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateY(0)
        scale(1);
}


.header-search-form {
    display: flex;

    align-items: center;

    gap: 9px;
}


.header-search-form svg {
    width: 20px;

    height: 20px;

    flex-shrink: 0;

    fill: none;

    stroke: #64748b;

    stroke-width: 1.8;

    stroke-linecap: round;

    stroke-linejoin: round;
}


.header-search-form input {
    flex: 1;

    min-width: 0;

    height: 42px;

    padding: 0 11px;

    border: 1px solid #e2e8f0;

    border-radius: 9px;

    outline: none;

    color: #172033;

    background: #ffffff;

    font-size: 13px;
}


.header-search-form input:focus {
    border-color: #1a5fb4;

    box-shadow:
        0 0 0 3px rgba(26, 95, 180, .08);
}


.header-search-form button {
    height: 42px;

    padding: 0 15px;

    border: 0;

    border-radius: 9px;

    color: #ffffff;

    background: #1a5fb4;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;
}


/* ==========================================================================
   MOBILE MENU BUTTON
========================================================================== */

.header-menu-btn,
#nyosaMenuButton {
    width: 42px;

    height: 42px;

    padding: 0;

    display: none;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    gap: 5px;

    flex-shrink: 0;

    border: 1px solid #dce5ef;

    border-radius: 11px;

    background: #ffffff;

    color: #163f70;

    cursor: pointer;

    box-shadow:
        0 4px 14px rgba(15, 45, 80, 0.06);

    box-sizing: border-box;
}


.header-menu-btn:hover,
#nyosaMenuButton:hover {
    background: #f5f8fc;

    border-color: #c8d7e8;
}


.header-menu-btn span,
#nyosaMenuButton span {
    display: block;

    width: 19px;

    height: 2px;

    border-radius: 999px;

    background: #163f70;

    transition:
        transform .25s ease,
        opacity .2s ease,
        width .25s ease;
}


/* Hamburger active */

.header-menu-btn.is-active span:nth-child(1),
#nyosaMenuButton.is-active span:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}


.header-menu-btn.is-active span:nth-child(2),
#nyosaMenuButton.is-active span:nth-child(2) {
    opacity: 0;

    width: 0;
}


.header-menu-btn.is-active span:nth-child(3),
#nyosaMenuButton.is-active span:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


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

.mobile-menu-overlay,
#nyosaMenuOverlay {
    position: fixed;

    inset: 0;

    z-index: 1090;

    background:
        rgba(9, 28, 50, 0.48);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    backdrop-filter: blur(4px);

    -webkit-backdrop-filter: blur(4px);

    transition:
        opacity .25s ease,
        visibility .25s ease;
}


.mobile-menu-overlay.open,
#nyosaMenuOverlay.open {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;
}


/* ==========================================================================
   MOBILE DRAWER
========================================================================== */

.mobile-menu,
#nyosaMobileMenu {
    position: fixed;

    top: 0;

    right: 0;

    z-index: 1100;

    width: min(365px, 88vw);

    height: 100dvh;

    padding:
        18px 18px 145px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f8fbff 100%
        );

    border-left: 1px solid rgba(26, 95, 180, .10);

    box-shadow:
        -20px 0 60px rgba(9, 31, 55, .16);

    transform:
        translateX(105%);

    visibility: hidden;

    pointer-events: none;

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;

    transition:
        transform .32s cubic-bezier(.22,.8,.25,1),
        visibility .32s ease;
}


.mobile-menu.open,
#nyosaMobileMenu.open {
    transform:
        translateX(0);

    visibility: visible;

    pointer-events: auto;
}


/* ==========================================================================
   MOBILE MENU INNER
========================================================================== */

.mobile-menu-inner {
    width: 100%;

    min-height: 100%;
}


/* ==========================================================================
   MOBILE MENU TOP
========================================================================== */

.mobile-menu-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 14px;

    padding-bottom: 13px;

    border-bottom:
        1px solid #e8edf4;
}


.mobile-menu-brand {
    display: flex;

    flex-direction: column;
}


.mobile-menu-label {
    color: #1a5fb4;

    font-size: 11px;

    font-weight: 850;

    letter-spacing: .15em;
}


.mobile-menu-title {
    margin-top: 3px;

    color: #172033;

    font-size: 18px;

    font-weight: 800;
}


/* ==========================================================================
   MOBILE CLOSE
========================================================================== */

.mobile-menu-close,
#nyosaMenuClose {
    width: 36px;

    height: 36px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 0;

    border: 1px solid #dce5ef;

    border-radius: 9px;

    background: #ffffff;

    color: #163f70;

    font-size: 22px;

    line-height: 1;

    cursor: pointer;
}


/* ==========================================================================
   MOBILE PROFILE CARD
========================================================================== */

.mobile-profile-card {
    display: flex;

    align-items: center;

    gap: 11px;

    width: 100%;

    min-height: 68px;

    margin-bottom: 16px;

    padding: 10px 11px;

    border:
        1px solid #e0e8f2;

    border-radius: 14px;

    background: #ffffff;

    color: #172033;

    text-decoration: none;

    box-shadow:
        0 5px 18px rgba(15, 45, 80, .05);
}


.mobile-profile-avatar {
    width: 43px;

    height: 43px;

    min-width: 43px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    border-radius: 50%;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #1a5fb4,
            #174f97
        );

    font-size: 12px;

    font-weight: 800;
}


.mobile-profile-avatar.guest {
    padding: 10px;
}


.mobile-profile-avatar svg {
    width: 100%;

    height: 100%;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.7;

    stroke-linecap: round;

    stroke-linejoin: round;
}


.mobile-profile-info {
    min-width: 0;

    flex: 1;
}


.mobile-profile-info strong {
    display: block;

    overflow: hidden;

    color: #172033;

    font-size: 13px;

    font-weight: 750;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.mobile-profile-info small {
    display: block;

    margin-top: 3px;

    color: #7a8799;

    font-size: 10px;
}


.mobile-profile-arrow {
    color: #1a5fb4;

    font-size: 18px;
}


/* ==========================================================================
   MOBILE NAV
========================================================================== */

.mobile-menu-links {
    display: flex;

    flex-direction: column;

    gap: 2px;
}


.mobile-menu-links > a {
    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    min-height: 38px;

    padding: 7px 10px;

    border-radius: 8px;

    color: #3b4a5c;

    font-size: 13px;

    font-weight: 600;

    line-height: 1.25;

    text-decoration: none;

    box-sizing: border-box;

    transition:
        color .18s ease,
        background .18s ease,
        transform .18s ease;
}


.mobile-menu-links > a:hover {
    color: #1a5fb4;

    background: #f0f6fd;

    transform: translateX(2px);
}


.mobile-nav-icon {
    width: 24px;

    min-width: 24px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    font-size: 18px;

    line-height: 1;
}


.mobile-section-title {
    margin:
        13px 5px 5px;

    color: #163f70;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: .1em;

    text-transform: uppercase;
}


/* ==========================================================================
   TRUST
========================================================================== */

.mobile-menu-trust {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    margin-top: 18px;

    padding: 13px;

    border:
        1px solid #e2eaf3;

    border-radius: 12px;

    background: #f7faff;
}


.trust-icon {
    font-size: 20px;
}


.mobile-menu-trust strong {
    display: block;

    color: #26384d;

    font-size: 12px;
}


.mobile-menu-trust p {
    margin: 3px 0 0;

    color: #7b8797;

    font-size: 10px;

    line-height: 1.4;
}


/* ==========================================================================
   MOBILE AUTH
========================================================================== */

.mobile-auth-buttons {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 13px;
}


.mobile-login,
.mobile-register,
.mobile-logout {
    min-height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    font-size: 12px;

    font-weight: 700;

    text-decoration: none;
}


.mobile-login {
    border: 1px solid #dbe4ef;

    background: #ffffff;

    color: #1a5fb4;
}


.mobile-register {
    background:
        linear-gradient(
            135deg,
            #1a5fb4,
            #174f97
        );

    color: #ffffff;
}


.mobile-logout {
    margin-top: 12px;

    border:
        1px solid #efd6d6;

    color: #b42318;

    background: #fff8f8;
}


/* ==========================================================================
   BODY LOCK
========================================================================== */

body.nyosa-menu-open {
    overflow: hidden;
}


/* ==========================================================================
   TABLET
========================================================================== */

@media (max-width: 1100px) {

    .header-inner {
        width:
            min(
                calc(100% - 30px),
                1100px
            );

        gap: 12px;
    }


    .desktop-navigation {
        gap: 1px;
    }


    .desktop-navigation > a,
    .nav-dropdown-button {
        padding: 0 7px;

        font-size: 12px;
    }


    .nyosa-logo img {
        max-width: 135px;

        height: 43px;
    }


    .header-login,
    .header-register {
        padding-left: 10px;

        padding-right: 10px;

        font-size: 12px;
    }

}


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

@media (max-width: 900px) {

    .header-inner {
        width:
            calc(100% - 28px);

        min-height: 68px;

        gap: 10px;
    }


    .header-menu-btn,
    #nyosaMenuButton {
        display: inline-flex;

        order: 1;
    }


    .nyosa-logo {
        order: 2;

        flex: 1;

        justify-content: center;
    }


    .nyosa-logo img {
        max-width: 145px;

        height: 46px;
    }


    .desktop-navigation {
        display: none;
    }


    .header-actions {
        order: 3;

        margin-left: auto;

        gap: 5px;
    }


    .header-icon-button {
        display: none;
    }


    .header-login,
    .header-register {
        display: none;
    }


    .header-profile {
        width: 38px;

        height: 38px;

        min-width: 38px;

        min-height: 38px;
    }


    .mobile-menu,
    #nyosaMobileMenu {
        padding-bottom: 145px;
    }

}


/* ==========================================================================
   SMALL PHONES
========================================================================== */

@media (max-width: 480px) {

    .header-inner {
        width:
            calc(100% - 20px);

        min-height: 64px;
    }


    .header-menu-btn,
    #nyosaMenuButton {
        width: 40px;

        height: 40px;
    }


    .nyosa-logo img {
        max-width: 150px;

        height: 46px;
    }


    .mobile-menu,
    #nyosaMobileMenu {
        width:
            min(
                350px,
                92vw
            );

        padding:
            15px
            14px
            150px;
    }


    .mobile-menu-links > a {
        min-height: 36px;

        font-size: 12.5px;
    }


    .mobile-profile-card {
        min-height: 64px;
    }

}


/* ==========================================================================
   VERY SMALL PHONES
========================================================================== */

@media (max-width: 360px) {

    .header-inner {
        width:
            calc(100% - 14px);
    }


    .nyosa-logo img {
        max-width: 130px;

        height: 42px;
    }


    .header-menu-btn,
    #nyosaMenuButton {
        width: 38px;

        height: 38px;
    }

}


/* ==========================================================================
   ACCESSIBILITY
========================================================================== */

.header-menu-btn:focus-visible,
#nyosaMenuButton:focus-visible,
.mobile-menu-close:focus-visible,
#nyosaMenuClose:focus-visible,
.desktop-navigation a:focus-visible,
.nav-dropdown-button:focus-visible,
.header-login:focus-visible,
.header-register:focus-visible,
.header-profile:focus-visible {
    outline:
        3px solid
        rgba(26, 95, 180, .22);

    outline-offset: 2px;
}


/* ==========================================================================
   REDUCED MOTION
========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .nyosa-header *,
    .nyosa-header *::before,
    .nyosa-header *::after {
        transition: none !important;

        animation: none !important;
    }

}