/* 
 * Стили для навигации (nav)
 * Принимает: Список ссылок навигации
 * Отдает: Адаптивную навигацию с защитой от переноса текста
 * Особенности: Использует clamp() для плавной адаптации, white-space: nowrap для защиты от переноса
 */
.nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 2.5rem);
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0; /* Позволяет flex-элементам сжиматься */
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: clamp(0.5rem, 1vw, 0.8rem);
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.1vw, 1.1rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: clamp(0.6rem, 1.2vw, 0.8rem) clamp(0.8rem, 1.5vw, 1.2rem);
    border-radius: 8px;
    white-space: nowrap; /* Защита от переноса текста */
    flex-shrink: 0; /* Предотвращает сжатие ссылок */
}

.nav-link:hover {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.nav-link i {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0; /* Иконки не сжимаются */
}

@media (hover: hover) {
    .nav-link:hover i {
        transform: scale(1.2);
    }
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #d4af37, #f4d03f);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Бургер-меню */
.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.burger-menu:hover {
    background: rgba(212, 175, 55, 0.1);
}

.burger-line {
    width: 25px;
    height: 3px;
    background: #d4af37;
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    transform-origin: center;
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Мобильная навигация */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
    backdrop-filter: blur(20px);
    z-index: 99;
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.active {
    transform: translateX(0) !important;
}

.mobile-nav-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #d4af37;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

@media (hover: hover) {
    .mobile-nav-close:hover {
        background: rgba(212, 175, 55, 0.1);
        transform: scale(1.1);
    }
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    padding-top: 5rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

/* Стилизация скроллбара для мобильной навигации */
.mobile-nav-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-nav-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.mobile-nav-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4) 0%, rgba(212, 175, 55, 0.2) 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-nav-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.6) 0%, rgba(212, 175, 55, 0.4) 100%);
}

.mobile-nav-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-title {
    color: #d4af37;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.mobile-nav-link:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateX(10px);
}

.mobile-nav-link i {
    font-size: 1.3rem;
    color: #d4af37;
    width: 25px;
}

/* Мобильный переключатель языка */
.mobile-language-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.mobile-language-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.1);
}

@media (hover: hover) {
    .mobile-language-option:hover {
        background: rgba(212, 175, 55, 0.08);
    }
}

.mobile-language-option.active {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.3);
}

.mobile-language-flag {
    width: 28px;
    height: 21px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-language-name {
    flex: 1;
    font-weight: 500;
}

.mobile-language-check {
    color: #d4af37;
    font-size: 0.9rem;
}

.mobile-auth-links {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Скрываем мобильные кнопки авторизации до завершения проверки токенов */

.auth-links, .mobile-auth-links {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-auth-links.loading {
    opacity: 0;
    visibility: hidden;
}

.mobile-auth-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.mobile-auth-link:nth-child(1) {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #0f0f0f;
    border: 2px solid #d4af37;
}

@media (hover: hover) {
    .mobile-auth-link:nth-child(1):hover {
        background: linear-gradient(135deg, #f4d03f 0%, #d4af37 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    }
}

.mobile-auth-link:nth-child(2) {
    background: transparent;
    color: #d4af37;
    border: 2px solid #d4af37;
}

.mobile-auth-link:nth-child(2):hover {
    background: rgba(212, 175, 55, 0.1);
    color: #f4d03f;
    border-color: #f4d03f;
    transform: translateY(-2px);
}

.mobile-auth-link:nth-child(3) {
    background: transparent;
    color: #d4af37;
    border: 2px solid #d4af37;
}

.mobile-auth-link:nth-child(3):hover {
    background: rgba(212, 175, 55, 0.1);
    color: #f4d03f;
    border-color: #f4d03f;
    transform: translateY(-2px);
}

/* Современные адаптивные стили для навигации - 2025 */

/* Планшетные и средние экраны */
@media (max-width: 1400px) {
    .nav {
        gap: clamp(0.8rem, 1.5vw, 1.5rem);
    }
}

/* Переход к мобильному меню - адаптивный breakpoint */
@media (max-width: 1000px) {
    .nav,
    .auth-links {
        display: none;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .mobile-nav {
        display: block;
        transform: translateX(-100%);
    }
    
    .mobile-nav.active {
        transform: translateX(0) !important;
    }
}

/* Мобильные устройства - улучшенная адаптивность */
@media (max-width: 768px) {
    .mobile-nav {
        padding: 1.5rem;
    }
    
    .mobile-nav-close {
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1.5rem;
    }
    
    .mobile-nav-content {
        padding-top: 4rem;
        gap: 1.5rem;
    }
    
    .mobile-nav-link {
        font-size: clamp(1rem, 4vw, 1.1rem);
        padding: clamp(0.8rem, 3vw, 1rem);
    }
}

@media (max-width: 480px) {
    .mobile-nav {
        padding: 1rem;
    }
    
    .mobile-nav-close {
        top: 1rem;
        right: 1rem;
        font-size: 1.3rem;
    }
    
    .mobile-nav-content {
        padding-top: 3.5rem;
        gap: 1.2rem;
    }
    
    .mobile-nav-link {
        font-size: 1rem;
        padding: 0.9rem;
        gap: 0.8rem;
    }
    
    .mobile-nav-link i {
        font-size: 1.1rem;
        width: 22px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .mobile-nav-link {
        font-size: 0.95rem;
        padding: 0.8rem;
    }
    
    .mobile-nav-link i {
        font-size: 1rem;
        width: 20px;
    }
}
