/*------------------------хедер------------------------------*/
.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    font-size: 18px;
    color: #fff;
}

.header__link-list {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}
.header__logo-radar {
    width: 300px;
    height: 100px;
}

.header__link-item {
    position: relative;
    padding: 10px;
}
.header__link-item a {
    text-decoration: none;
    padding-bottom: 4px;
    display: block;
    position: relative; /* нужно для псевдоэлемента */
    transition: color 0.5s ease;
}
.header__link-item a:hover {
    color: rgba(102, 255, 0, 0.64);
}
.header__link-item a::after {
    content: "";
    position: absolute;
    bottom: 0; /* линия внизу текста */
    left: 50%; /* начало с центра */
    width: 0;
    height: 2px; /* толщина линии */
    background-color: #ffffff; /* цвет underline */
    transition: width 0.5s ease;
    transform: translateX(-50%);
}

.header__link-item a:hover::after {
    width: 100%; /* растягиваем линию до полной ширины */
}

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    z-index: 1000;
    padding: 10px;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transition-delay: 0s;
}
/* Стилі для контейнера з кнопками (вхід + чат) */
.header-wrapper > div:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Mobile collapsible header (scoped) --- */
header.mobile-collapsible .hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

header.mobile-collapsible .hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 4px 0;
    transition: transform .3s ease, opacity .3s ease;
}

header.mobile-collapsible .hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
header.mobile-collapsible .hamburger.active span:nth-child(2) {
    opacity: 0;
}
header.mobile-collapsible .hamburger.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

header.mobile-collapsible .hamburger:hover {
    background: linear-gradient(120deg, rgba(79,156,255,0.15), rgba(123,97,255,0.12));
    border-color: rgba(79,156,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79,156,255,0.18);
}

header.mobile-collapsible .hamburger:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 4px 10px rgba(79,156,255,0.15);
}

header.mobile-collapsible .hamburger.active {
    background: linear-gradient(120deg, rgba(79,156,255,0.20), rgba(123,97,255,0.15));
    border-color: rgba(79,156,255,0.35);
}

@media (max-width: 1250px) {
    header.mobile-collapsible .header-wrapper {
        position: relative;
    }

    header.mobile-collapsible .hamburger {
        display: inline-flex;
        position: absolute;
        left: 10px;
        top: 10px;
        z-index: 1100;
    }

    header.mobile-collapsible .header__logo {
        margin-left: 52px; /* место под гамбургер */
    }

    header.mobile-collapsible .header__link-list {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80%;
        max-width: 320px;
        background: linear-gradient(180deg, rgba(15,22,34,0.95), rgba(11,17,26,0.92));
        backdrop-filter: blur(20px);
        border-right: 1px solid rgba(255,255,255,0.10);
        flex-direction: column;
        padding: 80px 16px 16px;
        gap: 8px;
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 28px rgba(0,0,0,0.4);
        z-index: 99999; /* гарантированно над любыми кнопками/эффектами */
    }

    header.mobile-collapsible .header__link-list.open {
        transform: translateX(0);
    }

    header.mobile-collapsible .header__link-item {
        padding: 0;
        margin: 0;
    }

    header.mobile-collapsible .header__link-item a {
        position: relative;
        display: block;
        color: var(--text, #e7edf6);
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        padding: 12px 16px;
        margin: 0;
        background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
        border: 1px solid rgba(255,255,255,0.10);
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(8px);
    }

    header.mobile-collapsible .header__link-item a:hover {
        color: #cfe3ff;
        background: linear-gradient(120deg, rgba(79,156,255,0.15), rgba(123,97,255,0.12));
        border-color: rgba(79,156,255,0.25);
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 12px 28px rgba(79,156,255,0.18);
        text-shadow: 0 0 10px rgba(111, 171, 255, .5);
    }

    header.mobile-collapsible .header__link-item a:active {
        transform: translateY(0) scale(0.98);
        box-shadow: 0 6px 14px rgba(79,156,255,0.15);
    }

    header.mobile-collapsible .header__link-item a::after {
        display: none; /* відключаємо underline для мобільного меню */
    }

    /* Активний пункт меню (поточна сторінка) */
    header.mobile-collapsible .header__link-item.active a,
    header.mobile-collapsible .header__link-item a.active {
        background: linear-gradient(120deg, rgba(79,156,255,0.20), rgba(123,97,255,0.15));
        border-color: rgba(79,156,255,0.35);
        color: #4f9cff;
        box-shadow: 0 8px 24px rgba(79,156,255,0.25);
    }

    /* Анімація появи пунктів меню */
    header.mobile-collapsible .header__link-item {
        opacity: 0;
        transform: translateX(-20px);
        animation: slideInMenu 0.4s ease-out forwards;
    }

    header.mobile-collapsible .header__link-item:nth-child(1) { animation-delay: 0.1s; }
    header.mobile-collapsible .header__link-item:nth-child(2) { animation-delay: 0.15s; }
    header.mobile-collapsible .header__link-item:nth-child(3) { animation-delay: 0.2s; }
    header.mobile-collapsible .header__link-item:nth-child(4) { animation-delay: 0.25s; }
    header.mobile-collapsible .header__link-item:nth-child(5) { animation-delay: 0.3s; }
    header.mobile-collapsible .header__link-item:nth-child(6) { animation-delay: 0.35s; }
    header.mobile-collapsible .header__link-item:nth-child(7) { animation-delay: 0.4s; }
    header.mobile-collapsible .header__link-item:nth-child(8) { animation-delay: 0.45s; }

    @keyframes slideInMenu {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Оверлей для закриття меню */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    body.no-scroll {
        overflow: hidden;
    }
}