/* ==========================================================================
   COS Academy — Header redesign (2026)
   Self-contained, scoped under .site-header so it won't affect other pages.
   ========================================================================== */

:root {
    --hd-accent:        #4cbcb1;
    --hd-accent-dark:   #37a89d;
    --hd-accent-soft:   rgba(76, 188, 177, 0.10);
    --hd-ink:           #17202a;
    --hd-muted:         #5b6672;
    --hd-line:          #e9edf1;
    --hd-white:         #ffffff;
    --hd-shadow:        0 8px 30px rgba(23, 32, 42, 0.08);
    --hd-radius:        12px;
    --hd-ease:          cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Shell ------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--hd-line);
    transition: box-shadow 0.3s var(--hd-ease), background 0.3s var(--hd-ease);
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--hd-shadow);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 74px;
}

/* ---- Logo -------------------------------------------------------------- */
.site-header__logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    transition: opacity 0.2s var(--hd-ease);
}
.site-header__logo:hover { opacity: 0.8; }
.site-header__logo img {
    display: block;
    height: 46px;
    width: auto;
}

/* Text wordmark (used instead of an image logo) */
.site-header__wordmark {
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    font-style: normal;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1;
    color: #55616c;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}
.site-header__wordmark .wm-accent { color: var(--hd-accent); }

/* ---- Primary navigation ------------------------------------------------ */
.site-header__nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.site-header .platform-links {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-header .platform-links li { list-style: none; }

.site-header .platform-links li a {
    position: relative;
    display: inline-block;
    padding: 6px 2px;
    color: var(--hd-ink);
    font: 15px 'BPG ExtraSquare Mtavruli', sans-serif;
    line-height: 1.35;
    text-decoration: none;
    background: none;                 /* clear old gradient underline */
    transition: color 0.25s var(--hd-ease);
}
.site-header .platform-links li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--hd-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s var(--hd-ease);
}
.site-header .platform-links li a:hover { color: var(--hd-accent-dark); }
.site-header .platform-links li a:hover::after { transform: scaleX(1); }

.site-header .platform-links li a.active-link {
    color: var(--hd-accent-dark);
    font-weight: 700;
}
.site-header .platform-links li a.active-link::after { transform: scaleX(1); }

/* ---- Right-side actions ------------------------------------------------ */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.site-header .auth-register {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    font: 14px 'BPG ExtraSquare Mtavruli', sans-serif;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s var(--hd-ease),
                box-shadow 0.2s var(--hd-ease),
                background 0.2s var(--hd-ease),
                color 0.2s var(--hd-ease),
                border-color 0.2s var(--hd-ease);
}
.btn-auth--ghost {
    color: var(--hd-ink);
    background: transparent;
    border: 1.5px solid var(--hd-line);
}
.btn-auth--ghost:hover {
    color: var(--hd-accent-dark);
    border-color: var(--hd-accent);
    background: var(--hd-accent-soft);
}
.btn-auth--solid {
    color: #fff;
    background: var(--hd-accent);
    border: 1.5px solid var(--hd-accent);
    box-shadow: 0 6px 16px rgba(76, 188, 177, 0.30);
}
.btn-auth--solid:hover {
    color: #fff;
    background: var(--hd-accent-dark);
    border-color: var(--hd-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(76, 188, 177, 0.42);
}
.btn-auth--solid:active,
.btn-auth--ghost:active { transform: translateY(0); }

/* Logged-in user chip */
.site-header .user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 6px;
    border-radius: 999px;
    border: 1.5px solid var(--hd-line);
    text-decoration: none;
    color: var(--hd-ink);
    transition: border-color 0.2s var(--hd-ease), background 0.2s var(--hd-ease);
}
.site-header .user-chip:hover {
    border-color: var(--hd-accent);
    background: var(--hd-accent-soft);
}
.site-header .user-chip__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hd-accent-soft);
    flex: 0 0 auto;
}
.site-header .user-chip__avatar img { width: 15px; height: 15px; }
.site-header .user-chip__name {
    font: 14px 'BPG ExtraSquare Mtavruli', sans-serif;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Language selector ------------------------------------------------- */
.site-header .lang_menu { position: relative; }

.site-header .lang_btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid var(--hd-line);
    border-radius: 999px;
    background: transparent;
    color: var(--hd-ink);
    font: 13px 'BPG Mrgvlovani', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s var(--hd-ease), color 0.2s var(--hd-ease), background 0.2s var(--hd-ease);
}
.site-header .lang_btn:hover,
.site-header .lang_btn[aria-expanded="true"] {
    border-color: var(--hd-accent);
    color: var(--hd-accent-dark);
    background: var(--hd-accent-soft);
}
.site-header .lang_btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.site-header .lang_btn__code { line-height: 1; letter-spacing: 0.5px; }
.site-header .lang_btn .lang_chevron {
    width: 10px;
    height: 10px;
    transition: transform 0.25s var(--hd-ease);
}
.site-header .lang_btn[aria-expanded="true"] .lang_chevron { transform: rotate(180deg); }

