/* ============================================================
   SaveTube Mini App — Premium Visual Redesign
   Tema oscuro relajante · Glassmorphism · Orbes flotantes
   ============================================================ */

/* --- Variables y Reset --- */
:root {
    /* Forzamos tema oscuro relajante independiente de Telegram */
    --bg-deep: #080b16;
    --bg-main: #0d1117;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;

    /* Palette relajante — azul profundo + lavanda + teal */
    --accent-primary: #7c6cf0;
    --accent-secondary: #58a6ff;
    --accent-teal: #3dc9b0;
    --accent-lavender: #b48eff;
    --accent-rose: #f778ba;

    /* Gradientes */
    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-teal: linear-gradient(135deg, #3dc9b0 0%, #58a6ff 100%);
    --gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-premium: linear-gradient(135deg, #f9d423 0%, #ff4e50 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-active: rgba(124, 108, 240, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Tokens de diseño */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-full: 999px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ============================================================
   BACKGROUND DECORATIONS — Orbes flotantes
   ============================================================ */
.bg-decorations {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #667eea, transparent 70%);
    top: -80px;
    right: -60px;
    animation: floatOrb1 12s ease-in-out infinite;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #3dc9b0, transparent 70%);
    bottom: 20%;
    left: -80px;
    animation: floatOrb2 15s ease-in-out infinite;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #f778ba, transparent 70%);
    top: 40%;
    right: -40px;
    animation: floatOrb3 18s ease-in-out infinite;
    opacity: 0.2;
}

.orb-4 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #b48eff, transparent 70%);
    bottom: -40px;
    left: 30%;
    animation: floatOrb1 20s ease-in-out infinite reverse;
    opacity: 0.2;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 30px) scale(1.05); }
    66% { transform: translate(20px, -25px) scale(0.9); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -20px); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(124, 108, 240, 0.15); }
    50% { box-shadow: 0 0 35px rgba(124, 108, 240, 0.3); }
}

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

/* ============================================================
   ANIMACIONES MEJORADAS - Micro-interacciones
   ============================================================ */

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    pointer-events: none;
    animation: ripple 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button Hover Glow */
.format-btn,
.quality-btn,
.btn-download,
.btn-primary,
.btn-upsell {
    position: relative;
    overflow: hidden;
}

.format-btn::before,
.quality-btn::before,
.btn-download::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.format-btn:hover::before,
.quality-btn:hover::before,
.btn-download:hover::before,
.btn-primary:hover::before {
    width: 300px;
    height: 300px;
    opacity: 1;
}

/* Card Lift Effect */
.plan-card,
.done-card,
.upsell-content {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card:hover,
.done-card:hover,
.upsell-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(124, 108, 240, 0.15);
}

/* Input Focus Animation */
#url-input {
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease,
                transform 0.2s ease;
}

#url-input:focus {
    transform: scale(1.01);
}

#url-input::placeholder {
    transition: opacity 0.3s ease,
                transform 0.3s ease;
}

#url-input:focus::placeholder {
    opacity: 0.5;
    transform: translateY(-2px);
}

