/* freeviddown - Main Stylesheet */

/* ============================================
   CSS Variables & Theme
   ============================================ */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-color: #6366f1;
    /* Alias for Engine compatibility */
    --primary-rgb: 99, 102, 241;
    /* For RGBA manipulations */

    /* Secondary & Accent */
    --secondary-color: #f43f5e;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(var(--primary-rgb), 0.4);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    --gradient-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;

    /* Borders */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 35px 60px -15px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Container */
    --container-max: 1200px;
}

/* Dark Theme */
.theme-dark {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #25253d;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-glass: rgba(30, 30, 50, 0.6);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b85;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);

    --gradient-bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #25253d 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

/* Light Theme */
.theme-light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.7);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.05);

    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
}

/* ============================================
   Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Utilities
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ============================================
   Components: Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 25px var(--primary-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-download {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-md);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.btn-block {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.btn-link:hover {
    text-decoration: underline;
}

/* ============================================
   Components: Inputs
   ============================================ */
.input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-family: inherit;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-fast);
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input::placeholder {
    color: var(--text-muted);
}

.input-group {
    display: flex;
    gap: 0;
}

.input-group .input {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    border-right: none;
}

.input-group .input:focus {
    z-index: 1;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--space-md) 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.5em;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.auth-buttons {
    display: flex;
    gap: var(--space-sm);
}

/* Theme Toggle Icons */
.theme-dark .icon-moon {
    display: none;
}

.theme-dark .icon-sun {
    display: inline;
}

.theme-light .icon-moon {
    display: inline;
}

.theme-light .icon-sun {
    display: none;
}

/* ============================================
   Hero Section
   ============================================ */
/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    padding: var(--space-2xl) 0;
    text-align: center;
    overflow: hidden;
}

.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* ============================================
   Site Marquee
   ============================================ */
.site-marquee {
    position: absolute;
    top: 10%;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    opacity: 0.15;
    /* Subtle */
    transform: rotate(-5deg) scale(1.1);
    /* Dynamic angle */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.marquee-row {
    display: flex;
    gap: 4rem;
    width: 200%;
    /* Wide enough to scroll */
}

.marquee-item {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    -webkit-text-fill-color: transparent;
    /* Outline effect */
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

/* ============================================
   Cute Kawaii Bot
   ============================================ */
.kawaii-bot-wrapper {
    position: absolute;
    top: 15%;
    right: 8%;
    width: 100px;
    height: 120px;
    z-index: 20;
    pointer-events: none;
    /* Interactive via JS only */
    animation: happyBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(99, 102, 241, 0.3));
}

.kawaii-bot-body {
    position: relative;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #f0f0f5);
    border-radius: 50%;
    margin: 0 auto;
    box-shadow:
        inset -5px -5px 10px rgba(0, 0, 0, 0.05),
        0 0 20px rgba(255, 255, 255, 0.8);
    /* Soft glow */
    z-index: 2;
}

/* Face */
.kawaii-face {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 5px;
}

.kawaii-eye {
    width: 18px;
    height: 24px;
    background: #1e1e2e;
    border-radius: 50%;
    position: absolute;
    top: 25px;
    overflow: hidden;
    animation: cuteBlink 4s infinite;
}

.kawaii-eye.left {
    left: 18px;
}

.kawaii-eye.right {
    right: 18px;
}

.theme-dark .kawaii-eye {
    background: #000;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.kawaii-pupil {
    width: 8px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 4px;
}

.kawaii-sparkle {
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    bottom: 6px;
    right: 4px;
    opacity: 0.8;
}

.kawaii-mouth {
    width: 10px;
    height: 6px;
    border-bottom: 3px solid #1e1e2e;
    border-radius: 50%;
    position: absolute;
    top: 50px;
}

.theme-dark .kawaii-mouth {
    border-color: #fff;
}

.kawaii-blush {
    width: 12px;
    height: 6px;
    background: #f43f5e;
    border-radius: 50%;
    position: absolute;
    top: 45px;
    opacity: 0.4;
}

.kawaii-blush.left {
    left: 8px;
}

.kawaii-blush.right {
    right: 8px;
}

/* Antenna */
.kawaii-antenna {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: #a855f7;
    z-index: 1;
    animation: antennaWiggle 2s ease-in-out infinite;
}

.kawaii-bulb {
    width: 10px;
    height: 10px;
    background: #00ff00;
    /* Happy green default */
    border-radius: 50%;
    position: absolute;
    top: -8px;
    left: -4px;
    box-shadow: 0 0 10px #00ff00;
    animation: bulbPulse 1.5s infinite;
}

/* Hands */
.kawaii-hand {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.kawaii-hand.left {
    top: 50px;
    left: -10px;
    animation: happyClap 2s ease-in-out infinite alternate;
}

.kawaii-hand.right {
    top: 50px;
    right: -10px;
    animation: happyClap 2s ease-in-out infinite alternate-reverse;
}

/* Shadow */
.kawaii-shadow {
    width: 40px;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    margin: 15px auto 0;
    filter: blur(4px);
    animation: shadowPulse 3s ease-in-out infinite;
}

/* Animations */
@keyframes happyBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes cuteBlink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

@keyframes antennaWiggle {

    0%,
    100% {
        transform: translateX(-50%) rotate(0deg);
    }

    33% {
        transform: translateX(-50%) rotate(10deg);
    }

    66% {
        transform: translateX(-50%) rotate(-10deg);
    }
}

@keyframes bulbPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

@keyframes happyClap {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-5px) scale(1.1);
    }
}

