
:root {
    --bg: #0a0a0a;
    --accent: #f9f8f3;
    --gold: #d4af37;
    --border: rgba(249, 248, 243, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);  /* 🚀 300ms вместо 800ms! */
}

/* Light Theme Variables */
body.light-theme,
html.light-theme {
    --bg: #f9f8f3;
    --accent: #1a1a1a;
    --gold: #c49b33;
    --border: rgba(26, 26, 26, 0.12);
}

body.light-theme,
html.light-theme body {
    background: var(--bg);
    color: var(--accent);
}

/* Logo filter for light theme */
body.light-theme .logo img,
html.light-theme .logo img {
    filter: brightness(0) saturate(100%);
}

/* Hide logo image when speaking (show only voice bars) */
.logo.speaking img {
    opacity: 0;
    visibility: hidden;
}

/* Voice visualizer visible only when speaking */
.voice-visualizer {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.logo.speaking .voice-visualizer {
    opacity: 1;
    visibility: visible;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
}

/* === LOADING SCREEN === */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;  /* 🚀 300ms вместо 500ms */
    overflow: hidden;
    will-change: opacity;  /* 🚀 Добавлено! */
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    position: relative;
    z-index: 2;
    /* No constraints - just center the logo */
}

.loading-logo {
    margin: 0; /* 🔥 Remove bottom margin */
    position: relative;
    perspective: 1000px;
    animation: logoEntrance 1s ease-out;
}

.loading-logo img {
    height: 120px;
    filter: brightness(1.2) drop-shadow(0 0 30px rgba(212, 175, 55, 0.6));
    animation: 
        rotate3D 2s ease-in-out infinite,  /* 🚀 2s вместо 3s */
        glow 1.5s ease-in-out infinite alternate;  /* 🚀 1.5s вместо 2s */
    transform-style: preserve-3d;
}

/* 🌀 3D Rotation Animation */
@keyframes rotate3D {
    0% {
        transform: rotateY(0deg) rotateX(0deg) scale(1);
    }
    25% {
        transform: rotateY(180deg) rotateX(10deg) scale(1.1);
    }
    50% {
        transform: rotateY(360deg) rotateX(0deg) scale(1);
    }
    75% {
        transform: rotateY(180deg) rotateX(-10deg) scale(1.1);
    }
    100% {
        transform: rotateY(0deg) rotateX(0deg) scale(1);
    }
}

/* ✨ Glow Effect */
@keyframes glow {
    0% {
        filter: brightness(1.2) drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
    }
    100% {
        filter: brightness(1.5) drop-shadow(0 0 40px rgba(212, 175, 55, 0.8));
    }
}

/* 🌞 Light Theme - Glow Effect */
body.light-theme .loading-logo img:not(.glitching) {
    filter: brightness(0) saturate(100%) drop-shadow(0 0 30px rgba(196, 155, 51, 0.4));
    animation: 
        rotate3D 3s ease-in-out infinite,
        glow-light 2s ease-in-out infinite alternate;
}

@keyframes glow-light {
    0% {
        filter: brightness(0) saturate(100%) drop-shadow(0 0 20px rgba(196, 155, 51, 0.3));
    }
    100% {
        filter: brightness(0) saturate(100%) drop-shadow(0 0 40px rgba(196, 155, 51, 0.6));
    }
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.1) rotate(0deg);  /* 🚀 1.1 вместо 1.2 */
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ✨ Particles around logo */
.loading-logo::before,
.loading-logo::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: particleRing 2s ease-in-out infinite;  /* 🚀 2s вместо 3s */
}

.loading-logo::after {
    animation-delay: 1s;  /* 🚀 1s вместо 1.5s */
}

/* 🌞 Light Theme - Darker rings with more opacity */
body.light-theme .loading-logo::before,
body.light-theme .loading-logo::after {
    border: 2px solid rgba(196, 155, 51, 0.4); /* Darker gold with more opacity */
}

@keyframes particleRing {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 0.5;  /* 🚀 0.5 вместо 0.6 */
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);  /* 🚀 1.8 вместо 2 */
        opacity: 0;
    }
}

