:root {
    --primary: #FF0033;
    --primary-dark: #CC0029;
    --primary-glow: rgba(255, 0, 51, 0.3);
    --accent: #7C3AED;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    --bg: #0A0A0B;
    --bg-card: #111113;
    --bg-input: #1A1A1D;
    --surface: #18181B;
    --surface-hover: #27272A;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text: #FAFAFA;
    --text-muted: #A1A1AA;
    --text-dim: #71717A;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
}

[data-theme="light"] {
    --bg: #F4F4F5;
    --bg-card: #FFFFFF;
    --bg-input: #FAFAFA;
    --surface: #FFFFFF;
    --surface-hover: #F4F4F5;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --text: #18181B;
    --text-muted: #52525B;
    --text-dim: #71717A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 50px) scale(0.95);
    }

    75% {
        transform: translate(-50px, -20px) scale(1.02);
    }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: rotate(20deg);
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.hero h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Downloader Card */
.downloader-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Input */
.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    gap: 0.75rem;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-wrapper i {
    color: var(--text-dim);
    padding-left: 1rem;
    font-size: 1.1rem;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
    padding: 0.75rem 0;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-dim);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state {
    color: var(--error);
}

.error-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hidden {
    display: none !important;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-preview {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.thumbnail-wrapper {
    position: relative;
    width: 200px;
    min-width: 200px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.thumbnail-wrapper:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    color: white;
    font-size: 2rem;
}

.video-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Download Section */
.download-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.download-section .instruction {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    cursor: pointer;
}

.download-btn:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.download-btn i {
    font-size: 1.2rem;
}

.download-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: white;
}

.download-btn.primary:hover {
    box-shadow: 0 10px 30px var(--primary-glow);
}

.download-btn.accent {
    background: linear-gradient(135deg, var(--accent), #6D28D9);
    border-color: transparent;
    color: white;
}

.download-btn.accent:hover {
    box-shadow: 0 10px 30px var(--accent-glow);
}

/* How to Use */
.how-to-use {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
}

.how-to-use h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.how-to-use ol {
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.how-to-use li {
    margin-bottom: 0.3rem;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.feature {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.feature:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.feature i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.feature h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.feature p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.875rem;
}

footer p:first-child {
    color: var(--warning);
    margin-bottom: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .navbar {
        padding: 1rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .input-wrapper {
        flex-wrap: wrap;
    }

    .input-wrapper input {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .video-preview {
        flex-direction: column;
    }

    .thumbnail-wrapper {
        width: 100%;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }
}