@keyframes shadowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

/* Mobile Optimization: Bot gets very small and cute in top right corner */
@media (max-width: 768px) {
    .kawaii-bot-wrapper {
        width: 60px;
        height: 80px;
        top: 20px;
        right: 15px;
        /* Stick to right, non-obtrusive */
    }

    .kawaii-bot-body {
        width: 50px;
        height: 50px;
    }

    .kawaii-eye {
        width: 12px;
        height: 16px;
        top: 15px;
    }

    .kawaii-eye.left {
        left: 10px;
    }

    .kawaii-eye.right {
        right: 10px;
    }

    .kawaii-pupil {
        width: 5px;
        height: 6px;
    }

    .kawaii-mouth {
        top: 35px;
        width: 6px;
    }

    .kawaii-blush {
        top: 32px;
        width: 8px;
    }

    .kawaii-hand {
        width: 10px;
        height: 10px;
    }

    .kawaii-hand.left {
        top: 30px;
        left: -5px;
    }

    .kawaii-hand.right {
        top: 30px;
        right: -5px;
    }
}

/* Global Life Pulse */
@keyframes globalPulse {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.01);
        filter: brightness(1.1);
    }
}

/* Apply pulse to key containers for "Alive" feel */
.feature-card,
.download-box {
    animation: globalPulse 4s ease-in-out infinite;
}

/* Geo Shapes */
.geo-shape {

    position: absolute;
    color: rgba(99, 102, 241, 0.15);
    font-weight: 900;
    font-size: 2rem;
    pointer-events: none;
    z-index: -1;
}

.cross-1 {
    top: 20%;
    left: 10%;
    transform: rotate(15deg);
}

.cross-2 {
    bottom: 30%;
    right: 20%;
    transform: rotate(-20deg);
    color: rgba(244, 63, 94, 0.15);
}

.circle-outline-1 {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(168, 85, 247, 0.15);
    border-radius: 50%;
    top: 60%;
    left: 15%;
}

.squiggle-1 {
    width: 100px;
    top: 15%;
    right: 30%;
    color: rgba(16, 185, 129, 0.15);
    transform: rotate(45deg);
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    /* Hidden initially, revealed by anime.js */
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: -50px;
    left: -50px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -100px;
    right: -100px;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    top: 20%;
    right: 15%;
}

.shape-4 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: 20%;
    left: 10%;
}

.hero-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    /* Gradient text handled by .gradient-text utility or anime.js if specific */
}

/* Animation targets */
.hero-title .letter,
.hero-subtitle .word {
    display: inline-block;
    line-height: 1em;
    transform-origin: 50% 100%;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    position: relative;
    z-index: 1;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #f43f5e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientFlow 5s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   Download Box
   ============================================ */
.download-box {
    max-width: 700px;
    margin: 0 auto;
    padding: var(--space-xl);

    /* Glassmorphism */
    background: rgba(30, 30, 50, 0.6);
    /* Fallback */
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    /* Reveal animation initial state (handled by anime.js mostly, but good to have defaults) */
    opacity: 0;
    transform: translateY(20px);
}

.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #6366f1, #f43f5e, #a855f7);
    z-index: -1;
    border-radius: calc(var(--radius-xl) + 2px);
    opacity: 0.3;
    filter: blur(10px);
    transition: opacity 0.3s ease;
}

.download-box:hover.glow-effect::before {
    opacity: 0.5;
}

.download-form {
    margin-bottom: var(--space-lg);
}

.platforms {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: default;

    /* Initial state for stagger */
    opacity: 0;
    transform: translateY(10px);
}

.platform-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.platform-icon {
    font-size: 1.1em;
}