/* 🌞 Light Theme - Different ring animation */
@keyframes particleRing-light {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 0.8; /* More visible in light theme */
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

body.light-theme .loading-logo::before,
body.light-theme .loading-logo::after {
    animation: particleRing-light 3s ease-in-out infinite;
}

/* 🌊 Wave effect background */
.loading-screen::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        transparent 0%,
        rgba(212, 175, 55, 0.05) 50%,
        transparent 100%
    );
    animation: waveRotate 15s linear infinite;  /* 🚀 15s вместо 20s */
    z-index: 1;
}

/* 🌞 Light Theme - More visible wave */
body.light-theme .loading-screen::before {
    background: radial-gradient(
        circle at center,
        transparent 0%,
        rgba(196, 155, 51, 0.08) 50%, /* More visible */
        transparent 100%
    );
}

@keyframes waveRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    100% {
        transform: rotate(360deg) scale(1.5);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.loading-bar {
    display: none; /* 🔥 Hide progress bar */
}

/* 🌊 Animated background in bar */
.loading-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 175, 55, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.loading-progress {
    height: 100%;
    background: linear-gradient(
        90deg, 
        var(--gold) 0%, 
        #f4d03f 50%, 
        var(--gold) 100%
    );
    background-size: 200% 100%;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.6),
        0 0 40px rgba(212, 175, 55, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    animation: progressGlow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

/* ✨ Glowing effect */
@keyframes progressGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 
            0 0 20px rgba(212, 175, 55, 0.6),
            0 0 40px rgba(212, 175, 55, 0.3);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 
            0 0 30px rgba(212, 175, 55, 0.8),
            0 0 60px rgba(212, 175, 55, 0.5);
    }
}

/* 💥 Sparkles on progress bar */
.loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.8),
        transparent
    );
    animation: sparkle 1s infinite;
}

@keyframes sparkle {
    0% {
        transform: translateX(-30px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(30px);
        opacity: 0;
    }
}

.loading-text {
    display: none; /* 🔥 Hide loading text */
}

/* 💥 GLITCH EFFECT - СУПЕР УПРОЩЕННАЯ ВЕРСИЯ */
/* Анимация устанавливается напрямую в JavaScript через style.animation */

@keyframes glitch {
    0% {
        transform: translate(0);
        filter: brightness(1.2) drop-shadow(0 0 30px rgba(212, 175, 55, 0.6));
    }
    20% {
        transform: translate(-5px, 5px) rotateY(180deg);
        filter: brightness(2) drop-shadow(0 0 50px rgba(255, 0, 0, 0.8)) 
                drop-shadow(5px 0 10px rgba(0, 255, 255, 0.8));
    }
    40% {
        transform: translate(5px, -5px) rotateY(0deg);
        filter: brightness(0.5) drop-shadow(0 0 30px rgba(0, 255, 0, 0.6));
    }
    60% {
        transform: translate(-5px, -5px) rotateY(360deg);
        filter: brightness(1.8) drop-shadow(-5px 0 10px rgba(255, 0, 255, 0.8));
    }
    80% {
        transform: translate(5px, 5px) rotateY(180deg);
        filter: brightness(1) drop-shadow(0 0 40px rgba(255, 255, 0, 0.6));
    }
    100% {
        transform: translate(0) rotateY(0deg);
        filter: brightness(1.2) drop-shadow(0 0 30px rgba(212, 175, 55, 0.6));
    }
}

@keyframes glitch-light {
    0% {
        transform: translate(0);
        filter: brightness(0) saturate(100%) drop-shadow(0 0 30px rgba(196, 155, 51, 0.4));
    }
    20% {
        transform: translate(-5px, 5px) rotateY(180deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 50px rgba(200, 0, 0, 0.6)) 
                drop-shadow(5px 0 10px rgba(0, 150, 150, 0.6));
    }
    40% {
        transform: translate(5px, -5px) rotateY(0deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 30px rgba(0, 150, 0, 0.5));
    }
    60% {
        transform: translate(-5px, -5px) rotateY(360deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(-5px 0 10px rgba(180, 0, 180, 0.6));
    }
    80% {
        transform: translate(5px, 5px) rotateY(180deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 40px rgba(200, 200, 0, 0.5));
    }
    100% {
        transform: translate(0) rotateY(0deg);
        filter: brightness(0) saturate(100%) drop-shadow(0 0 30px rgba(196, 155, 51, 0.4));
    }
}

/* 💥 Final burst effect */
@keyframes glitchBurst {
    0% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1.2) drop-shadow(0 0 30px rgba(212, 175, 55, 0.6));
    }
    10% {
        transform: scale(1.3) rotate(10deg);
        filter: brightness(3) drop-shadow(0 0 80px rgba(212, 175, 55, 1)) 
                drop-shadow(0 0 100px rgba(255, 255, 255, 0.8));
    }
    20% {
        transform: scale(0.8) rotate(-10deg);
        filter: brightness(0.5) drop-shadow(0 0 20px rgba(255, 0, 0, 0.8));
    }
    30% {
        transform: scale(1.2) rotate(5deg);
        filter: brightness(2) drop-shadow(0 0 60px rgba(0, 255, 255, 0.8));
    }
    50% {
        transform: scale(1.5) rotate(0deg);
        filter: brightness(4) drop-shadow(0 0 100px rgba(255, 255, 255, 1));
        opacity: 0;
    }
    100% {
        transform: scale(2) rotate(0deg);
        opacity: 0;
    }
}

