/* ═══════════════════════════════════════════════
   Vid2Audio — Design System & Global Styles
   ═══════════════════════════════════════════════ */

:root {
    --accent: #00e5c3;
    --accent-hover: #00c9a9;
    --accent-light: #5ff5d9;
    --accent2: #a78bfa;
    --bg: #080c14;
    --bg-card: #0d1220;
    --bg-input: #121a2b;
    --bg-hover: #1a2540;
    --border: #1e2a45;
    --border-focus: #00e5c3;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --text-dim: #8b929e;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.03em;
}

.text-muted, .text-dim {
    letter-spacing: 0.01em;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent2);
}

img { max-width: 100%; height: auto; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00c9a9);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 229, 195, 0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #00b89a);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 229, 195, 0.35);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
    color: #fff;
}

.btn-danger {
    background: var(--error);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 229, 195, 0.15);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.form-link {
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* ── Alerts ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 4px; }

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: #2a3a5a;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-free {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.badge-premium {
    background: rgba(0, 229, 195, 0.15);
    color: var(--accent-light);
}

/* ── Nav ── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(8, 12, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.nav-links a:hover {
    color: #fff;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background: var(--bg-hover);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(31, 41, 55, 0.3);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--bg-hover);
    color: #fff;
}

.pagination .active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .nav {
        padding: 12px 16px;
    }
    .nav-links {
        gap: 12px;
    }
    .card {
        padding: 20px;
    }
}

/* ── Mobile Navigation ── */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .nav-links,
    .landing-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        gap: 4px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
    .nav-links.open,
    .landing-nav-links.open {
        display: flex;
    }
    .nav-links li,
    .landing-nav-links li {
        list-style: none;
    }
    .nav-links a,
    .landing-nav-links a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        min-height: 44px;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
    }
    .nav-links a:hover,
    .landing-nav-links a:hover {
        background: var(--bg-hover);
    }
    .nav {
        position: relative;
    }
    .landing-nav {
        position: relative;
    }
}

/* ── Monospace for technical elements ── */
.drop-formats, .file-size, .file-name, #logOutput,
.progress-status, .badge, .plan-price, .price-amount,
.stat-value, code, pre {
    font-family: 'JetBrains Mono', monospace;
}

/* ── Accessibility ── */
.btn:focus-visible,
a:focus-visible,
.toggle-btn:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Entrance Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }
.animate-in:nth-child(4) { animation-delay: 0.3s; }
.animate-in:nth-child(5) { animation-delay: 0.4s; }
.animate-in:nth-child(6) { animation-delay: 0.5s; }

/* ── Site Footer (shared) ── */
.site-footer {
    text-align: center;
    padding: 48px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.82rem;
    position: relative;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 195, 0.25), transparent);
}
.site-footer a {
    color: var(--text-muted);
    margin: 0 10px;
}
.site-footer p + p {
    margin-top: 12px;
}
