/* 
 * main.css — The Unified Design System for yt-dlp.app
 * Philosophy: Precision, Depth, and High-Impact Visuals.
 */

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

:root {
    /* Colors — Deep Obsidian & Electric Accents */
    --bg-dark: #050505;
    --bg-card: rgba(18, 18, 22, 0.7);
    --bg-elevated: #111114;
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-hover: rgba(255, 255, 255, 0.06);

    --accent-primary: #6366F1;
    --accent-secondary: #A855F7;
    --accent-glow: rgba(99, 102, 241, 0.15);

    --success: #22C55E;
    --error: #EF4444;
    --warning: #F59E0B;

    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-muted: #52525B;
    --text-dim: #D1D1D6;

    --border-main: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.05);

    /* Typography */
    --font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    --h1-size: clamp(2.5rem, 5.5vw, 3.75rem);
    --h2-size: clamp(1.875rem, 4vw, 3rem);
    --h3-size: clamp(1.25rem, 2.5vw, 1.75rem);
    --body-lg: 1.125rem;
    --body-md: 1rem;
    --body-sm: 0.9375rem;
    --ls-tight: -0.03em;
    --ls-heading: -0.02em;
    --lh-heading: 1.15;
    --lh-body: 1.75;

    /* Layout */
    --header-height: 72px;
    --container-width: 1200px;
    --space-hero: clamp(5rem, 10vw, 8rem);
    --space-section: clamp(5rem, 10vw, 9rem);

    /* Effects */
    --glass-blur: blur(24px);
    --radius-lg: 24px;
    --radius-full: 999px;
    --transition-smooth: 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

/* --- Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: var(--lh-body);
    font-size: var(--body-md);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

main {
    padding-top: var(--header-height);
}

/* --- Glassmorphism Utilities --- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 2.5rem;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* --- Utilities --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }


@media (min-width: 768px) {
    .container {
        padding: 0 2.5rem;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 0 2rem;
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.emoji-safe {
    -webkit-text-fill-color: initial !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: initial !important;
    display: inline-block !important;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif !important;
}

/* --- Grid System --- */
.grid-columns {
    display: grid;
    gap: 2.5rem;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 992px) {

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: var(--transition-smooth);
    cursor: pointer;
    text-decoration: none;
    font-size: var(--body-sm);
    border: 1px solid transparent;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.btn--primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    box-shadow: 0 0 40px var(--accent-glow);
}

.btn--primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.3);
}

.btn--outline {
    border-color: var(--border-main);
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: var(--glass-blur);
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
        width: 100%;
        max-width: 320px;
    }
}

/* --- Layout Components --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-main);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav__logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: var(--ls-tight);
    color: #fff;
    text-decoration: none;
}

.nav__links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
}

@media (max-width: 768px) {
    .nav__toggle {
        display: block;
    }

    .nav__links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-elevated);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: var(--transition-smooth);
        z-index: 1050;
        padding: 2rem;
        backdrop-filter: var(--glass-blur);
        border-left: 1px solid var(--border-glass);
    }

    .nav__logo {
        font-size: 1.25rem;
    }
}

.nav__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
    letter-spacing: 0.005em;
}

.nav__link:hover {
    color: #fff;
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mobile Nav Trigger (Checkbox Hack) --- */
#nav-toggle {
    display: none;
}

#nav-toggle:checked~.nav .nav__links {
    right: 0;
}

#nav-toggle:checked~.nav .nav__toggle [data-lucide="menu"] {
    display: none;
}

#nav-toggle:checked~.nav .nav__toggle::after {
    content: "✕";
    font-size: 1.5rem;
    font-weight: 800;
}

/* --- Hero Section Responsive --- */
.hero-section {
    padding-top: 1.5rem;
    padding-bottom: var(--space-hero);
    text-align: center;
    position: relative;
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 2rem;
        padding-bottom: clamp(3rem, 8vw, 5rem);
    }
}

@media (min-width: 768px) {
    .hero-section {
        padding-top: 4rem;
    }
}

/* --- Footer Refinements --- */
.footer-grid {
    display: grid;
    gap: 3.5rem;
    grid-template-columns: 1fr;
    margin-bottom: 4rem;
}

@media (min-width: 992px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2.5rem;
    }
}

.footer-bottom {
    padding-top: 3rem;
    border-top: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

/* --- Additional Components --- */
.os-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 1.5rem;
}

.os-icon svg {
    width: 28px;
    height: 28px;
    display: block;
    flex-shrink: 0;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    height: 100%;
}

.faq-item h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: var(--lh-body);
    font-size: var(--body-sm);
}

/* --- Interactive FAQ Accordion --- */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-card {
    padding: 2rem;
    cursor: pointer;
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

.faq-answer {
    margin-top: 1.25rem;
    color: var(--text-secondary);
    line-height: var(--lh-body);
    font-size: var(--body-sm);
    display: none;
}

.faq-card.active .faq-answer {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-card.active .faq-icon {
    transform: rotate(180deg);
}

/* --- Homepage Visual Fixes --- */
.hero-section {
    padding-bottom: 48px;
}

.hero-h1 {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    margin-bottom: 28px;
}

.hero-section .btn-outline,
.hero-section .btn.btn-outline {
    border-color: rgba(255,255,255,0.4);
    color: #a1a1aa;
}

.hero-section .btn-outline:hover,
.hero-section .btn.btn-outline:hover {
    border-color: rgba(255,255,255,0.26);
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 48px 0 16px;
}

.stats-row .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 48px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.stat-value {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim, #3f3f46);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 600px) {
    .stats-row { flex-direction: column; gap: 28px; }
    .stat-divider { width: 40px; height: 1px; }
    .stats-row .stat-item { padding: 0; }
}

.core-promise-section {
    text-align: center;
}

.core-promise-section p {
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.core-promise-section h2 {
    margin-left: auto;
    margin-right: auto;
}

.feature-card [class*="icon"] {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.feature-card.highlight-card [class*="icon"] {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.25);
}

.cta-platform-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-muted, #52525b);
    font-weight: 600;
}

.cta-platform-badges span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cta-platform-badges svg {
    opacity: 0.8;
    width: 20px;
    height: 20px;
}