/* =========================================
   СТИЛИ УМНОГО БОКОВОГО МЕНЮ (SIDEBAR)
   ========================================= */

/* ПЛАВАЮЩИЙ БОКС ЛОГОТИПА (Слева сверху) */
.floating-logo-box {
    position: fixed;
    top: 20px;
    left: 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
}

.floating-logo-box a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0; 
}

.animated-word-container {
    background: transparent; 
    color: var(--accent-orange); 
    padding: 0; 
    display: inline-flex;
    align-items: center;
    height: 44px; 
    width: 175px; 
    overflow: hidden;
    box-sizing: border-box;
    margin-left: 5px; 
}

.animated-word {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s ease;
    line-height: 40px;
    margin: 0;
    font-size: 30px;
}

.animated-word.out { transform: translateY(-100%); opacity: 0; }
.animated-word.in { transform: translateY(100%); opacity: 0; transition: none; }
.animated-word.visible { transform: translateY(0); opacity: 1; }

/* БОКОВАЯ ПАНЕЛЬ (SIDEBAR) - Свернутое состояние (ДЕСКТОП) */
.vertical-sidebar {
    position: fixed;
    top: 110px; 
    left: 20px;
    width: 86px; 
    height: calc(100vh - 130px);
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vertical-sidebar::-webkit-scrollbar { width: 0; }

/* СОСТОЯНИЕ ПРИ НАВЕДЕНИИ (Развернутое меню) */
.vertical-sidebar:hover {
    width: 280px;
}

/* ОСНОВНАЯ НАВИГАЦИЯ */
.sidebar-nav {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 280px; 
    padding: 16px 28px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
}

.icon-wrap {
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.nav-text {
    margin-left: 15px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.vertical-sidebar:hover .nav-text {
    opacity: 1;
    pointer-events: auto;
}

.nav-item:hover { background: rgba(255, 90, 0, 0.05); color: var(--accent-orange); }
.nav-item:hover .icon-wrap { color: var(--accent-orange); transform: scale(1.1); }

/* СПЕЦ КНОПКИ */
.game-link { color: var(--accent-orange); }
.game-link .icon-wrap { color: var(--accent-orange); }
.career-link .icon-wrap { color: var(--blob-color); }

.career-link .nav-text {
    margin-left: 8px; 
    font-size: 0.95rem; 
}

/* ВЫПАДАЮЩЕЕ МЕНЮ (DROPDOWN) */
.nav-dropdown {
    display: flex;
    flex-direction: column;
    width: 280px;
}

.dropdown-toggle .arrow {
    margin-left: auto;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    opacity: 0; 
}

.vertical-sidebar:hover .dropdown-toggle .arrow {
    opacity: 1;
}

.dropdown-toggle.active .arrow {
    transform: rotate(180deg);
    color: var(--accent-orange);
}

.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    display: flex;
    flex-direction: column;
    margin-left: 70px;
    gap: 12px;
}

.dropdown-toggle.active + .dropdown-content {
    max-height: 200px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.dropdown-content a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.dropdown-content a:hover { color: var(--accent-orange); }

/* ПОДВАЛ БОКОВОГО МЕНЮ */
.sidebar-footer {
    padding: 20px 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 280px;
}

.lang-switch-side {
    padding: 0 28px;
    font-size: 0.95rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.vertical-sidebar:hover .lang-switch-side { opacity: 1; }

.lang-switch-side strong { color: var(--accent-orange); }
.lang-switch-side a { color: inherit; text-decoration: none; font-weight: 500;}

/* ИНТЕРАКТИВНАЯ КНОПКА "ВХОД" */
.btn-login-wrap { 
    padding: 0 18px; 
    display: flex;
    transition: padding 0.4s ease;
}
.vertical-sidebar:hover .btn-login-wrap {
    padding: 0 20px; 
}

.btn-login {
    display: flex;
    align-items: center;
    background: var(--accent-black);
    color: white;
    border-radius: 16px;
    height: 50px;
    width: 50px; 
    padding: 0;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.vertical-sidebar:hover .btn-login {
    width: 100%; 
    padding: 0 20px;
}

.btn-login .icon-wrap { 
    color: white; 
    width: 50px; 
    height: 50px;
    margin: 0; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.vertical-sidebar:hover .btn-login .icon-wrap {
    width: 24px; 
    height: auto;
}

.btn-login .nav-text {
    opacity: 0;
    color: white;
    white-space: nowrap;
    margin-left: 12px;
    transition: opacity 0.3s ease;
}

.vertical-sidebar:hover .btn-login .nav-text {
    opacity: 1;
}

.btn-login:hover { background: #333; transform: translateY(-2px); }


/* КНОПКА ГАМБУРГЕР (Только мобильные) */
.burger-btn {
    display: none;
    font-size: 28px; /* Увеличена иконка бургера */
    color: var(--accent-black);
    cursor: pointer;
    background: none;
    border: none;
}
.close-sidebar { display: none; position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 28px; color: var(--text-muted); cursor: pointer; transition: 0.2s;}
.close-sidebar:hover { color: var(--accent-orange); transform: rotate(90deg); }


/* АДАПТАЦИЯ ОСНОВНОГО КОНТЕНТА (Отодвигаем сайт от меню на десктопе) */
@media (min-width: 1025px) {
    body { 
        padding-left: 106px; 
        transition: padding-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body:has(.vertical-sidebar:hover) {
        padding-left: 300px; 
    }
    .sidebar-overlay { display: none !important; }
}

/* =========================================
   ИДЕАЛЬНОЕ ПАРЯЩЕЕ МЕНЮ ДЛЯ МОБИЛЬНЫХ
   ========================================= */
@media (max-width: 1024px) {
    body { padding-left: 0 !important; }
    
    /* Делаем логотип хедером на всю ширину */
    .floating-logo-box {
        width: calc(100% - 40px);
        height: 80px; /* Сделали хедер чуть выше */
    }
    
    .burger-btn { display: block; }
    
    /* ПАРЯЩАЯ КАРТОЧКА (Вместо прилипания к краю) */
    .vertical-sidebar {
        position: fixed;
        top: 50%; 
        right: -100%; /* Прячем далеко справа */
        left: auto;
        transform: translate(50%, -50%) scale(0.9); /* Анимация выезда и увеличения */
        width: calc(100vw - 30px); /* Уменьшили отступы по краям (было 40px) */
        max-width: 400px; /* Увеличили максимальную ширину карточки (было 360) */
        height: auto; 
        max-height: 90vh; /* Увеличили максимальную высоту (было 85vh) */
        background: var(--bg-card);
        border-radius: 36px; /* Чуть сильнее закруглили края */
        border: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 2000; 
        box-shadow: 0 30px 60px rgba(0,0,0,0.2); 
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
        opacity: 0;
        pointer-events: none;
        padding: 40px 25px; /* Добавили отступов внутри */
    }
    
    /* АКТИВНОЕ СОСТОЯНИЕ МЕНЮ (РОВНО ПО ЦЕНТРУ) */
    .vertical-sidebar.active { 
        right: 50%; 
        transform: translate(50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .vertical-sidebar:hover { width: calc(100vw - 30px); max-width: 400px; } /* Отключаем расширение hover на моб. */
    
    /* Растягиваем элементы на всю ширину карточки и делаем их крупнее */
    .nav-item, .nav-dropdown, .sidebar-footer { width: 100%; } 
    .nav-text, .lang-switch-side, .dropdown-toggle .arrow { opacity: 1; pointer-events: auto; }
    
    .sidebar-nav { gap: 12px; } /* Увеличили зазор между пунктами */
    .nav-item { padding: 18px 25px; font-size: 1.2rem; border-radius: 16px; } /* Увеличили шрифты и кликабельную зону */
    .icon-wrap { font-size: 1.5rem; width: 35px; } /* Увеличили иконки */
    
    .dropdown-content { margin-left: 60px; gap: 15px; }
    .dropdown-content a { font-size: 1.1rem; } /* Подменю стало крупнее */

    .btn-login-wrap { padding: 0; width: 100%; margin-top: 10px;}
    .btn-login { width: 100%; justify-content: flex-start; padding: 0 25px; height: 60px; font-size: 1.15rem; border-radius: 20px;} /* Кнопка Вход стала массивнее */
    .btn-login .icon-wrap { width: 30px; height: auto; font-size: 1.3rem;}
    .btn-login .nav-text { opacity: 1; margin-left: 15px;}
    
    .close-sidebar { display: block; top: 25px; right: 25px;}

    /* ОВЕРЛЕЙ С КРАСИВЫМ БЛЮРОМ (Стекло) */
    .sidebar-overlay {
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100vw; 
        height: 100vh;
        background: rgba(17, 24, 39, 0.4); 
        backdrop-filter: blur(12px); 
        -webkit-backdrop-filter: blur(12px); 
        z-index: 1999; 
        opacity: 0; 
        pointer-events: none; 
        transition: all 0.4s ease;
    }
    .sidebar-overlay.active { 
        opacity: 1; 
        pointer-events: all; 
    }
}

@media (max-width: 480px) {
    .floating-logo-box { padding: 0 20px; width: calc(100% - 20px); left: 10px;}
    .animated-word-container { width: 140px; }
    .vertical-sidebar { width: calc(100vw - 20px); padding: 30px 20px; } /* Делаем меню почти на весь экран (отступы по 10px) */
    .nav-item { padding: 15px 20px; font-size: 1.15rem; }
}