:root {
    /* Color Palette - Premium Dark Mode */
    --bg-base: #0a0b10;
    --bg-surface: #13151f;
    --bg-surface-hover: #1c1f2e;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent-primary: #3b82f6;
    /* Blue */
    --accent-secondary: #8b5cf6;
    /* Purple */
    --success: #10b981;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(19, 21, 31, 0.7);

    /* Layout */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Transitions - Kept lightweight for mobile */
    --transition-fast: 150ms ease;
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Blobs for Visual Aesthetics without heavy animations */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    min-width: 300px;
    min-height: 300px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    min-width: 400px;
    min-height: 400px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.app-wrapper {
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    padding: 32px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

.logo svg {
    color: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding-top: 4vh;
}

/* Hero Section */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, #9ca3af 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.125rem);
    max-width: 600px;
    margin: 0 auto;
}

/* Action Card (Glassmorphism) */
.action-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: height var(--transition-smooth);
}

/* Form Styles */
.input-group {
    display: flex;
    gap: 12px;
    transition: var(--transition-smooth);
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

#url-input {
    width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 48px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

#url-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#url-input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.clear-btn:hover {
    color: var(--text-main);
}

.clear-btn.hidden {
    display: none;
}

.primary-btn {
    height: 56px;
    padding: 0 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    /* Prevent heavy repaints */
    will-change: transform;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: var(--radius-md);
    gap: 8px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Feature/Tab Content */
.tab-content {
    animation: fadeIn var(--transition-smooth);
}

.tab-content.hidden {
    display: none !important;
}

/* Theme Colors */
.dl-theme {
    background: linear-gradient(135deg, var(--accent-primary), #2563eb);
}

.dl-theme:hover {
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

.border-dl {
    border-color: var(--accent-primary) !important;
}

.bg-dl {
    background: linear-gradient(90deg, var(--accent-primary), #2563eb);
}

.dl-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Bypasser Theme (Purple/Emerald) */
.bp-theme {
    background: linear-gradient(135deg, var(--accent-secondary), #6d28d9);
}

.bp-theme:hover {
    box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.5);
}

.border-bp {
    border-color: var(--accent-secondary) !important;
    border-top-color: var(--accent-secondary) !important;
}

.bg-bp {
    background: linear-gradient(90deg, var(--accent-secondary), #6d28d9);
}

.bp-border {
    border-color: rgba(139, 92, 246, 0.3);
}

.bypass-title {
    background: linear-gradient(135deg, #fff 0%, var(--accent-secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Bypass Result Box */
.bypass-result-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    background: rgba(16, 185, 129, 0.05);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.bp-icon-success {
    color: var(--success);
    margin-bottom: 16px;
    background: rgba(16, 185, 129, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.bp-final-link {
    font-size: 1.125rem;
    color: var(--accent-primary);
    text-decoration: none;
    word-break: break-all;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.bp-final-link:hover {
    background: rgba(59, 130, 246, 0.2);
    text-decoration: underline;
}

/* Processing State */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-main {
    font-weight: 600;
    font-size: 1.125rem;
}

.status-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Result State */
.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.thumbnail-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.video-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 4px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-source {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Options Grid */
.options-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.option-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.option-card:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quality {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9375rem;
}

.format {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.download-icon {
    color: var(--accent-primary);
    opacity: 0.8;
}

.option-card:hover .download-icon {
    opacity: 1;
}

.audio-option {
    border-color: rgba(139, 92, 246, 0.3);
}

.audio-option .download-icon {
    color: var(--accent-secondary);
}

.secondary-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    height: 48px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 16px;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: transform var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.03);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.feature-item:nth-child(2) .feature-icon {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
}

.feature-item:nth-child(3) .feature-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.feature-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-item p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive - Mobile/Tablets */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .input-group {
        flex-direction: column;
    }

    .primary-btn {
        width: 100%;
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .action-card {
        padding: 20px 16px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
}