.platform-badge.universal {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

/* ============================================
   Specialized Bots
   ============================================ */

/* 1. Logo Bot (Tiny Drone) */
.logo {
    position: relative;
    overflow: visible;
    /* Allow bot to fly out */
}

.logo-bot {
    position: absolute;
    top: -15px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 5px;
    z-index: 10;
    animation: droneHover 1s ease-in-out infinite alternate;
}

.logo-bot::before,
.logo-bot::after {
    /* Propellers */
    content: '';
    position: absolute;
    top: -2px;
    width: 12px;
    height: 2px;
    background: var(--primary);
    animation: propSpin 0.1s linear infinite;
}

.logo-bot::before {
    left: -4px;
}

.logo-bot::after {
    right: -4px;
}

.bot-eye {
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
    margin: 6px auto;
    box-shadow: 0 0 5px #00ff00;
}

@keyframes droneHover {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

@keyframes propSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* 2. Download Bot (Worker) */
.bot-download-container {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 5;
}

.bot-download {
    position: relative;
    width: 100%;
    height: 100%;
    /* Initially hidden or peaking */
    transform: translateY(20px);
    opacity: 0;
}

.bot-head {
    width: 40px;
    height: 30px;
    background: #4f46e5;
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    border: 2px solid white;
}

.bot-eye-scan {
    width: 30px;
    height: 6px;
    background: #000;
    margin: 10px auto;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.bot-eye-scan::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
    animation: eyeScan 2s linear infinite;
}

.bot-arm {
    position: absolute;
    width: 8px;
    height: 20px;
    background: #a855f7;
    top: 20px;
    border-radius: 4px;
}

.bot-arm.left {
    left: 5px;
    transform-origin: top center;
    transform: rotate(20deg);
}

.bot-arm.right {
    right: 5px;
    transform-origin: top center;
    transform: rotate(-20deg);
}

@keyframes eyeScan {

    0%,
    100% {
        left: 0;
    }

    50% {
        left: 24px;
    }
}

/* 3. Quality Bot (Inspector) - Created dynamically or reused styles */
.quality-bot-active {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #10b981;
    border-radius: 50%;
    top: -15px;
    right: -15px;
    z-index: 20;
    box-shadow: 0 0 15px #10b981;
    pointer-events: none;
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-xl) 0;
        /* Reduced padding */
    }

    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .mascot-wrapper {
        width: 80px;
        /* Smaller mascot */
        height: 100px;
        top: 50px;
        /* Position higher to avoid overlap */
        right: 10px;
    }

    .mascot-head {
        width: 70px;
        height: 60px;
        border-radius: 16px;
    }

    .mascot-eye {
        width: 16px;
        height: 16px;
    }

    .mascot-pupil {
        width: 6px;
        height: 6px;
    }

    .mascot-hand {
        width: 14px;
        height: 14px;
    }

    .site-marquee {
        top: 20%;
        transform: rotate(-5deg) scale(1);
    }

    .marquee-item {
        font-size: 2.5rem;
        /* Smaller text */
    }

    /* Hide some heavy geo shapes on narrow screens */
    .shape-1,
    .shape-2 {
        opacity: 0.5 !important;
        transform: scale(0.6);
    }
}

.results {
    padding: var(--space-xl) 0;
}

