/* Burger Menu - Modern & Adaptive */

/* Overlay для затемнения фона */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    cursor: pointer;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
    cursor: pointer;
}

/* Кнопка бургера */
.burger-btn {
    display: none; /* Скрыт на десктопе */
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 212, 170, 0.15));
    border: 2px solid rgba(0, 255, 136, 0.5);
    cursor: pointer;
    z-index: 1001 !important;
    position: fixed !important;
    top: 2rem !important;
    right: 2rem !important;
    left: auto !important;
    padding: 0.75rem;
    border-radius: 12px;
    transition: transform 0.2s, background 0.2s;
    visibility: visible !important;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}

.burger-btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 212, 170, 0.25));
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
}

.burger-btn:active {
    transform: scale(0.95);
}

.burger-btn svg {
    width: 24px;
    height: 24px;
    color: #00ff88;
    transition: transform 0.3s ease;
}

/* Анимация превращения в крестик */
.burger-btn.active svg {
    transform: rotate(90deg);
    opacity: 0;
}

.burger-btn.active::before,
.burger-btn.active::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #00ff88;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger-btn.active::before {
    transform: rotate(45deg);
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -1px;
}

.burger-btn.active::after {
    transform: rotate(-45deg);
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -1px;
}

/* Боковое меню */
.side-menu {
    position: fixed;
    right: -100%;
    left: auto;
    top: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 2px solid rgba(0, 255, 136, 0.3);
    pointer-events: none;
}

.side-menu.active {
    right: 0;
    pointer-events: auto;
}

/* Заголовок меню */
.menu-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), rgba(0, 212, 170, 0.08));
}

.menu-header h3 {
    color: #00ff88;
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.menu-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
}

/* Список меню */
.side-menu ul {
    list-style: none !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 1.5rem;
}

.side-menu li {
    list-style: none !important;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.side-menu.active li {
    opacity: 1;
    transform: translateX(0);
}

.side-menu.active li:nth-child(1) { transition-delay: 0.05s; }
.side-menu.active li:nth-child(2) { transition-delay: 0.1s; }
.side-menu.active li:nth-child(3) { transition-delay: 0.15s; }
.side-menu.active li:nth-child(4) { transition-delay: 0.2s; }
.side-menu.active li:nth-child(5) { transition-delay: 0.25s; }
.side-menu.active li:nth-child(6) { transition-delay: 0.3s; }
.side-menu.active li:nth-child(7) { transition-delay: 0.35s; }
.side-menu.active li:nth-child(8) { transition-delay: 0.4s; }
.side-menu.active li:nth-child(9) { transition-delay: 0.45s; }

/* Ссылки меню */
.menu-link {
    color: #f1f5f9;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.menu-link:hover {
    background: rgba(0, 255, 136, 0.12);
    border-color: rgba(0, 255, 136, 0.3);
    transform: translateX(-5px);
    color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.menu-link:active {
    transform: translateX(-3px) scale(0.98);
}

/* Специальные стили для отдельных страниц */
.menu-link[href*="cybersecurity"] {
    background: rgba(0, 102, 255, 0.15) !important;
    border: 1px solid rgba(0, 102, 255, 0.4) !important;
    color: #66b3ff !important;
}

.menu-link[href*="cybersecurity"]:hover {
    background: rgba(0, 102, 255, 0.25) !important;
    border-color: #0066ff !important;
    color: #99ccff !important;
}

.menu-link[href*="services"] {
    background: rgba(255, 170, 0, 0.15) !important;
    border: 1px solid rgba(255, 170, 0, 0.4) !important;
    color: #ffcc66 !important;
}

.menu-link[href*="services"]:hover {
    background: rgba(255, 170, 0, 0.25) !important;
    border-color: #ffaa00 !important;
    color: #ffdd99 !important;
}

.menu-link[href*="investing"] {
    background: rgba(0, 204, 102, 0.15) !important;
    border: 1px solid rgba(0, 204, 102, 0.4) !important;
    color: #66ff99 !important;
}

.menu-link[href*="investing"]:hover {
    background: rgba(0, 204, 102, 0.25) !important;
    border-color: #00cc66 !important;
    color: #99ffcc !important;
}

.menu-link[href*="blog"] {
    background: rgba(0, 153, 255, 0.15) !important;
    border: 1px solid rgba(0, 153, 255, 0.4) !important;
    color: #66ccff !important;
}

.menu-link[href*="blog"]:hover {
    background: rgba(0, 153, 255, 0.25) !important;
    border-color: #0099ff !important;
    color: #99ddff !important;
}

/* Разделитель */
.menu-divider {
    height: 1px;
    background: rgba(0, 255, 136, 0.2);
    margin: 1rem 1.5rem;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s ease;
}

.side-menu.active .menu-divider {
    opacity: 1;
    transform: scaleX(1);
    transition-delay: 0.3s;
}

/* Кастомный скроллбар для меню */
.side-menu::-webkit-scrollbar {
    width: 6px;
}

.side-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.side-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.5);
    border-radius: 3px;
}

.side-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.7);
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .burger-btn {
        top: 1.5rem !important;
        right: 1.5rem !important;
        left: auto !important;
    }
    
    .side-menu {
        width: 300px;
        max-width: 80vw;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .burger-btn {
        display: flex !important;
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        margin-left: 0;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0.65rem;
    }
    
    .burger-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .side-menu {
        width: 280px;
        max-width: 85vw;
        border-left-width: 1px;
    }
    
    .menu-header {
        padding: 1.5rem 1.25rem 1rem;
    }
    
    .menu-header h3 {
        font-size: 1.25rem;
    }
    
    .side-menu ul {
        padding: 1.25rem;
        gap: 0.4rem;
    }
    
    .menu-link {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

/* Адаптивность для маленьких мобильных */
@media (max-width: 480px) {
    .burger-btn {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0.6rem;
        top: 1rem !important;
        right: 1rem !important;
        left: auto !important;
    }
    
    .side-menu {
        width: 260px;
        max-width: 90vw;
    }
    
    .menu-link {
        padding: 0.85rem 0.9rem;
        font-size: 0.9rem;
    }
}

/* Анимация появления меню */
@keyframes slideInFromRight {
    from {
        right: -100%;
    }
    to {
        right: 0;
    }
}

.side-menu.active {
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Улучшенная анимация для пунктов меню */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Поддержка темной темы */
@media (prefers-color-scheme: light) {
    .side-menu {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 245, 245, 0.98) 100%);
    }
    
    .menu-link {
        color: #1a1a1a;
    }
    
    .menu-link:hover {
        background: rgba(0, 255, 136, 0.1);
    }
}

/* Улучшение доступности */
.burger-btn:focus {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}

.menu-link:focus {
    outline: 2px solid rgba(0, 255, 136, 0.5);
    outline-offset: -2px;
}

/* Плавное закрытие меню при клике на overlay */
.menu-overlay.active {
    cursor: pointer;
}