/* 🌞 Light Theme - Final burst effect */
@keyframes glitchBurst-light {
    0% {
        transform: scale(1) rotate(0deg);
        filter: brightness(0) saturate(100%) drop-shadow(0 0 30px rgba(196, 155, 51, 0.4));
    }
    10% {
        transform: scale(1.3) rotate(10deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 80px rgba(196, 155, 51, 0.8)) 
                drop-shadow(0 0 100px rgba(0, 0, 0, 0.5));
    }
    20% {
        transform: scale(0.8) rotate(-10deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 20px rgba(200, 0, 0, 0.6));
    }
    30% {
        transform: scale(1.2) rotate(5deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 60px rgba(0, 150, 150, 0.6));
    }
    50% {
        transform: scale(1.5) rotate(0deg);
        filter: brightness(0) saturate(100%) 
                drop-shadow(0 0 100px rgba(0, 0, 0, 0.8));
        opacity: 0;
    }
    100% {
        transform: scale(2) rotate(0deg);
        opacity: 0;
    }
}

/* УБИРАЕМ ВСЕ СКРОЛЛБАРЫ */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

header {
    height: 10vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg);
    transition: var(--transition);
}

/* === HEADER SOCIAL ACTIONS === */
.header-social-actions {
    display: none;
    /* Скрыто на desktop */
    gap: 12px;
    align-items: center;
}

.header-social-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.header-social-btn:hover,
.header-social-btn:active {
    opacity: 1;
    background: var(--hover);
    transform: scale(1.1);
}

.header-social-btn.liked {
    color: #ff4444;
    opacity: 1;
}

.header-social-btn.liked svg {
    fill: #ff4444;
}

.header-social-btn svg {
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: var(--gold);
}

