/* ============================================
   AnyDownload — Ultra-Modern Aurora UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* === Reset & Variables === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Aurora Color Palette */
    --bg-base: #030014;
    --surface-1: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.05);
    --surface-active: rgba(255, 255, 255, 0.1);
    
    --aurora-1: #00F0FF; /* Cyan */
    --aurora-2: #FF0055; /* Hot Pink */
    --aurora-3: #7000FF; /* Deep Purple */
    
    /* Text */
    --text-main: #FFFFFF;
    --text-muted: #8B949E;
    --text-dim: #484F58;

    /* Semantic */
    --success: #00FF9D;
    --error: #FF3366;
    
    /* Platform Brands */
    --brand-yt: #FF0000;
    --brand-tk: #00F2EA;
    --brand-pin: #E60023;
    --brand-cc: #FFFFFF;

    /* Metrics */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    /* Effects */
    --glass-blur: blur(20px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 40px rgba(0, 240, 255, 0.2);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.4);
    
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Aurora Background Animation === */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #150030 0%, var(--bg-base) 70%);
}

.blob {
    position: absolute;
    filter: blur(120px);
    opacity: 0.5;
    animation: drift 25s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--aurora-1);
    top: -20%;
    left: -10%;
    animation-duration: 20s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--aurora-2);
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: var(--aurora-3);
    top: 30%;
    left: 40%;
    animation-delay: -10s;
    animation-duration: 30s;
}

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

/* === Ambient Noise Overlay === */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-3));
    color: white;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-pills {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-pill);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
}

.nav-pill:hover {
    color: var(--text-main);
}

.nav-pill.active {
    color: var(--bg-base);
    background: var(--text-main);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

/* === Main Layout === */
.main-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding: 140px 24px 80px;
}

/* === Hero Section === */
.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface-1);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--aurora-1);
    margin-bottom: 24px;
    animation: fadeUp 0.8s ease backwards;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    animation: fadeUp 0.8s ease 0.1s backwards;
}

.gradient-text {
    background: linear-gradient(to right, var(--aurora-1), var(--aurora-2), var(--aurora-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto 40px;
    animation: fadeUp 0.8s ease 0.2s backwards;
}

/* === Universal Input === */
.input-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    animation: fadeUp 0.8s ease 0.3s backwards;
}

.input-glow {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--aurora-1), var(--aurora-3), var(--aurora-2));
    background-size: 200% center;
    opacity: 0;
    filter: blur(15px);
    transition: opacity 0.4s;
}

.input-container:focus-within .input-glow {
    opacity: 0.6;
    animation: shine 4s linear infinite;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-pill);
    padding: 8px 8px 8px 24px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.input-container:focus-within .input-wrapper {
    background: rgba(15, 15, 25, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.input-icon {
    color: var(--text-muted);
    transition: var(--transition);
}

.input-container:focus-within .input-icon {
    color: var(--aurora-1);
}

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

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

.fetch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--text-main);
    color: var(--bg-base);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.fetch-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

.fetch-btn:active {
    transform: scale(0.98);
}

/* === States === */
.loading-state, .error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--surface-1);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    animation: fadeUp 0.4s ease;
}

.error-state {
    background: rgba(255, 51, 102, 0.1);
    border-color: rgba(255, 51, 102, 0.2);
    color: var(--error);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--aurora-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Result Card === */
.result-section {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-card {
    background: rgba(15, 15, 20, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

/* Decorative inner glow for card */
.result-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--aurora-3);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    pointer-events: none;
}

.result-top {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    align-items: center;
}

.thumbnail-wrapper {
    position: relative;
    width: 240px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.result-card:hover .thumbnail-wrapper img {
    transform: scale(1.05);
}

.duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.platform-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    font-size: 1rem;
    font-family: monospace;
}

.video-meta {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-uploader {
    font-size: 1rem;
    color: var(--aurora-1);
    font-weight: 500;
    margin-bottom: 12px;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* === Quality Selection Grid === */
.format-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent);
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 32px;
}

.format-dropdown {
    width: 100%;
    appearance: none;
    background: var(--surface-1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 16px 48px 16px 20px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.format-dropdown:hover, .format-dropdown:focus {
    background: var(--surface-2);
    border-color: var(--aurora-1);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15), inset 0 2px 10px rgba(0,0,0,0.2);
}

.format-dropdown option {
    background: #0f0f14;
    color: var(--text-main);
    font-weight: 500;
    padding: 12px;
}

.select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aurora-1);
    pointer-events: none;
    transition: var(--transition);
}

.format-dropdown:focus + .select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--aurora-2);
}

/* === Download Button Container === */
.download-btn {
    width: 100%;
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, var(--aurora-3), var(--aurora-1));
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(112, 0, 255, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 240, 255, 0.4);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    animation: shine-sweep 3s infinite;
    z-index: 1;
}

@keyframes shine-sweep {
    0% { left: -100%; }
    20%, 100% { left: 200%; }
}

/* === Features Section === */
.features-section {
    position: relative;
    z-index: 5;
    padding: 40px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--surface-1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    background: var(--surface-2);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-icon-1 { color: var(--aurora-1); box-shadow: 0 0 20px rgba(0, 240, 255, 0.1); }
.feature-icon-2 { color: var(--success); box-shadow: 0 0 20px rgba(0, 255, 157, 0.1); }
.feature-icon-3 { color: var(--aurora-2); box-shadow: 0 0 20px rgba(255, 0, 85, 0.1); }

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* === Footer === */
.footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-size: 0.85rem;
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === Responsive Details === */
@media (max-width: 768px) {
    .navbar {
        width: 95%;
        padding: 8px 16px;
        flex-direction: column;
        gap: 16px;
        border-radius: var(--radius-lg);
    }
    
    .nav-brand { margin-top: 4px; }
    
    .nav-pills { width: 100%; justify-content: space-between; }
    .nav-pill { flex: 1; justify-content: center; padding: 10px 0; font-size: 0.8rem; }
    
    .hero { margin-bottom: 40px; }
    .hero-title { font-size: 2.5rem; }
    
    .input-wrapper {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: 8px;
        gap: 8px;
    }
    
    .input-icon { display: none; }
    
    #url-input {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
    
    .fetch-btn {
        width: 100%;
        justify-content: center;
    }
    
    .result-top { flex-direction: column; align-items: stretch; text-align: center; }
    .thumbnail-wrapper { width: 100%; max-width: 320px; margin: 0 auto; }
    .video-stats { justify-content: center; }
    
    .features-grid { grid-template-columns: 1fr; }
}
