/* --- Header и Навигация --- */
header {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff;
    transition: transform 0.3s ease-in-out;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    padding: 0;
}

header.hidden {
    transform: translateY(-100%);
}

/* Стили для контейнера навигации */
.nav-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 30px;
    position: relative;
    gap: 30px;
}

/* Логотип */
header h1 {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-family: 'Exo 2', 'Bebas Neue', sans-serif;
    font-weight: 900;
    font-size: 1.4em;
    display: inline-block;
    padding: 5px 0;
    line-height: 1.2;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00ff87, #60efff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 135, 0.5);
    position: relative;
    transition: all 0.3s ease;
}

header h1 a::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    text-shadow:
        2px 2px 0 rgba(0, 255, 135, 0.8),
        -2px -2px 0 rgba(96, 239, 255, 0.8);
    -webkit-text-fill-color: transparent;
}

header h1 a:hover {
    transform: scale(1.05);
    text-shadow: 0 0 40px rgba(0, 255, 135, 0.8);
}

/* Desktop Navigation Menu */
.desktop-nav {
    display: none; /* Скрыто на мобильных */
    flex: 0 1 auto;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
}

.desktop-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.desktop-nav .nav-item {
    margin: 0;
}

.desktop-nav .nav-link {
    display: block;
    padding: 10px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.desktop-nav .nav-link:hover {
    background: rgba(0, 255, 135, 0.1);
    color: #00ff87;
    border-color: rgba(0, 255, 135, 0.3);
}

.desktop-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(96, 239, 255, 0.2));
    color: #00ff87;
    border-color: #00ff87;
    font-weight: 600;
}

/* Mobile Toggle Button */
.nav-toggle {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8em;
    z-index: 1001;
    padding: 5px;
    margin: 0;
    margin-left: auto;
}

/* Mobile Sidebar Menu */
.nav-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f3460 100%);
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1003;
    padding: 20px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-menu.active {
    right: 0;
}

/* Кнопка закрытия */
.nav-close {
    display: none;
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
    z-index: 1004;
    padding: 8px 15px;
    margin: 5px 15px 10px 0;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.nav-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Mobile Menu List */
.nav-menu .nav-list {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 15px;
    margin: 0;
    margin-top: 10px;
    gap: 8px;
}

.nav-menu .nav-item {
    width: 100%;
    margin: 0;
}

.nav-menu .nav-link {
    display: block;
    padding: 16px 20px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.05em;
    border-left: 3px solid transparent;
}

.nav-menu .nav-link:hover {
    background-color: rgba(0, 255, 135, 0.1);
    color: #00ff87;
    border-left-color: #00ff87;
    transform: translateX(3px);
}

.nav-menu .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(96, 239, 255, 0.2));
    color: #00ff87;
    border-left-color: #00ff87;
    font-weight: 600;
}

.nav-menu .nav-link.active::before {
    content: '●';
    position: absolute;
    right: 20px;
    font-size: 0.8em;
    color: #00ff87;
}

/* --- Адаптивность --- */

/* Mobile: Hide desktop nav, show hamburger */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-close {
        display: block;
    }

    .nav-container {
        padding: 12px 15px;
        gap: 15px;
    }

    header h1 a {
        font-size: 1.1em;
        letter-spacing: 1px;
    }
}

/* Tablet and small desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-nav {
        display: flex !important;
    }

    .nav-toggle {
        display: none !important;
    }

    .nav-menu {
        display: none !important;
    }

    header h1 a {
        font-size: 1.2em;
    }

    .nav-container {
        gap: 20px;
    }

    .desktop-nav .nav-link {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}

/* Desktop: Show desktop nav, hide hamburger */
@media (min-width: 1025px) {
    .desktop-nav {
        display: flex !important;
    }

    .nav-toggle {
        display: none !important;
    }

    .nav-menu {
        display: none !important;
    }

    header h1 a {
        font-size: 1.4em;
    }

    .nav-container {
        gap: 30px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .nav-container {
        padding: 10px 15px;
        gap: 15px;
    }

    header h1 a {
        font-size: 1em;
        letter-spacing: 0.8px;
    }
}

/* Body при активном меню */
body.menu-active {
    overflow: hidden;
}

body.menu-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
}