/* === DESKTOP FEED SWITCHER - Global | Logo | My Feed === */
.desktop-feed-switcher {
    display: flex;
    gap: 30px;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.feed-tab-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-tab {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 8px 20px;
    background: rgba(249, 248, 243, 0.05);
    color: var(--accent);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    opacity: 0.5;
    height: 36px;
    /* Фиксированная высота */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* Отступ между текстом и иконкой */
    user-select: none;
    -webkit-user-select: none;
}

.feed-tab:hover {
    opacity: 0.8;
    border-color: var(--gold);
}

.feed-tab.active {
    background: var(--gold);
    color: var(--bg);
    border-color: var(--gold);
    opacity: 1;
}

/* === MOBILE FEED SWITCHER - Dynamic Island Style === */
.mobile-feed-switcher {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    gap: 10px;
}

.mobile-feed-switcher .feed-tab-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-feed-tab {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(249, 248, 243, 0.15);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
    position: relative;
    overflow: hidden;
    height: 42px;
    /* Фиксированная высота */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* Отступ между текстом и иконкой */
    user-select: none;
    -webkit-user-select: none;
}

.mobile-feed-tab span {
    position: relative;
    z-index: 2;
}

.mobile-feed-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.mobile-feed-tab.active {
    opacity: 1;
    border-color: var(--gold);
    transform: scale(1.05);
}

.mobile-feed-tab.active::before {
    opacity: 1;
}

.mobile-feed-tab.active span {
    color: var(--bg);
}

/* === LOGO === */
.logo {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    /* Ключевые свойства для 3D вращения */
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: inline-block;
}

.logo img {
    height: 32px;
    display: block;
    /* Скрываем картинку, когда она отвернута от нас */
    backface-visibility: hidden;
    /* Картинка всегда на переднем плане в обычном состоянии */
    position: relative;
    z-index: 2;
}

/* Состояние разговора - поворот на 180 градусов */
.logo.speaking {
    transform: rotateY(180deg);
}

/* Mobile logo hidden on desktop */
.mobile-logo {
    display: none;
}

/* Визуальный индикатор */
.voice-visualizer {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Центрируем + поворачиваем заранее на 180, чтобы быть на "спине" */
    transform: translate(-50%, -50%) rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 32px;
    /* Скрываем бары, когда они отвернуты (в нормальном состоянии лого) */
    backface-visibility: hidden;
    /* Бары должны быть активны всегда, но видны только при повороте */
    pointer-events: none;
}

/* Удаляем лишние классы анимаций, так как теперь все делает один .speaking */
.logo.flip-forward img,
.logo.flip-back img {
    transform: none;
}

/* Стили баров остаются прежними */
.voice-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.1s ease;
    height: 4px;
    /* Начальная высота */
}

/* Light theme voice bars - ensure proper color */
body.light-theme .voice-bar,
html.light-theme .voice-bar {
    background: var(--accent);
}

.profile-btn {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--accent);
    padding: 10px 15px;
    background: none;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.user-avatar:hover {
    transform: scale(1.1);
    border-color: var(--gold);
}

.profile-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-modal.active {
    transform: translateY(0);
}

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1999;
}

.profile-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.profile-email {
    font-size: 14px;
    color: var(--accent);
    opacity: 0.7;
}

.profile-signout {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 12px 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.profile-signout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 248, 243, 0.3);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-link {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--gold);
    padding-left: 10px;
}

main {
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.accordion-track {
    display: flex;
    height: 100%;
    width: max-content;
    transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1);  /* 🚀 400ms вместо 600ms */
    will-change: transform;  /* 🚀 Добавлено! */
    contain: layout style;  /* 🚀 Изоляция перерисовок! */
}

/* === MY FEED EMPTY STATE === */
.myfeed-empty {
    display: none;
    position: absolute;
    inset: 0;
    justify-content: center;
    align-items: center;
    background: var(--bg);
    padding: 40px;
}

.empty-content {
    text-align: center;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--accent);
}

.empty-content p {
    font-size: 18px;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 15px;
}

.empty-hint {
    font-size: 12px;
    color: var(--gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
}

.customize-feed-btn {
    margin-top: 25px;
    padding: 15px 30px;
    background: var(--gold);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.customize-feed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.customize-feed-btn span {
    font-size: 16px;
}

.panel {
    position: relative;
    height: 100%;
    width: 16.66vw;
    overflow: hidden;
    background: transparent;
    border-right: 1px solid var(--border);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);  /* 🚀 400ms */
    cursor: pointer;
    contain: layout style paint;  /* 🚀 Полная изоляция! */
}

.panel.active {
    width: 60vw;
    will-change: width;  /* 🚀 Добавлено! */
}

/* Skeleton styles removed - not used anymore */

.panel-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%) brightness(20%);
    transition: filter 0.3s ease, transform 0.4s ease;  /* 🚀 Ускорено! */
    transform: scale(1.05);
    z-index: 1;
    will-change: filter, transform;  /* 🚀 Добавлено! */
}

.panel.active .panel-img {
    filter: grayscale(0%) brightness(40%);
    transform: scale(1);
}

