/* ========== ОСНОВНЫЕ ПЕРЕМЕННЫЕ И СБРОС ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --bg-gradient: radial-gradient(circle at 10% 20%, rgba(255,255,255,0.95) 0%, rgba(245,250,255,1) 90%);
    --glass-bg: rgba(255,255,255,0.5);
    --glass-border: rgba(255,255,255,0.5);
    --glass-shadow: 0 20px 40px -12px rgba(0,20,40,0.25);
    --card-bg: rgba(255,255,255,0.45);
    --text-primary: #1a2639;
    --text-secondary: #2c3e50;
    --accent: #3b7cff;
    --accent-soft: #6da1ff;
    --border-light: rgba(255,255,255,0.7);
    --faq-bg: rgba(255,255,255,0.3);
    --shadow-color: rgba(0,30,60,0.1);
    --particle-color: rgba(59,124,255,0.2);
}

body.dark {
    --bg-gradient: radial-gradient(circle at 30% 30%, #1b2635, #0c1320);
    --glass-bg: rgba(25,35,55,0.6);
    --glass-border: rgba(90,140,255,0.2);
    --glass-shadow: 0 20px 40px -8px rgba(0,0,0,0.6);
    --card-bg: rgba(30,40,60,0.5);
    --text-primary: #edf2fb;
    --text-secondary: #b6c8e2;
    --accent: #5f8cff;
    --accent-soft: #7fa9ff;
    --border-light: rgba(120,160,255,0.2);
    --faq-bg: rgba(25,40,60,0.5);
    --shadow-color: rgba(0,0,0,0.5);
    --particle-color: rgba(100,160,255,0.25);
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background .3s, color .2s;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%233b7cff"><circle cx="12" cy="12" r="10" fill="%233b7cff" opacity="0.5"/><circle cx="12" cy="12" r="4" fill="white"/></svg>') 12 12, auto;
}

.buy-btn, .file-label, .theme-toggle, .login-btn, a, button {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ffaa00"><circle cx="12" cy="12" r="10" fill="%23ffaa00" opacity="0.7"/><circle cx="12" cy="12" r="6" fill="white"/></svg>') 12 12, pointer;
}

/* ========== ФОНОВЫЕ ШАРЫ ========== */
.floating-balls {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ball {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: floatBall 20s infinite alternate ease-in-out;
    opacity: 0.8;
    will-change: transform;
}

.ball:nth-child(1) {
    width: 180px;
    height: 180px;
    top: 5%;
    left: 0%;
    background: rgba(255,100,150,0.7);
    animation-duration: 16s;
}

.ball:nth-child(2) {
    width: 220px;
    height: 220px;
    top: 60%;
    right: 0%;
    background: rgba(100,200,255,0.8);
    animation-duration: 19s;
    animation-delay: -3s;
}

.ball:nth-child(3) {
    width: 260px;
    height: 260px;
    bottom: 0%;
    left: 10%;
    background: rgba(200,130,255,0.75);
    animation-duration: 22s;
    animation-delay: -5s;
}

.ball:nth-child(4) {
    width: 150px;
    height: 150px;
    top: 30%;
    right: 10%;
    background: rgba(255,200,50,0.85);
    animation-duration: 14s;
    animation-delay: -2s;
}

.ball:nth-child(5) {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 70%;
    background: rgba(80,255,150,0.7);
    animation-duration: 18s;
    animation-delay: -4s;
}

@keyframes floatBall {
    0% { transform: translate(0,0) scale(1); }
    50% { transform: translate(40px,-40px) scale(1.2); }
    100% { transform: translate(-40px,40px) scale(0.9); }
}

/* ========== АНИМАЦИИ ПОЯВЛЕНИЯ ========== */
.hero, .pricing-grid, .reviews-grid, .faq-list, .live-stats-container, .activity-feed {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.hero { animation-delay: 0.1s; }
.live-stats-container { animation-delay: 0.2s; }
.pricing-grid { animation-delay: 0.3s; }
.reviews-grid { animation-delay: 0.5s; }
.activity-feed { animation-delay: 0.6s; }
.faq-list { animation-delay: 0.7s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== НАВИГАЦИЯ ========== */
.navbar {
    position: sticky;
    top: 20px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding: .8rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-radius: 60px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    width: calc(100% - 4rem);
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.logo {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -.02em;
    background: linear-gradient(145deg, var(--accent), #97b9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: .2s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-actions {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.theme-toggle, .login-btn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    padding: .5rem 1.1rem;
    border-radius: 40px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 4px 8px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle i, .login-btn i {
    color: var(--accent);
}

.theme-toggle:hover, .login-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: #fff;
}

.theme-toggle:hover i, .login-btn:hover i {
    color: #fff;
}

/* ========== КОНТЕЙНЕР ========== */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.2rem 2rem 3rem;
    position: relative;
    z-index: 2;
}

/* ========== 3D КОНТЕЙНЕР ========== */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15;
}

/* ========== СТАТИСТИКА ========== */
.live-stats-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-card {
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2.5rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform .2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ========== ЛЕНТА АКТИВНОСТИ ========== */
.activity-feed {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 1.8rem;
    margin: 2rem 0;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.activity-feed h3 {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity .3s;
}

.activity-item i {
    color: #4CAF50;
}

.activity-item:last-child {
    border-bottom: none;
}

/* ========== ДОСТИЖЕНИЯ ========== */
.achievement-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--glass-bg);
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    border: 1px solid gold;
    margin: 0 0.5rem 0.5rem 0;
    backdrop-filter: blur(5px);
}

/* ========== ТУЛТИПЫ ========== */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
    border: 1px solid var(--accent);
    animation: fadeIn 0.2s;
    z-index: 10;
    color: var(--text-primary);
}

/* ========== КОДЕКИ ========== */
.codec-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
}

.savings {
    color: #4CAF50;
    font-weight: bold;
}

/* ========== РЕКОМЕНДАЦИИ ========== */
.recommendations {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 1rem auto;
    justify-content: center;
    max-width: 600px;
}

.format-tag {
    padding: 0.3rem 1rem;
    background: var(--accent);
    color: white;
    border-radius: 30px;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: .2s;
    display: inline-block;
}

.format-tag:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ========== СРАВНЕНИЕ РАЗМЕРОВ ========== */
.size-comparison {
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 30px;
    margin: 1rem 0;
}

.size-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.original-size {
    background: #ff6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
}

.converted-size {
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
}

/* ========== API КОНСОЛЬ ========== */
.api-console {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.api-console pre {
    background: rgba(0,0,0,0.1);
    padding: 1rem;
    border-radius: 20px;
    overflow-x: auto;
}

/* ========== ОПТИМИЗАЦИЯ ========== */
.lazy-load {
    content-visibility: auto;
    contain-intrinsic-size: 1px 5000px;
}

/* ========== НЕОНОВОЕ СВЕЧЕНИЕ ========== */
.buy-btn:hover, .file-label:hover {
    box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent);
    transition: box-shadow 0.3s;
}

/* ========== АНИМИРОВАННЫЙ ГРАДИЕНТ ========== */
.hero h1 {
    background: linear-gradient(130deg, var(--text-primary), var(--accent), #ff6b6b, var(--accent));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== ГЕРОЙ СЕКЦИЯ ========== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 2rem 0 3rem;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    max-width: 700px;
    line-height: 1.2;
}

.hero .subhead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
}

/* ========== ЗАГРУЗКА ФАЙЛА ========== */
.upload-card {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 60px;
    padding: 1.8rem 2.5rem;
    box-shadow: var(--glass-shadow);
    width: fit-content;
    margin: 0 auto;
    transition: transform .2s;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    background: var(--card-bg);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: 1px dashed var(--accent-soft);
    cursor: pointer;
    color: var(--text-primary);
    transition: .15s;
}

.file-label i {
    font-size: 2rem;
    color: var(--accent);
}

.file-label:hover {
    background: var(--accent-soft);
    color: #000;
}

#videoFile {
    display: none;
}