.result-card {
    max-width: 700px;
    margin: 0 auto;
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-info {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.video-thumbnail {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.video-details {
    flex: 1;
}

.video-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

.video-meta {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.quality-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.quality-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quality-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.quality-label {
    font-weight: 600;
    color: var(--text-primary);
}

.quality-format {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.quality-size {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.error-message {
    padding: var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    text-align: center;
}

/* ============================================
   Features Section
   ============================================ */
.features {
    padding: var(--space-2xl) 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: transform var(--transition-fast);
    /* Animation Start State */
    opacity: 0;
    transform: translateX(-50px);
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    display: block;
}

.feature-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.feature-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================
   Custom Footer Section
   ============================================ */
.custom-footer-section {
    max-width: var(--container-max);
    margin: var(--space-lg) auto;
    padding: var(--space-md) var(--space-lg);
    text-align: center;
}

.custom-footer-section:empty {
    display: none;
}

/* Elegant italic styling */
.custom-footer-section>* {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

.custom-footer-section h1,
.custom-footer-section h2,
.custom-footer-section h3 {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.custom-footer-section h1 {
    font-size: var(--font-size-xl);
}

.custom-footer-section h2 {
    font-size: var(--font-size-lg);
}

.custom-footer-section h3 {
    font-size: var(--font-size-md);
}

.custom-footer-section p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.8;
}

.custom-footer-section a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 400;
    font-style: italic;
    border-bottom: 1px dotted var(--primary);
    transition: all var(--transition-fast);
}

.custom-footer-section a:hover {
    color: var(--primary-hover);
    border-bottom-style: solid;
}

/* Minimal divider */
.custom-footer-section::before {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 0 auto var(--space-md);
}

.footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.copyright {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* ============================================
   Section Titles
   ============================================ */
.section {
    padding: var(--space-2xl) 0;
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xl);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
    /* Animation Start State */
    opacity: 0;
    transform: scale(0.9);
}

.faq-question {
    padding: var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--space-lg) var(--space-lg);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
}

.modal-header {
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-error {
    padding: var(--space-sm);
    margin-bottom: var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: var(--font-size-sm);
    text-align: center;
}

.auth-switch {
    margin-top: var(--space-lg);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.forgot-link {
    display: block;
    margin-top: var(--space-md);
    text-align: center;
}

/* ============================================
   Dropdown Menu
   ============================================ */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 1;
    transform: translateY(0);
    transition: all var(--transition-base);
}

.dropdown-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.dropdown-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.check-icon {
    color: var(--primary);
    font-size: 1rem;
    font-weight: bold;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--space-sm) 0;
}

/* Language Dropdown Specific */
.language-dropdown {
    min-width: 200px;
}

.language-dropdown .dropdown-item {
    font-size: var(--font-size-sm);
}

/* RTL Support for Dropdown */
[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
}

/* ============================================
   Comparison Table Section
   ============================================ */
.comparison {
    padding: var(--space-2xl) 0;
    background: var(--gradient-card);
}

.comparison-table {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.comparison-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-align: center;
}

.comparison-header>div:first-child {
    text-align: left;
}

[dir="rtl"] .comparison-header>div:first-child {
    text-align: right;
}

.comparison-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: background var(--transition-fast);
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row:hover {
    background: var(--bg-tertiary);
}

.comparison-feature {
    font-weight: 500;
    color: var(--text-primary);
}

.comparison-value {
    text-align: center;
    font-size: var(--font-size-sm);
}

.comparison-us {
    color: var(--success);
    font-weight: 600;
}

.comparison-others {
    color: var(--text-muted);
}

.check-mark {
    color: var(--success);
    font-size: 1.5rem;
}

.cross-mark {
    color: var(--error);
    font-size: 1.5rem;
    opacity: 0.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    .comparison-header,
    .comparison-row {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: var(--space-sm);
        padding: var(--space-md);
        font-size: var(--font-size-sm);
    }

    .comparison-feature {
        font-size: var(--font-size-sm);
    }

    .comparison-value {
        font-size: var(--font-size-xs);
    }
}

/* ============================================
   Ad Zones
   ============================================ */
.ad-zone {
    padding: var(--space-md);
    text-align: center;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-md);
    }

    .input-group {
        flex-direction: column;
    }

    .input-group .input {
        border-radius: var(--radius-lg);
        border-right: 1px solid var(--border-color);
    }

    .btn-download {
        border-radius: var(--radius-lg);
        width: 100%;
    }

    .video-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .video-thumbnail {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 16/9;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .quality-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .download-box {
        padding: var(--space-lg);
    }

    .platforms {
        gap: var(--space-md);
    }

    .feature-card {
        padding: var(--space-lg);
    }
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    min-width: 300px;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

/* ============================================
   Skeleton Loader
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 0%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-image {
    width: 160px;
    height: 90px;
}

.skeleton-button {
    height: 42px;
    width: 120px;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--space-md) 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar.animated {
    animation: progress-pulse 2s infinite;
}

@keyframes progress-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================
   Format Pills
   ============================================ */
.format-pills {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    justify-content: center;
}

.format-pill {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.format-pill:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.format-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   Quality Badge
   ============================================ */
.quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.quality-badge-2k {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: white;
}

.quality-badge-hd {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white;
}

.quality-badge-sd {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ============================================
   Copy Button
   ============================================ */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* ============================================
   History Panel
   ============================================ */
.history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.history-panel.open {
    right: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.history-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.history-list {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    align-items: center;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 24px;
}

.history-thumb {
    width: 96px;
    height: 54px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.history-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-platform-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.history-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s;
}

.history-item:hover .history-actions {
    opacity: 1;
    transform: translateX(0);
}

.history-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

.history-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.history-action-btn.delete:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.history-search {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.history-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.history-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.2);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.history-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}


/* ============================================
   History Panel Side Sidebar
   ============================================ */
.history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--hub-bg);
    backdrop-filter: blur(var(--hub-blur));
    -webkit-backdrop-filter: blur(var(--hub-blur));
    z-index: 10001;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--hub-border);
}

.history-panel.open {
    right: 0;
}

/* FAB Button */
.fab {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 999;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 25px rgba(58, 123, 213, 0.5);
}

/* ============================================
   Pulse Animation
   ============================================ */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ============================================
   Floating Action Button
   ============================================ */
.fab {
    position: fixed;
    bottom: var(--space-xl);
    left: var(--space-xl);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 20px var(--primary-glow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
    z-index: 99;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--primary-glow);
}

/* ============================================
   RTL Adjustments
   ============================================ */
[dir="rtl"] .toast-container {
    left: var(--space-xl);
    right: auto;
}

[dir="rtl"] .history-panel {
    right: auto;
    left: -400px;
    border-left: none;
    border-right: 1px solid var(--border-color);
}

[dir="rtl"] .history-panel.open {
    left: 0;
}

/* ============================================
   Mobile Menu Styles
   ============================================ */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    padding: var(--space-xs);
}

/* ============================================
   Dropdown Show State
   ============================================ */
.dropdown-menu.show {
    display: block;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   User Menu Positioning
   ============================================ */
.user-menu {
    position: relative;
}

#userDropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-sm);
    z-index: 1000;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   History Actions
   ============================================ */
.history-actions {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Responsive: Desktop (1200px+)
   ============================================ */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .download-box {
        max-width: 800px;
    }
}

/* ============================================
   Responsive: Tablet (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .container {
        max-width: 960px;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .faq-grid {
        max-width: 100%;
    }
}

/* ============================================
   Responsive: Mobile & Tablet (up to 1024px)
   ============================================ */
@media (max-width: 1024px) {

    /* Toast */
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-lg);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .history-panel {
        width: 100%;
    }

    /* Mobile Menu */
    .mobile-menu-btn {
        display: flex;
        order: 3;
    }

    .nav {
        flex-wrap: wrap;
    }

    .auth-buttons,
    .user-menu {
        display: none;
        width: 100%;
        padding-top: var(--space-md);
        border-top: 1px solid var(--border-color);
        margin-top: var(--space-md);
    }

    .nav.nav-open .auth-buttons,
    .nav.nav-open .user-menu {
        display: flex;
        flex-direction: column;
    }

    #userDropdown {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 0;
        width: 100%;
        box-shadow: none;
        border: none;
        background: var(--bg-tertiary);
    }

    .nav.nav-open .auth-buttons {
        flex-direction: row;
        justify-content: center;
    }

    #themeToggle,
    #langToggle {
        order: 1;
    }

    /* Hero */
    .hero {
        padding: var(--space-xl) 0;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-md);
    }

    /* Download Box */
    .download-box {
        padding: var(--space-lg);
    }

    .input-group {
        flex-direction: column;
    }

    .input-group .input {
        border-radius: var(--radius-lg);
        border-right: 1px solid var(--border-color);
    }

    .btn-download {
        border-radius: var(--radius-lg);
        width: 100%;
        margin-top: var(--space-sm);
    }

    /* Video Info */
    .video-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .video-thumbnail {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 16/9;
    }

    /* Quality Options */
    .quality-options {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: var(--space-lg);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Platforms */
    .platforms {
        gap: var(--space-md);
    }

    /* FAQ */
    .faq-question {
        padding: var(--space-md);
        font-size: var(--font-size-sm);
    }

    .faq-answer {
        padding: 0 var(--space-md) var(--space-md);
        font-size: var(--font-size-sm);
    }

    /* User Dropdown */
    #userDropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    /* FAB smaller on mobile */
    .fab {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        bottom: var(--space-lg);
        left: var(--space-lg);
    }

    /* Section spacing */
    .section {
        padding: var(--space-xl) 0;
    }

    .section-title {
        font-size: var(--font-size-xl);
    }
}

/* ============================================
   Responsive: Small Mobile (up to 480px)
   ============================================ */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .hero-title {
        font-size: var(--font-size-xl);
    }

    .download-box {
        padding: var(--space-md);
        border-radius: var(--radius-lg);
    }

    .platform-icon {
        font-size: 1.25rem;
    }

    .quality-options {
        grid-template-columns: 1fr;
    }

    .quality-btn {
        flex-direction: row;
        justify-content: space-between;
    }

    .modal-content {
        padding: var(--space-lg);
        margin: var(--space-sm);
        max-height: 90vh;
        overflow-y: auto;
    }

    .result-card {
        padding: var(--space-md);
    }

    .format-pills {
        flex-wrap: wrap;
    }

    /* Header adjustments */
    .logo-text {
        font-size: var(--font-size-md);
    }

    .logo-icon {
        font-size: 1.25em;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .header,
    .footer,
    .fab,
    .toast-container,
    .history-panel,
    .modal,
    .ad-zone {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .download-box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Dark Mode Preference
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
    }
}

/* ============================================
   Interstitial Ad Modal
   ============================================ */
.interstitial-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.interstitial-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border-color);
}