.panel-img.loaded {
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Skeleton shimmer animation removed */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.4);
    transform: scale(0);
    animation: ripple-anim 0.5s ease-out;  /* 🚀 500ms вместо 800ms */
    pointer-events: none;
    z-index: 5;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.content {
    position: relative;
    z-index: 3;
    width: 60vw;
    max-width: 900px; /* 🔥 Максимальная ширина */
    padding: 0 8%; /* 🔥 Уменьшил padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: transparent !important;
    pointer-events: none;
    contain: layout style;
}

/* Desktop: показываем только активные панели */
@media (min-width: 769px) {
    .panel:not(.active) .content {
        visibility: hidden;
    }

    /* will-change только для активных панелей */
    .panel.active .panel-img {
        will-change: filter, transform;
    }

    .panel.active .content {
        will-change: opacity;
    }

    .accordion-track {
        will-change: transform;
    }
}

.panel.active .content {
    opacity: 1;
    transition-delay: 0.15s;  /* 🚀 150ms вместо 300ms */
    pointer-events: auto;
    will-change: opacity;  /* 🚀 Добавлено! */
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5vw;
    line-height: 1.2;
    font-style: italic;
    margin-bottom: 20px;
    text-align: center;
}

.news-description {
    text-align: center;
}

.loading-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gold);
    color: var(--bg);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 1500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.loading-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile header container - flexbox layout */
.mobile-header-container {
    display: none; /* Hidden on desktop */
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

/* МОБИЛЬНАЯ МАГИЯ - БЕЗ СКРОЛЛБАРА */
@media (max-width: 768px) {

    .mobile-header-container {
        display: flex; /* Show on mobile */
    }

    .mobile-logo {
        display: block;
    }

    /* 🔥 УБИРАЕМ 3D ПЕРЕВОРОТ НА МОБИЛКЕ */
    .mobile-logo.speaking {
        transform: none !important; /* Нет переворота */
    }

    .mobile-logo.speaking img {
        opacity: 0 !important; /* Скрываем логотип */
    }

    /* 🔥 БАРЫ ПОВЕРХ ВСЕГО */
    .mobile-logo .voice-visualizer {
        transform: translate(-50%, -50%) !important; /* Без rotateY */
        backface-visibility: visible !important;
        opacity: 0;
        visibility: hidden;
    }

    .mobile-logo.speaking .voice-visualizer {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 999 !important;
    }

    .desktop-logo {
        display: none !important;
    }

    .mobile-logo img {
        height: 24px;
    }

    .mobile-logo .voice-visualizer {
        height: 24px;
    }

    .mobile-logo .voice-bar {
        width: 2px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Hide desktop feed switcher on mobile */
    .desktop-feed-switcher {
        display: none !important;
    }

    /* Show mobile feed switcher */
    .mobile-feed-switcher {
        display: flex;
    }

    header {
        position: fixed; /* 🔥 fixed вместо relative */
        top: auto;
        bottom: 0; /* 🔥 Припинтован к низу */
        left: 0;
        right: 0;
        width: 100%;
        border-bottom: none;
        border-top: 1px solid var(--border);
        background: rgba(10, 10, 10, 0.98); /* 🔥 Более непрозрачный */
        backdrop-filter: blur(20px); /* 🔥 Больше блюра */
        -webkit-backdrop-filter: blur(20px);
        height: 8vh;
        min-height: 60px; /* 🔥 Минимальная высота */
        padding: 0 20px;
        z-index: 1000; /* 🔥 Поверх всего */
    }

    /* 🔥 УЛУЧШЕННЫЙ СКРОЛЛ */
    main {
        overflow-y: scroll;
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth; /* 🔥 Плавный скролл */
        padding-top: 0;
        -webkit-overflow-scrolling: touch; /* 🔥 Плавность на iOS */
        overscroll-behavior-y: contain; /* 🔥 Не даем скроллить выше */
        scroll-padding-top: 0; /* 🔥 Без паддинга */
        scroll-padding-bottom: 8vh; /* 🔥 Паддинг под хедер */
        border: none;
        box-shadow: none;
        outline: none;
    }

    .accordion-track {
        flex-direction: column;
        width: 100%;
        height: auto;
        transform: none !important;
        padding-left: 0; /* Нет padding на мобильном */
    }

    .panel {
        width: 100% !important;
        height: 100vh;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        border-right: none;
        border-bottom: none;
        padding-bottom: 8vh; /* 🔥 Вернул padding для headerа */
    }

    .panel.in-view .panel-img {
        filter: grayscale(0%) brightness(45%);
        transform: scale(1);
    }

    .panel {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .content {
        width: 100%;
        opacity: 1 !important;
        visibility: visible !important;
        justify-content: center; /* 🔥 ЦЕНТР по вертикали */
        padding-bottom: 0; /* 🔥 Убран padding снизу */
        padding-top: 0; /* 🔥 Убран padding сверху */
        transform: translateY(0);
        padding-left: 8%;
        padding-right: 8%;
        display: flex !important;
        pointer-events: auto !important;
    }

    .panel .content {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .title {
        font-size: 32px;
        color: var(--accent);
    }

    .content p {
        color: var(--accent) !important;
        opacity: 0.8 !important;
    }

    .read-more-btn {
        display: inline-block !important;
    }

    .profile-btn {
        font-size: 7px;
        padding: 8px 12px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .loading-indicator {
        bottom: 90px;
    }

    /* My Feed Empty State на мобильном */
    .myfeed-empty {
        padding: 20px;
        padding-top: 80px;
    }

    .empty-icon {
        font-size: 48px;
    }

    .empty-content h2 {
        font-size: 28px;
    }

    .empty-content p {
        font-size: 16px;
    }

    .customize-feed-btn {
        padding: 12px 24px;
        font-size: 11px;
    }
}

/* === PREFERENCES MODAL === */
.preferences-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 3000;
}

.preferences-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.preferences-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3001;
}

.preferences-modal.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.preferences-header {
    text-align: center;
    margin-bottom: 30px;
}

.preferences-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--accent);
}

.preferences-header p {
    font-size: 14px;
    color: var(--accent);
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.preferences-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.category-option {
    position: relative;
    cursor: pointer;
}

.category-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(249, 248, 243, 0.02);
    transition: all 0.3s ease;
    text-align: center;
    min-height: 100px;
}

.category-label:hover {
    background: rgba(249, 248, 243, 0.05);
    border-color: var(--gold);
}

.category-option input:checked+.category-label {
    background: var(--gold);
    border-color: var(--gold);
}

.category-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.category-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent);
}