.site-header .lang_menu .dropdown-menu {
    min-width: 132px;
    padding: 6px;
    margin-top: 10px;
    border: 1px solid var(--hd-line);
    border-radius: var(--hd-radius);
    box-shadow: var(--hd-shadow);
    background: #fff;
    font-family: 'BPG Mrgvlovani', sans-serif;
    text-transform: uppercase;
}
.site-header .lang_menu .dropdown-item {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--hd-ink);
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: background 0.18s var(--hd-ease), color 0.18s var(--hd-ease);
}
.site-header .lang_menu .dropdown-item:hover {
    background: var(--hd-accent-soft);
    color: var(--hd-accent-dark);
}
.site-header .lang_menu .dropdown-item.active,
.site-header .lang_menu .dropdown-item:active {
    background: var(--hd-accent);
    color: #fff;
}

/* ---- Burger button ----------------------------------------------------- */
.site-header .burger-menu {
    display: none;                     /* shown < 993px */
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--hd-line);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s var(--hd-ease), background 0.2s var(--hd-ease);
}
.site-header .burger-menu:hover { border-color: var(--hd-accent); }
.site-header .burger-menu span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 2px;
    margin-left: -10px;
    background: var(--hd-ink);
    border-radius: 2px;
    transition: transform 0.3s var(--hd-ease), opacity 0.2s var(--hd-ease);
}
.site-header .burger-menu span:nth-child(1) { transform: translateY(-6px); }
.site-header .burger-menu span:nth-child(2) { transform: translateY(0); }
.site-header .burger-menu span:nth-child(3) { transform: translateY(6px); }
.site-header .burger-menu.open span:nth-child(1) { transform: rotate(45deg); }
.site-header .burger-menu.open span:nth-child(2) { opacity: 0; }
.site-header .burger-menu.open span:nth-child(3) { transform: rotate(-45deg); }

/* ---- Mobile drawer + overlay ------------------------------------------ */
.site-header .mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(340px, 86vw);
    max-height: none;
    padding: 88px 24px 32px;
    background: #fff;
    box-shadow: -14px 0 40px rgba(23, 32, 42, 0.14);
    transform: translateX(105%);
    transition: transform 0.4s var(--hd-ease);
    z-index: 1200;
    overflow-y: auto;
    border: none;
}
.site-header .mobile-menu.show {
    transform: translateX(0);
    max-height: none;
    padding: 88px 24px 32px;
}

.site-header .mobile-menu .platform-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 22px;
}
.site-header .mobile-menu .platform-links li a {
    display: block;
    padding: 14px 12px;
    border-radius: 10px;
    font-size: 16px;
}
.site-header .mobile-menu .platform-links li a::after { display: none; }
.site-header .mobile-menu .platform-links li a:hover,
.site-header .mobile-menu .platform-links li a.active-link {
    background: var(--hd-accent-soft);
}

.site-header .mobile-menu .auth-register {
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}
.site-header .mobile-menu .auth-register .btn-auth { width: 100%; height: 48px; }
.site-header .mobile-menu .user-chip { justify-content: center; }

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 32, 42, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--hd-ease), visibility 0.35s var(--hd-ease);
    z-index: 1150;
}
.mobile-overlay.show { opacity: 1; visibility: visible; }

body.menu-open { overflow: hidden; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 992px) {
    .site-header__nav,
    .site-header__actions .auth-register,
    .site-header__actions .user-chip {
        display: none !important;
    }
    .site-header .burger-menu { display: inline-flex; }
    .site-header__inner { height: 66px; gap: 12px; }
}

@media (min-width: 993px) {
    .site-header .mobile-menu,
    .mobile-overlay { display: none; }
}

@media (max-width: 420px) {
    .site-header__logo img { height: 38px; }
    .site-header__wordmark { font-size: 19px; letter-spacing: 1px; }
    .site-header .lang_btn { padding: 0 11px; height: 40px; }
    .site-header .burger-menu { width: 42px; height: 42px; }
}