.interstitial-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.interstitial-header p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.interstitial-ad {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
}

.interstitial-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.interstitial-skip {
    margin-top: 1rem;
}

.quality-2k {
    border: 2px solid #8b5cf6 !important;
    position: relative;
}

.quality-no-audio {
    font-size: 0.7rem;
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 500;
}

.quality-ad-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
}

.ad-skeleton {
    height: 100px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ============================================
   Mobile Hamburger Menu
   ============================================ */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block;
    }

    .header-content {
        gap: var(--space-sm);
    }

    .logo {
        flex: 1;
        font-size: var(--font-size-md);
    }

    .nav {
        position: fixed;
        top: 64px;
        /* Adjusted for header padding */
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 99;
        box-shadow: var(--shadow-xl);
    }

    .nav.nav-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav .btn,
    .nav .auth-buttons,
    .nav .user-menu {
        width: 100%;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .auth-buttons .btn {
        width: 100%;
    }
}

/* RTL Mobile Menu */
[dir="rtl"] .mobile-menu-btn {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ============================================
   Download Progress Bar
   ============================================ */
.progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar.animated {
    animation: progress-shimmer 1.5s infinite;
    background-size: 200% 100%;
}

@keyframes progress-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary);
}

.progress-eta {
    color: var(--text-secondary);
}

/* Live progress overlay */
.progress-overlay {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.progress-overlay-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-overlay-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
}

/* ============================================
   Error Card with Retry
   ============================================ */