.category-option input:checked+.category-label .category-name {
    color: var(--bg);
}

.preferences-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.preferences-cancel,
.preferences-save {
    padding: 12px 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preferences-cancel {
    background: rgba(249, 248, 243, 0.1);
    color: var(--accent);
    border: 1px solid var(--border);
}

.preferences-cancel:hover {
    background: rgba(249, 248, 243, 0.15);
}

.preferences-save {
    background: var(--gold);
    color: var(--bg);
}

.preferences-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* === CATEGORY BADGES === */
.read-more-btn {
    background: var(--gold);
    color: var(--bg);
    border: none;
    padding: 12px 25px;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    z-index: 10;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 4px;
    text-transform: uppercase;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.category-technology {
    background: #3b82f6;
    color: white;
}

.category-business {
    background: #10b981;
    color: white;
}

.category-sports {
    background: #ef4444;
    color: white;
}

.category-entertainment {
    background: #f59e0b;
    color: white;
}

.category-health {
    background: #8b5cf6;
    color: white;
}

.category-science {
    background: #06b6d4;
    color: white;
}

.category-general,
.category-news {
    background: rgba(249, 248, 243, 0.2);
    color: var(--accent);
}




/* --- Utility Classes --- */
.temporarily-disabled {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    transition: opacity 0.3s ease;
}

/* === SIGN UP BUTTON (for non-logged users) === */
.header-signup-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--gold), #b8941f);
    color: #0a0a0a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
    z-index: 100;
}

.header-signup-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.5);
}

.header-signup-btn:active {
    transform: translateY(-50%) scale(0.98);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-signup-btn {
        right: 15px;
        padding: 10px 24px;
        font-size: 13px;
    }
}