.conversion-area {
    margin: 2rem 0 1rem;
}

.progress-hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 30px;
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid var(--glass-border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #a0c0ff);
    border-radius: 30px;
    transition: width .05s linear;
}

.fake-dialog {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 1px solid #fff;
    border-radius: 40px;
    padding: 2rem;
    max-width: 400px;
    margin: 1.5rem auto;
    text-align: center;
    box-shadow: var(--glass-shadow);
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn {
    padding: .8rem 2rem;
    border-radius: 40px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--text-primary);
}

/* ========== ЗАГОЛОВКИ СЕКЦИЙ ========== */
.section-title {
    font-size: 2.2rem;
    margin: 3rem 0 1.5rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

/* ========== ТАРИФЫ ========== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.price-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 2rem 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: all .2s;
    will-change: transform;
}

.price-card:hover {
    transform: translateY(-6px);
    background: var(--glass-bg);
}

.price-card .price {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    margin: .8rem 0;
}

.price-card ul {
    list-style: none;
    margin: 1.2rem 0;
    color: var(--text-secondary);
}

.price-card li {
    margin: .5rem 0;
}

.buy-btn {
    width: 100%;
    background: var(--accent);
    border: none;
    border-radius: 50px;
    padding: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.buy-btn .btn-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    font-size: 0.8rem;
}

/* ========== ОТЗЫВЫ ========== */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.review-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: .2s;
}

.review-card:hover {
    transform: translateY(-3px);
}

.review-card i {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: .5rem;
}

/* ========== FAQ ========== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--faq-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.faq-question {
    padding: 1.2rem 2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    max-height: 0;
    padding: 0 2rem;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    transition: max-height .3s ease, padding .3s;
    overflow: hidden;
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 1rem 2rem 1.5rem;
}

/* ========== COOKIE NOTICE ========== */
.cookie-notice {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 60px;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #fff;
    z-index: 100;
    box-shadow: var(--glass-shadow);
}

.cookie-notice button {
    background: var(--accent);
    border: none;
    padding: .5rem 1.5rem;
    border-radius: 40px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    z-index: 200;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border-radius: 50px;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    border: 2px solid var(--glass-border);
    margin: 0 auto;
}

.modal input {
    display: block;
    width: 100%;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 60px;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.3);
}

.close-modal {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ========== ФУТЕР ========== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    margin-top: 3rem;
}

/* ========== АНИМАЦИЯ ПОЯВЛЕНИЯ ЭЛЕМЕНТОВ ========== */
.price-card, .review-card, .faq-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s, transform .6s;
}

.price-card.visible, .review-card.visible, .faq-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .navbar {
        width: calc(100% - 2rem);
        padding: .6rem 1rem;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .logo {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .nav-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-actions {
        gap: 0.8rem;
        justify-content: center;
    }
    
    .theme-toggle span, .login-btn .login-text {
        display: none;
    }
    
    .theme-toggle, .login-btn {
        padding: .5rem .8rem;
    }
    
    .stat-card {
        padding: 1rem 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}