.error-card {
    text-align: center;
    padding: 2rem;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.retry-section {
    margin-bottom: 1.5rem;
}

.retry-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.alternatives-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.alternatives-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alternatives-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alternatives-list li {
    padding: 0.25rem 0;
}

.alternatives-list a {
    color: var(--primary);
    text-decoration: none;
}

.alternatives-list a:hover {
    text-decoration: underline;
}

.help-section {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   Video Preview Modal
   ============================================ */
.video-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.video-preview-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.video-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.video-preview-header h3 {
    margin: 0;
    font-size: 1rem;
}

.video-preview-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.video-preview-frame {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
}

.video-preview-frame iframe {
    position: absolute;
    width: 100%;
    height: 100%;
}

.video-preview-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   Queue Limits Display
   ============================================ */
.queue-limits {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.queue-limit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.queue-limit-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Enhanced Hero Section
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Paste and Clear Buttons */
.paste-btn,
.clear-btn {
    padding: 0.75rem;
    font-size: 1.25rem;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.paste-btn:hover,
.clear-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.input-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
}

.input-group .input {
    border-radius: 0;
    border: none;
    flex: 1;
}

.input-group .btn-download {
    border-radius: 0;
}

/* Platform Badges */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.platform-badge:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.platform-badge.universal {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
}

.platform-badge .platform-icon {
    font-size: 1rem;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Light theme adjustments */
.theme-light .glass-effect {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Platforms container update */
.platforms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* ============================================
   Mode Toggle & Scan Feature
   ============================================ */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.btn-scan {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-scan:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Scan Results */
.scan-results {
    margin-top: 2rem;
}

.scan-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.scan-results-count {
    font-size: 1.25rem;
    font-weight: 600;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.video-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.video-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.video-item-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.video-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.video-item-platform {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
}

.video-item-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Playlist Mode Styles */
.btn-playlist {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-playlist:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.playlist-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.selection-count {
    font-weight: 500;
}

.playlist-actions {
    display: flex;
    gap: 0.5rem;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.playlist-item:hover {
    background: var(--bg-tertiary);
}

.playlist-item.selected {
    border: 1px solid var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.playlist-item.selected .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.playlist-item-info {
    flex: 1;
    overflow: hidden;
}

.playlist-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Smart Tools Section
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-link:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: var(--bg-tertiary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.tool-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
}

.tool-link:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-text h4 {
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.tool-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* SEO Optimization */
.hero-title span {
    display: inline-block;
}

[loading="lazy"] {
    opacity: 0.95;
    transition: opacity 0.5s ease-in;
}

/* ============================================
   Ad Zone Containers
   ============================================ */
.ad-zone {
    width: 100%;
    max-width: var(--container-max);
    margin: 1rem auto;
    padding: 0 1rem;
    text-align: center;
    display: none;
    /* Hidden by default, shown when ads are loaded */
}

.ad-zone:empty {
    display: none;
}

#ad-zone-header {
    margin-bottom: 0;
    padding-top: 1rem;
}

#ad-zone-footer {
    margin-top: 2rem;
    padding-bottom: 1rem;
    border-top: 1px solid var(--border-color);
}

#ad-zone-before-download {
    margin: 1.5rem auto;
}

/* ============================================
   Advanced Ad Position Types
   ============================================ */

/* Fixed Bottom Ad (Sticky) */
.ad-zone-fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.ad-zone-fixed-bottom .ad-close {
    position: absolute;
    top: -12px;
    right: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}

/* Sidebar Ad */
.ad-zone-sidebar {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    width: 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-xl);
}

@media (max-width: 1400px) {
    .ad-zone-sidebar {
        display: none !important;
    }
}

/* Overlay Ad (Popup) */
.ad-zone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.ad-zone-overlay .ad-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    position: relative;
}

.ad-zone-overlay .ad-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

/* Interstitial Ad */
.ad-zone-interstitial {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.ad-zone-interstitial .ad-timer {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.ad-zone-interstitial .ad-skip {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
}

.ad-zone-interstitial .ad-skip.active {
    opacity: 1;
    pointer-events: auto;
}

/* Inline Ad */
.ad-zone-inline {
    margin: 1.5rem auto;
    padding: 1rem;
    background: var(--bg-glass);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
}

/* Mobile Bottom Ad (Sticky on Mobile) */
.ad-zone-mobile-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    /* Hidden by default, shown only on mobile when ads exist */
}

.ad-zone-mobile-bottom .ad-close {
    position: absolute;
    top: -12px;
    right: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
}

/* Show mobile-bottom only on mobile devices */
@media (min-width: 769px) {
    .ad-zone-mobile-bottom {
        display: none !important;
    }
}

/* ============================================
   Revolutionary Download Hub UI (Glassmorphism 2.0)
   ============================================ */
:root {
    --hub-bg: rgba(18, 18, 24, 0.85);
    --hub-border: rgba(255, 255, 255, 0.08);
    --hub-blur: 20px;
    --progress-glow: 0 0 15px var(--primary-color-rgba, rgba(58, 123, 213, 0.4));
}

.download-progress-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    max-width: 400px;
    width: calc(100% - 48px);
    background: var(--hub-bg);
    backdrop-filter: blur(var(--hub-blur));
    -webkit-backdrop-filter: blur(var(--hub-blur));
    border: 1px solid var(--hub-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transform-origin: bottom right;
}

.download-progress-container.minimized {
    transform: translateY(calc(100% - 56px)) scale(0.95);
    opacity: 0.9;
}

.download-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--hub-border);
    cursor: pointer;
}

.download-hub-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.download-hub-actions {
    display: flex;
    gap: 6px;
}

.hub-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hub-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.download-hub-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-hub-list::-webkit-scrollbar {
    width: 4px;
}

.download-hub-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.download-progress-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    position: relative;
    animation: hubItemIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    transition: all 0.3s ease;
}

.download-progress-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

@keyframes hubItemIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.download-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.download-progress-details {
    flex: 1;
    min-width: 0;
}

.download-progress-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.download-progress-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.download-progress-quality {
    color: var(--primary-color);
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(58, 123, 213, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.download-progress-status {
    position: relative;
}

.download-progress-text {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.download-progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.download-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00d2ff);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--progress-glow);
}

.download-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.download-progress-cancel {
    background: rgba(255, 59, 48, 0.1);
    border: none;
    color: #ff3b30;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.download-progress-cancel:hover {
    background: #ff3b30;
    color: white;
    transform: scale(1.1);
}

.download-progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Complete & Error States */
.download-progress-item.complete .download-progress-bar {
    background: linear-gradient(90deg, #34c759, #b1ea4d);
    box-shadow: 0 0 15px rgba(52, 199, 89, 0.4);
}

.download-progress-item.error .download-progress-bar {
    background: linear-gradient(90deg, #ff3b30, #ff9500);
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.4);
}


.download-progress-status {
    width: 100%;
}

.download-progress-text {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.download-progress-bar-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.download-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.download-progress-cancel {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.6;
}

.download-progress-cancel:hover {
    opacity: 1;
    color: var(--secondary-color);
}

.download-progress-item.complete {
    border-color: rgba(0, 255, 128, 0.2);
    background: rgba(0, 255, 128, 0.02);
}

.download-progress-item.complete .download-progress-text {
    color: #00ff80;
}

.download-progress-item.error {
    border-color: rgba(255, 64, 128, 0.2);
    background: rgba(255, 64, 128, 0.02);
}

.download-progress-item.error .download-progress-text {
    color: #ff4080;
}

@media (max-width: 480px) {
    .download-progress-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================
   PREMIUM UI ENHANCEMENTS - Engine 6.0
   ============================================ */

/* Animated Background */
.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(60px);
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #06b6d4, #10b981);
    bottom: -50px;
    left: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    bottom: 20%;
    right: 20%;
    animation-delay: -15s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) rotate(-5deg) scale(0.95);
    }

    75% {
        transform: translate(20px, 30px) rotate(3deg) scale(1.02);
    }
}

/* Live Stats Banner */
.live-stats-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Animated Gradient Text */
.animated-gradient {
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #f43f5e, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }

    100% {
        background-position: 0% center;
    }
}

/* Highlight Text */
.highlight-text {
    color: var(--primary);
    position: relative;
}

.highlight-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

/* Glow Effects */
.glow-effect {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
}

.glow-subtle {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.5), 0 0 30px rgba(168, 85, 247, 0.3);
    }
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: rotate(45deg);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Mode Toggle Enhancement */
.mode-btn .mode-icon {
    font-size: 1.1rem;
    margin-right: 4px;
}

.mode-btn .mode-text {
    font-weight: 500;
}

/* Enhanced Hero */
.hero {
    position: relative;
    overflow: hidden;
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* Platform Badge Enhancement */
.platform-badge {
    cursor: pointer;
}

.platform-badge.universal {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
}

/* Responsive Stats Banner */
@media (max-width: 768px) {
    .live-stats-banner {
        gap: var(--space-md);
        padding: var(--space-sm) var(--space-md);
    }

    .stat-item {
        flex-direction: column;
        gap: 2px;
    }

    .stat-divider {
        display: none;
    }

    .stat-label {
        font-size: var(--font-size-xs);
    }

    .floating-shape {
        opacity: 0.08;
    }
}

/* ============================================
   REVOLUTIONARY: Sites Browser Section
   ============================================ */
.sites-browser {
    background: var(--bg-secondary);
    padding: var(--space-2xl) 0;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.sites-search-box {
    max-width: 500px;
    margin: 0 auto var(--space-xl);
}

.sites-search-input {
    width: 100%;
    text-align: center;
    font-size: var(--font-size-lg);
    padding: var(--space-md) var(--space-lg);
}

.sites-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.site-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.site-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.category-icon {
    font-size: 2.5rem;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-count {
    font-size: var(--font-size-sm);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.sites-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
}

.note-icon {
    font-size: 1.5rem;
}

/* ============================================
   REVOLUTIONARY: Theme Customizer
   ============================================ */
.theme-customizer {
    padding: var(--space-2xl) 0;
}

.theme-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    cursor: pointer;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    background: var(--bg-glass);
}

.theme-option.active {
    border-color: var(--theme-color, var(--primary));
    background: var(--bg-glass);
}

.theme-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--theme-color, var(--primary));
    box-shadow: 0 5px 20px color-mix(in srgb, var(--theme-color, var(--primary)) 50%, transparent);
    transition: transform var(--transition-fast);
}

.theme-option:hover .theme-preview {
    transform: scale(1.15);
}

.theme-name {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

/* Color Themes */
.theme-purple {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.theme-rose {
    --primary: #f43f5e;
    --primary-hover: #e11d48;
    --primary-glow: rgba(244, 63, 94, 0.4);
    --gradient-primary: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
}

.theme-emerald {
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

.theme-amber {
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --primary-glow: rgba(245, 158, 11, 0.4);
    --gradient-primary: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.theme-cyan {
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --primary-glow: rgba(6, 182, 212, 0.4);
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

.theme-pink {
    --primary: #ec4899;
    --primary-hover: #db2777;
    --primary-glow: rgba(236, 72, 153, 0.4);
    --gradient-primary: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
}

.theme-option {
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.theme-option:hover {
    transform: translateY(-2px);
}

.theme-option.active .theme-preview {
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary);
    transform: scale(1.1);
}

/* Responsive Sites Grid */
@media (max-width: 768px) {
    .sites-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-options {
        gap: var(--space-md);
    }

    .theme-preview {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .sites-categories-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .site-category-card {
        padding: var(--space-md);
    }

    .site-category-card .category-icon {
        font-size: 2rem;
    }
}

/* ============================================
   High-Quality (1080p+) Download Styles
   ============================================ */
.quality-hq .quality-badge {
    background: rgba(58, 123, 213, 0.15);
    border: 1px solid rgba(58, 123, 213, 0.3);
    color: #4facfe;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.2);
}

.quality-hq:hover .quality-badge {
    background: #4facfe;
    color: white;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.5);
}

.quality-ad-badge {
    font-size: 0.7rem;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
    vertical-align: middle;
}

/* ============================================
   Premium Interstitial Modal (Glassmorphism 2.0)
   ============================================ */
.interstitial-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    background: rgba(10, 11, 15, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(25px);
    }
}

.interstitial-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    width: 100%;
    max-width: 550px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.95);
    animation: contentScaleIn 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes contentScaleIn {
    to {
        transform: scale(1);
    }
}

.interstitial-header h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.interstitial-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 24px;
}

.interstitial-ad {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.ad-placeholder {
    color: var(--text-muted);
}

.ad-skeleton {
    width: 300px;
    height: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    margin: 12px auto;
    position: relative;
    overflow: hidden;
}

.ad-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 50%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(200%);
    }
}

.interstitial-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.interstitial-timer {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
}

.interstitial-timer span {
    color: var(--primary);
    font-family: 'Monaco', monospace;
}

.interstitial-skip {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.interstitial-skip.hidden {
    display: none;
}

.interstitial-skip:not(.hidden) {
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   DRM Warning & Quality Selector
   ============================================ */
.drm-warning {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.drm-icon {
    font-size: 2rem;
}

.drm-text strong {
    color: var(--error);
    display: block;
    margin-bottom: var(--space-xs);
}

.drm-text p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

.quality-selector {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.quality-selector label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
}

.quality-dropdown {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.quality-dropdown:hover,
.quality-dropdown:focus {
    border-color: var(--primary);
}

.quality-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ============================================
   Advanced Animation System Styles
   ============================================ */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.loading-content {
    text-align: center;
    z-index: 2;
}

.loading-logo {
    font-size: 5rem;
    margin-bottom: var(--space-md);
    transform: scale(0);
}

.loading-text {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    opacity: 0;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.loading-bar-fill {
    height: 100%;
    width: 0;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.loading-curtain {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 1;
}

.loading-curtain.left {
    left: 0;
}

.loading-curtain.right {
    right: 0;
}

/* Particle System */
.particle-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.ambient-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Glow Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Confetti */
.confetti-piece {
    position: fixed;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Click Particles */
.click-particle {
    position: fixed;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Ripple Effect */
.ripple-effect {
    position: absolute;
    pointer-events: none;
    will-change: width, height, opacity;
}

/* Morphing Blobs */
.morphing-blob {
    position: absolute;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

/* Quality Bot Active State */
.quality-bot-active {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
    z-index: 10;
}

.quality-bot-active::before {
    content: '🤖';
    font-size: 14px;
}

/* Card 3D Perspective */
.feature-card,
.result-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
}

/* Focus Particles Container */
.focus-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

/* Letter Animation */
.hero-title .letter {
    display: inline-block;
    transform-origin: center bottom;
}

/* Word Animation */
.hero-subtitle .word {
    display: inline-block;
    margin-right: 0.3em;
}

/* Animated Gradient Text */
.animated-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   Responsive Animation Adjustments
   ============================================ */

@media (max-width: 768px) {

    /* Reduce particle effects on mobile */
    .particle-system {
        opacity: 0.5;
    }

    .glow-orb {
        display: none;
    }

    .shooting-star {
        display: none;
    }

    /* Simplify loading animation */
    .loading-logo {
        font-size: 3rem;
    }

    .loading-text {
        font-size: var(--font-size-lg);
    }

    .loading-bar {
        width: 150px;
    }

    /* Disable 3D card effects on mobile */
    .feature-card,
    .result-card {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .particle-system {
        display: none;
    }

    .morphing-blob {
        display: none;
    }
}

/* ============================================
   Accessibility: Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading-overlay {
        display: none;
    }

    .particle-system,
    .glow-orb,
    .shooting-star,
    .morphing-blob,
    .confetti-piece,
    .click-particle {
        display: none !important;
    }

    .kawaii-bot-wrapper {
        animation: none;
    }

    .floating-shape {
        opacity: 0.3;
        animation: none;
    }

    .geo-shape {
        animation: none;
    }

    .feature-card,
    .download-box {
        animation: none;
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */

@media (prefers-contrast: high) {
    .loading-overlay {
        background: #000;
    }

    .loading-text {
        color: #fff;
    }

    .ambient-particle,
    .glow-orb {
        display: none;
    }
}