/* Badge Pulse Animation */
.user-badge .badge-dot {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Platform Badge Entrance Animation */
.platform-badge {
    animation: slideInLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Button Press Effect */
.format-btn:active,
.quality-btn:active,
.btn-download:active,
.btn-primary:active,
.btn-upsell:active {
    transform: scale(0.92) !important;
    transition: transform 0.1s ease;
}

/* Success Celebration Animation */
@keyframes successCelebration {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.done-icon {
    animation: successCelebration 0.6s ease-in-out;
}

/* Loading Dots Animation */
@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-dots span {
    display: inline-block;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Progress Bar Glow */
.progress-bar {
    box-shadow: 0 0 20px rgba(124, 108, 240, 0.3);
    transition: box-shadow 0.3s ease;
}

.progress-bar:hover {
    box-shadow: 0 0 30px rgba(124, 108, 240, 0.5);
}

/* Quality Badge Hover */
.quality-btn:hover .q-icon {
    transform: scale(1.2) rotate(10deg);
    transition: transform 0.3s ease;
}

/* Format Selection Animation */
.format-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.format-btn.active {
    animation: formatSelected 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes formatSelected {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: flex;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(8, 11, 22, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-glow {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    border-radius: var(--radius-sm);
    animation: pulse 3s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.logo-icon {
    font-size: 20px;
}

.header-logo h1 {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #e6edf3, #b48eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-teal);
    animation: pulse 2s infinite;
}

.user-badge.premium {
    background: var(--gradient-premium);
    border: none;
    color: #1a1a2e;
}

.user-badge.premium .badge-dot {
    background: #1a1a2e;
}

.btn-back {
    background: none;
    border: none;
    color: var(--accent-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 0;
    transition: var(--transition-fast);
}

.btn-back:active {
    opacity: 0.7;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.main-content.centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    text-align: center;
    margin-bottom: 24px;
    animation: slideUp 0.5s ease;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-weight: 500;
}

.platform-icons-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.mini-platform {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    font-size: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mini-platform:hover {
    transform: translateY(-2px);
    border-color: var(--glass-border-active);
}

.mini-platform-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mini-platform:hover .mini-platform-icon {
    transform: scale(1.1);
}

.mini-platform:hover .mini-platform-icon.yt { color: #FF0000; }
.mini-platform:hover .mini-platform-icon.ig { color: #E1306C; }
.mini-platform:hover .mini-platform-icon.tt { 
    color: var(--text-primary); 
    filter: drop-shadow(1px 1px 0px rgba(255, 0, 80, 0.8)) drop-shadow(-1px -1px 0px rgba(0, 242, 254, 0.8)); 
}
.mini-platform:hover .mini-platform-icon.tw { color: #1DA1F2; }
.mini-platform:hover .mini-platform-icon.fb { color: #1877F2; }

/* ============================================================
   INPUT SECTION
   ============================================================ */
.url-error-message {
    display: none;
    color: var(--accent-rose);
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(247, 120, 186, 0.1);
    border: 1px solid rgba(247, 120, 186, 0.3);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-shake {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
.input-section {
    margin-bottom: 20px;
    animation: slideUp 0.6s ease;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 4px;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(124, 108, 240, 0.1), 0 0 30px rgba(124, 108, 240, 0.08);
}

.input-icon {
    padding: 12px 14px;
    font-size: 18px;
    color: var(--text-muted);
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    padding: 14px 4px;
    font-weight: 500;
}

#url-input::placeholder {
    color: var(--text-muted);
}

.btn-paste {
    background: rgba(124, 108, 240, 0.12);
    border: 1px solid rgba(124, 108, 240, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-bounce);
    margin-right: 4px;
}

.btn-paste:active {
    transform: scale(0.88);
}

/* ============================================================
   PLATFORM BADGE
   ============================================================ */
.platform-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--gradient-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    animation: slideUp 0.35s ease;
    backdrop-filter: blur(12px);
}

.platform-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 108, 240, 0.15);
    border-radius: var(--radius-sm);
}

.platform-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.platform-check {
    color: var(--accent-teal);
    font-size: 20px;
    font-weight: bold;
}

/* ============================================================
   FORMAT BUTTONS
   ============================================================ */
.format-section, .quality-section {
    margin-bottom: 20px;
    animation: slideUp 0.4s ease;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.format-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    backdrop-filter: blur(8px);
}

.format-btn.active {
    background: var(--gradient-main);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.format-btn:active {
    transform: scale(0.94);
}

.format-icon {
    font-size: 20px;
}

/* ============================================================
   QUALITY GRID
   ============================================================ */
.quality-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.quality-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px;
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    backdrop-filter: blur(8px);
}

.quality-btn.active {
    background: var(--gradient-main);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.quality-btn:active {
    transform: scale(0.92);
}

.quality-btn.locked {
    opacity: 0.4;
    position: relative;
}

.quality-btn.locked::after {
    content: '🔒';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
}

.q-icon {
    font-size: 22px;
}

.q-label {
    font-size: 12px;
    font-weight: 700;
}

/* ============================================================
   DOWNLOAD BUTTON
   ============================================================ */
.download-section {
    margin-top: 8px;
    margin-bottom: 20px;
    animation: slideUp 0.5s ease;
}

.btn-download {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    background: var(--gradient-main);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    letter-spacing: 0.3px;
}

.btn-download:active {
    transform: scale(0.96);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-download-icon {
    font-size: 20px;
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    animation: slideUp 0.5s ease;
    backdrop-filter: blur(8px);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.stat-icon {
    font-size: 16px;
}

#stat-downloads {
    font-weight: 700;
    color: var(--accent-teal);
}

.stat-label {
    color: var(--text-muted);
}

/* ============================================================
   UPSELL BANNER
   ============================================================ */
.upsell-banner {
    margin-bottom: 16px;
    animation: slideUp 0.6s ease;
}

.upsell-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(249, 212, 35, 0.08), rgba(255, 78, 80, 0.06));
    border: 1px solid rgba(249, 212, 35, 0.15);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
}

.upsell-icon {
    font-size: 28px;
}

.upsell-text {
    flex: 1;
}

.upsell-text strong {
    font-size: 14px;
    display: block;
    color: #f9d423;
    font-weight: 700;
}

.upsell-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.btn-upsell {
    padding: 8px 18px;
    background: var(--gradient-premium);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 12px rgba(249, 212, 35, 0.2);
}

.btn-upsell:active {
    transform: scale(0.93);
}

/* ============================================================
   AD BANNER — Reward Ad fijo inferior
   ============================================================ */
.ad-banner-slot {
    padding: 10px 20px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: rgba(8, 11, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.reward-ad-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(180, 142, 255, 0.08));
    border: 1.5px solid rgba(124, 108, 240, 0.25);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    animation: rewardPulse 4s ease-in-out infinite;
}

.reward-ad-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.reward-ad-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reward-ad-icon {
    font-size: 22px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.reward-ad-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.reward-ad-text strong {
    font-size: 14px;
    font-weight: 700;
}

.reward-ad-text span {
    font-size: 12px;
    color: var(--accent-teal);
    font-weight: 600;
}

.reward-ad-badge {
    padding: 8px 16px;
    background: var(--gradient-main);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

@keyframes rewardPulse {
    0%, 100% { border-color: rgba(124, 108, 240, 0.25); }
    50% { border-color: rgba(124, 108, 240, 0.5); }
}

.ad-placeholder-large {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 12px;
    min-height: 250px;
}

/* ============================================================
   INTERSTITIAL
   ============================================================ */
.interstitial-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.interstitial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.interstitial-ad {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.interstitial-footer {
    text-align: center;
    padding: 16px 0;
}

.interstitial-timer {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.btn-skip {
    padding: 14px 36px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    animation: bounceIn 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.interstitial-upsell {
    text-align: center;
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.interstitial-upsell a {
    color: #f9d423;
    font-weight: 600;
    text-decoration: none;
}

/* ============================================================
   PROGRESS SCREEN
   ============================================================ */
.progress-container {
    text-align: center;
    width: 100%;
    max-width: 340px;
}

.progress-icon-wrapper {
    margin-bottom: 28px;
}

.progress-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    animation: spin 1.5s linear infinite;
    box-shadow: 0 0 30px rgba(124, 108, 240, 0.15);
}

.spinner-emoji {
    font-size: 36px;
    animation: spin 1.5s linear infinite reverse;
}

.progress-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.progress-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: var(--glass-bg);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.progress-percent {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-primary);
}

.progress-details {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-icon {
    font-size: 16px;
}

.detail-value {
    font-weight: 500;
}

/* ============================================================
   DONE SCREEN
   ============================================================ */
.done-container {
    text-align: center;
    width: 100%;
    max-width: 340px;
}

.done-icon-wrapper {
    margin-bottom: 16px;
}

.done-icon {
    font-size: 72px;
    animation: bounceIn 0.5s ease;
}

.done-title {
    font-size: 32px;
    font-weight: 900;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.done-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.done-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.done-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.done-file-title {
    font-weight: 600;
    font-size: 15px;
}

.done-file-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.done-actions {
    margin-bottom: 24px;
}

.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-main);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: scale(0.96);
}

/* ============================================================
   DONATION PROMPT
   ============================================================ */
.donation-prompt {
    padding: 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
}

.donation-prompt p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-donate {
    padding: 12px 28px;
    background: var(--gradient-premium);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 15px rgba(249, 212, 35, 0.2);
}

.btn-donate:active {
    transform: scale(0.93);
}

/* ============================================================
   ERROR SCREEN
   ============================================================ */
.error-container {
    text-align: center;
    max-width: 300px;
}

.error-icon {
    font-size: 72px;
    display: block;
    margin-bottom: 16px;
}

.error-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
}

.error-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ============================================================
   SUBSCRIBE SCREEN
   ============================================================ */
.plans-container {
    max-width: 360px;
    margin: 0 auto;
}

.plans-title {
    font-size: 26px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.plan-card {
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(12px);
}

.plan-card.featured {
    border-color: rgba(124, 108, 240, 0.4);
    box-shadow: 0 0 40px rgba(124, 108, 240, 0.1);
    animation: glowPulse 4s ease-in-out infinite;
}

.plan-ribbon {
    position: absolute;
    top: 14px;
    right: -28px;
    background: var(--gradient-premium);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 36px;
    transform: rotate(45deg);
}

.plan-header-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.plan-emoji {
    font-size: 30px;
}

.plan-header-card h3 {
    font-size: 20px;
    font-weight: 800;
}

.plan-features {
    list-style: none;
    margin-bottom: 18px;
}

.plan-features li {
    padding: 7px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-price {
    font-size: 30px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 14px;
    color: var(--accent-primary);
    letter-spacing: -0.5px;
}

.plan-price small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-current {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.btn-subscribe {
    width: 100%;
    padding: 16px;
    background: var(--gradient-main);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.3);
}

.btn-subscribe:active {
    transform: scale(0.96);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden {
    display: none !important;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-height: 600px) {
    .hero-section {
        margin-bottom: 16px;
    }
    .hero-subtitle {
        margin-bottom: 8px;
    }
    .mini-platform {
        width: 32px;
        height: 32px;
    }
}

/* ============================================================
   ANIMACIONES MEJORADAS - Estilos Complementarios
   ============================================================ */

/* Input Focus State */
.input-wrapper.input-focused {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(124, 108, 240, 0.1),
                0 12px 40px rgba(124, 108, 240, 0.15);
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(57, 153, 142, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(57, 153, 142, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(57, 153, 142, 0);
    }
}

.success-animation {
    animation: successPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Error Animation */
@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px);
    }
    40% {
        transform: translateX(5px);
    }
    60% {
        transform: translateX(-3px);
    }
    80% {
        transform: translateX(3px);
    }
}

.error-animation {
    animation: errorShake 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-color: var(--accent-rose) !important;
}

/* Button Press Animation */
.button-pressed {
    transform: scale(0.9) !important;
    transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Entrance Animation */
@keyframes entranceSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entrance-animation {
    animation: entranceSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Floating Emoji Animation */
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }
}

.floating-emoji {
    pointer-events: none;
    user-select: none;
}

/* Hover Glow Enhanced */
.format-btn:hover,
.quality-btn:hover {
    background: var(--glass-card-hover);
    border-color: var(--glass-border-active);
    box-shadow: 0 4px 20px rgba(124, 108, 240, 0.1);
}

.format-btn.active:hover,
.quality-btn.active:hover {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* Quality Badge Enhanced */
.quality-btn.locked:hover {
    opacity: 0.6;
    cursor: not-allowed;
}

.quality-btn.locked:hover .q-icon {
    transform: scale(1.1) rotate(0deg);
}

/* Progress Bar Enhanced */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmerProgress 2s infinite;
}

@keyframes shimmerProgress {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Icon Hover Effects */
.platform-icon,
.q-icon,
.format-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quality-btn:hover .q-icon {
    transform: scale(1.3) rotate(10deg);
    color: var(--accent-primary);
}

.format-btn:hover .format-icon {
    transform: scale(1.2) rotate(-5deg);
}

/* Loading State Enhanced */
.progress-spinner {
    animation: spinGlow 1.5s linear infinite;
}

@keyframes spinGlow {
    0% {
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(124, 108, 240, 0.2);
    }
    100% {
        transform: rotate(360deg);
        box-shadow: 0 0 30px rgba(124, 108, 240, 0.4);
    }
}

/* Button Ripple Container Position */
.format-btn,
.quality-btn,
.btn-download,
.btn-primary,
.btn-upsell,
.btn-paste {
    position: relative;
    overflow: hidden;
}

/* Smooth State Transitions */
.screen {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.transitioning-out {
    opacity: 0;
    transform: translateX(-10px);
}

.screen.transitioning-in {
    opacity: 0;
    transform: translateX(10px);
}

/* Enhanced Badge Animations */
.user-badge.premium {
    animation: premiumGlow 2s ease-in-out infinite;
}

@keyframes premiumGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(249, 212, 35, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(249, 212, 35, 0.3);
    }
}

/* Done Screen Enhanced */
.done-icon-wrapper {
    animation: doneEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes doneEntrance {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Enhanced Card Interactions */
.plan-card,
.done-card,
.upsell-content {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.plan-card:active,
.done-card:active,
.upsell-content:active {
    transform: scale(0.98);
}
@media (max-height: 600px) {
    .hero-section {
        margin-bottom: 16px;
    }
    .hero-subtitle {
        margin-bottom: 8px;
    }
    .mini-platform {
        width: 32px;
        height: 32px;
    }
}
