/* ===================================
   MediaGrab - Premium Video Downloader
   Dark Mode Glassmorphism Design
   =================================== */

:root {
    /* Color Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);

    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);

    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-accent: linear-gradient(135deg, #06b6d4, #3b82f6);
    --gradient-glow: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.5));

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.3);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.2;
}

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

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-blue);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 80px;
}

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

.title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Platform Switcher */
.platform-switcher {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    margin-bottom: 32px;
    backdrop-filter: blur(20px);
}

.platform-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.platform-btn svg {
    width: 18px;
    height: 18px;
}

.platform-btn:hover {
    color: var(--text-primary);
    background: var(--glass-hover);
}

.platform-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

/* URL Input */
.input-container {
    width: 100%;
    max-width: 700px;
    margin-bottom: 48px;
}

.input-wrapper {
    position: relative;
    padding: 3px;
    border-radius: var(--radius-lg);
}

.input-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    opacity: 0.6;
    filter: blur(8px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.input-wrapper:hover .input-glow,
.input-wrapper:focus-within .input-glow {
    opacity: 1;
    filter: blur(12px);
}

.input-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    z-index: 1;
}

.input-icon {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
}

.url-input::placeholder {
    color: var(--text-tertiary);
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

.download-btn:active {
    transform: translateY(0);
}

/* Options Section */
.options-section {
    width: 100%;
    max-width: 800px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.options-section.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.options-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

/* Option Cards */
.option-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.option-card:hover {
    background: var(--glass-hover);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.card-icon.audio {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-badge.audio {
    color: var(--accent-pink);
}

/* Quality Options */
.quality-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quality-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.quality-btn:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
}

.quality-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}

.quality-btn.audio.active {
    background: rgba(236, 72, 153, 0.15);
    border-color: var(--accent-pink);
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.2);
}

.quality-btn.premium {
    position: relative;
    overflow: hidden;
}

.quality-btn.premium::before {
    content: 'PRO';
    position: absolute;
    top: 4px;
    right: -12px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 16px;
    background: var(--gradient-primary);
    color: white;
    transform: rotate(45deg);
}

.quality-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quality-detail {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Progress Section */
.progress-section {
    display: none;
    padding: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
}

.progress-section.visible {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-percent {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
}

/* Features Section */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 80px;
    width: 100%;
    max-width: 900px;
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: var(--glass-hover);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

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

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.footer p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .platform-switcher {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: var(--radius-lg);
    }

    .platform-btn span {
        display: none;
    }

    .platform-btn {
        padding: 12px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .features-section {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .input-inner {
        flex-direction: column;
        padding: 16px;
    }

    .url-input {
        width: 100%;
        text-align: center;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

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

.loading .download-btn {
    animation: pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-hover);
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}
