/* ================================================
   Горизонтальная навигация (Header Navigation)
   
   Описание: Верхнее меню сайта с логотипом и навигацией
   Используется: Все страницы (partials/navigation.html.php)
   
   Основные классы:
   - .main-navigation: Контейнер навигации (sticky)
   - .nav-logo: Логотип Azeroth
   - .nav-menu: Горизонтальное меню
   - .nav-link: Ссылки меню
   - .user-info: Информация о пользователе (логин, бонусы)
   - .hamburger: Мобильная кнопка меню
   ================================================ */

/* === Индикатор прогресса загрузки страницы === */
#page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    background-size: 200% 100%;
    width: 0%;
    z-index: 9999;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 140, 0, 0.4);
    animation: shimmer-progress 1.5s linear infinite;
    opacity: 0;
}

#page-progress.loading {
    opacity: 1;
}

#page-progress.complete {
    width: 100% !important;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.5s ease 0.3s;
}

@keyframes shimmer-progress {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* === Основной контейнер === */
.main-navigation {
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.nav-container {
    width: 1400px;
    max-width: 100%;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    background: linear-gradient(135deg, rgba(25, 25, 72, 0.95) 0%, rgba(0, 0, 51, 0.95) 100%);
    border: 2px solid #4a4a70;
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* === Логотип === */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    flex-shrink: 0;
}

.nav-logo:hover {
    text-decoration: none !important;
}

.logo-name {
    font-family: 'Warcraft', sans-serif;
    font-size: 40px;
    font-weight: bold;
    color: #ffff33;
    text-shadow: 0 0 20px rgba(255, 255, 51, 0.2), 0 0 40px rgba(255, 255, 51, 0.2);
    letter-spacing: 0px;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.nav-logo:hover .logo-name {
    text-shadow: 0 0 30px rgba(255, 255, 51, 1), 0 0 50px rgba(255, 255, 51, 0.7);
    transform: scale(1.05);
    text-decoration: none !important;
}

/* === Меню === */
.nav-menu {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffd700;
    background: linear-gradient(135deg, rgba(25, 25, 72, 0.95) 0%, rgba(0, 0, 51, 0.95) 100%);
    border: 2px solid rgba(120, 140, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
    text-decoration: none !important;
}

.nav-link:hover,
.nav-link:focus,
.nav-link:active {
    text-decoration: none !important;
}

/* Блестящий эффект при наведении */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
    border-radius: 10px;
    pointer-events: none;
}

/* Анимированная подчёркивающая линия снизу */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.nav-link:hover {
    background: linear-gradient(135deg, rgba(40, 40, 92, 0.98) 0%, rgba(15, 15, 71, 0.98) 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #ffed4e;
}

.nav-link:hover::before {
    left: 100%;
}

/* Показываем подчёркивание при наведении */
.nav-link:hover::after {
    width: 80%;
}

/* Активная страница - постоянная подчёркивающая линия */
.nav-link.active {
    background: linear-gradient(135deg, rgba(40, 40, 92, 0.98) 0%, rgba(15, 15, 71, 0.98) 100%);
    border-color: rgba(255, 215, 0, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    color: #ffed4e;
}

.nav-link.active::after {
    width: 90%;
    height: 4px;
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 20%, #ffd700 40%, #ffed4e 60%, #ffd700 80%, #ffed4e 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.6);
}

/* Анимация мерцания для активной ссылки */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Мобильные элементы (скрыты на десктопе) */
.mobile-only {
    display: none;
}

/* === Пользователь === */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 10px;
}

.user-name {
    color: #ffd700;
    font-weight: 900;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    letter-spacing: 0.5px;
}

.user-balance {
    color: #70d0e8;
    font-size: 14px;
    font-weight: 600;
}

/* === Кнопки навигации === */
.btn-nav {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

/* Бейдж уведомлений */
.nav-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff3b3b 0%, #ff1744 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 23, 68, 0.6), 0 0 0 2px #1a1a3e;
    animation: pulse-badge 2s ease-in-out infinite;
    line-height: 1;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 23, 68, 0.6), 0 0 0 2px #1a1a3e;
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(255, 23, 68, 0.8), 0 0 0 2px #1a1a3e, 0 0 20px rgba(255, 23, 68, 0.4);
    }
}

.btn-nav-primary {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000033;
    border: 2px solid #ffed4e;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-nav-primary:hover {
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.btn-nav-secondary {
    background: transparent;
    border: 2px solid #70d0e8;
    color: #70d0e8;
    box-shadow: 0 0 15px rgba(112, 208, 232, 0.3);
}

.btn-nav-secondary:hover {
    background: rgba(112, 208, 232, 0.2);
    border-color: #a0e0f8;
    color: #a0e0f8;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 25px rgba(112, 208, 232, 0.5);
}

/* === Гамбургер === */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #ffff33;
    border-radius: 2px;
    transition: 0.3s;
}

/* Анимация гамбургера в крестик */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* === OVERLAY === */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.nav-overlay.active {
    display: block;
}

/* ================================================
   Адаптивная верстка и медиазапросы
   ================================================ */

/* Средние экраны-мониторы для навигации */
@media (max-width: 1200px) {
    .nav-container {
        padding: 0 30px;
    }
    
    .nav-menu {
        gap: 8px;
    }
    
    .nav-link {
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
        height: 60px;
    }
    
    /* Логотип уменьшаем */
    .logo-name {
        font-size: 20px;
    }
    
    .logo-version {
        font-size: 10px;
    }
    
    /* Скрываем desktop меню и показываем боковое */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #000033;
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 20px;
        transition: right 0.3s;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        align-items: stretch;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 12px 16px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Показываем мобильные элементы */
    .mobile-only {
        display: block;
    }
    
    .mobile-user-info {
        padding: 15px;
        background: rgba(51, 51, 102, 0.5);
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .mobile-user-name {
        display: block;
        color: #ffff33;
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .mobile-user-balance {
        display: block;
        color: #999999;
        font-size: 14px;
    }
    
    .nav-link-mobile {
        display: block;
        color: #ffff33;
        text-decoration: none;
        padding: 12px 0;
        font-size: 16px;
        border-bottom: 1px solid rgba(74, 122, 154, 0.3);
    }
    
    .btn-nav-mobile {
        display: block;
        text-align: center;
        padding: 12px;
        margin-top: 10px;
        border-radius: 6px;
        text-decoration: none;
        font-weight: 600;
    }
    
    /* Скрываем desktop действия */
    .nav-actions {
        display: none;
    }
    
    /* Показываем гамбургер */
    .hamburger {
        display: flex;
    }
}
