/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: transparent;
    z-index: 1000;
    overflow: visible;
    transition: padding 0.3s ease;
}

.header-container {
    max-width: 1500px;
    height: 67px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(21, 21, 21, 0.8);
    
    border-radius: 30px;
    padding: 16px 16px 16px 32px;
    backdrop-filter: blur(10px);

    position: relative;
    z-index: 1;
    overflow: visible;
    
    transition: max-width 0.3s ease, height 0.3s ease, padding 0.3s ease, border-radius 0.3s ease;
}

.header-container > * {
    transition: transform 0.3s ease, margin 0.3s ease;
}

/* Отключаем анимации при первичной установке состояния */
.header-desktop.header-no-transition,
.header-desktop.header-no-transition .header-container,
.header-desktop.header-no-transition .header-container > *,
.header-desktop.header-no-transition .logo,
.header-desktop.header-no-transition .logo-text,
.header-desktop.header-no-transition .nav,
.header-desktop.header-no-transition .header-actions {
    transition: none !important;
}


/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: -25px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    transition: width 0.3s ease, height 0.3s ease;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
}

.logo-text {
    font-family: 'Square721TL-BoldExtended', 'Arial Black', Arial, sans-serif;
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 1px;
    color: white;
    text-transform: uppercase;
    transition: opacity 0.3s ease, width 0.3s ease, margin 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Сжатое состояние шапки */
.header-compact .header-container {
    max-width: 1000px;
}




.header-compact .logo-text {
    opacity: 0;
    width: 0;
    margin: 0;
    pointer-events: none;
}

.header-compact .logo {
    gap: 0;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
    transition: gap 0.3s ease, font-size 0.3s ease, transform 0.3s ease, margin 0.3s ease;
    will-change: transform;
}

.nav-link {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 18px;
    color: white;
    text-decoration: none;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease, font-size 0.3s ease, padding 0.3s ease;
}

.nav-link:hover {
    color: #6468FB;
}

.nav-link.active {
    color: white;
    font-weight: bold;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 5px;
    background: white;
    border-radius: 10px;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-link-dropdown {
    cursor: pointer;
    display: inline-block;
    width: 100%;
}

.nav-dropdown:hover .nav-link-dropdown {
    color: white;
}

.nav-dropdown:hover .nav-link-dropdown::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 5px;
    background: white;
    border-radius: 10px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(21, 21, 21, 0.95);
    border-radius: 40px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding: 12px 0;
    min-width: 256px;
    opacity: 0;
    display: block;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(-5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1001;
}

/* squircle поддержка */
@supports (corner-shape: squircle) {
    .dropdown-menu {
        corner-shape: squircle;
        border-radius: 70px;
    }
  }


/* Псевдоэлемент для заполнения промежутка между ссылкой и меню */
.dropdown-menu::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 8px;
    background: transparent;
    pointer-events: all;
}

.nav-dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 24px;
    color: white;
    text-decoration: none;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 16px;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
}

.dropdown-item:hover {
    color: #6468FB;
    text-decoration: underline;
    text-decoration-color: #6468FB;
    text-underline-offset: 4px;
}

.dropdown-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Подчеркивание для ссылок в dropdown */
.dropdown-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 0;
    transition: gap 0.3s ease, transform 0.3s ease, margin 0.3s ease;
    will-change: transform;
}

/* Mobile Header */
.header-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    z-index: 1000;
    /* Убираем transition, чтобы позиция не менялась */
}

.header-mobile-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    background: rgba(21, 21, 21, 0.8);
    border-radius: 30px;
    padding: 0 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Logo Pill */
.logo-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-pill:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.logo-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    right: 5px;
    position: relative;
}

.logo-pill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
}

.logo-pill-text {
    font-family: 'Square721TL-BoldExtended', 'Arial Black', Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Mobile Header Actions */
.header-mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-mobile i {
    font-size: 19px;
    color: white;
}

.btn-mobile-profile {
    background: rgba(28, 28, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-mobile-profile:hover {
    background: rgba(186, 186, 186, 0.15);
    transform: scale(0.95);
}

.btn-mobile-login {
    background: rgba(28, 28, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-mobile-login:hover {
    background: rgba(186, 186, 186, 0.15);
    transform: scale(0.95);
}

.btn-mobile-download {
    background: #6468FB;
    border: none;
}

.btn-mobile-download:hover {
    background: #5559E8;
    transform: scale(0.95);
}

/* Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav.hidden {
    transform: translateY(100%);
}

.bottom-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 58px;
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    gap: 5px;
    padding: 0 5px;
    margin-bottom: 20px;
}

.bottom-nav-container.gradient-border::before {
    display: none;
}

.bottom-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 44px;
    text-decoration: none;
    position: relative;
    border-radius: 30px;
    transition: all 0.2s ease;
    z-index: 1;
    padding: 0 4px;
    box-sizing: border-box;
}

.bottom-nav-text {
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
    white-space: nowrap;
    padding: 0 2px;
}

.bottom-nav-item.active .bottom-nav-text {
    color: white;
    font-weight: 600;
    padding: 0 6px 0 4px;
}

/* Active Indicator */
.bottom-nav-active-indicator {
    position: absolute;
    top: 6px;
    height: 44px;
    background: rgba(70, 70, 70, 0.9);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
    /* Добавляем небольшой отступ для текста */
    box-sizing: border-box;
}

/* Bottom Nav Dropdown */
.bottom-nav-dropdown {
    position: relative;
}

.bottom-nav-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 40, 40, 0.95);
    border-radius: 16px;
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(-5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bottom-nav-dropdown-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bottom-nav-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.bottom-nav-dropdown-item {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-family: 'Inter', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.bottom-nav-dropdown-item:hover {
    color: #6468FB;
    text-decoration: underline;
}

.bo

/* Content padding for bottom nav */
.content-with-bottom-nav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* Media Queries */
@media (max-width: 1023px) {
    /* Hide desktop header */
    .header-desktop {
        display: none !important;
    }
    
    /* Show mobile header */
    .header-mobile {
        display: block;
    }
    
    /* Show bottom navigation */
    .bottom-nav {
        display: block;
    }
    
    /* Add padding to main content */
    main {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
    
    /* Adjust header height for mobile */
    .header-mobile-container {
        height: 60px;
    }
}

@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {

    .logo {
        margin-left: -20px;
    }

    .header {
        padding: 16px 24px;
    }

    .header-container {
        max-width: 100%;
        height: 60px;
        padding: 12px 12px 12px 24px;
        border-radius: 26px;
    }

    .logo-icon {
        width: 52px;
        height: 52px;
    }

    .logo-text {
        font-size: 26px;
    }

    .nav {
        gap: 20px;
    }

    .nav-link {
        font-size: 16px;
    }

    .header-actions {
        gap: 8px;
    }
}

@media (min-width: 1024px) {
    /* Hide mobile header */
    .header-mobile {
        display: none !important;
    }
    
    /* Hide bottom navigation */
    .bottom-nav {
        display: none !important;
    }
    
    /* Show desktop header */
    .header-desktop {
        display: block;
    }
    
    /* Remove mobile padding */
    main {
        padding-bottom: 0;
    }
}


@supports (corner-shape: squircle) {
    .bottom-nav-dropdown-menu {
        corner-shape: squircle;
        border-radius: 70px;
    }
}
