/**
 * Medya İndirici — Elite Design System & Stylesheet
 * 
 * Standartlar:
 * - 01-modern-ui-design-expert
 * - 04-animation-interaction-specialist
 * - 05-video-based-ui-designer
 * - 08-design-system-architect
 */

/* ── 1. DESIGN TOKENS & VARIABLES ────────────────────────────── */
:root {
    /* Color Palette — Deep Space & Radiant Indigo/Violet */
    --bg-base: #090d16;
    --bg-surface: rgba(15, 23, 42, 0.65);
    --bg-surface-elevated: rgba(30, 41, 59, 0.75);
    --bg-surface-hover: rgba(51, 65, 85, 0.6);
    --bg-input: rgba(15, 23, 42, 0.75);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #090d16;

    /* Accents & Gradients */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --accent: #a855f7;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
    --gradient-text: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);

    /* Feedback */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(99, 102, 241, 0.6);

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing & Sizes */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px var(--primary-glow);

    /* Transitions & Easing */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 2. RESET & BASE STYLES ──────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 3. AMBIENT MESH GLOW BACKGROUND ─────────────────────────── */
.ambient-glow {
    position: fixed;
    border-radius: var(--radius-full);
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
    animation: floatGlow 12s infinite alternate ease-in-out;
}

.ambient-glow-1 {
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.05) 70%, transparent 100%);
}

.ambient-glow-2 {
    bottom: -100px;
    right: 10%;
    width: 450px;
    height: 350px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, transparent 70%);
}

@keyframes floatGlow {
    0%   { transform: translateX(-50%) translateY(0) scale(1); }
    100% { transform: translateX(-48%) translateY(30px) scale(1.08); }
}

/* ── 4. APP LAYOUT CONTAINER ─────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── 5. HEADER ───────────────────────────────────────────────── */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    animation: fadeInDown 500ms var(--ease-out-expo);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: transform 250ms var(--ease-spring);
}

.brand:hover .brand-icon {
    transform: scale(1.06) rotate(3deg);
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

/* ── 6. HERO & SEARCH BOX ────────────────────────────────────── */
.hero-section {
    text-align: center;
    margin-bottom: 2.2rem;
    animation: fadeInUp 600ms var(--ease-out-expo);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3.8vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin-bottom: 0.65rem;
}

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

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 1.75rem;
}

/* Floating Glowing Search/URL Input */
.url-input-container {
    display: flex;
    gap: 0.6rem;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: border-color 250ms var(--ease-smooth), box-shadow 250ms var(--ease-smooth);
}

.url-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow), var(--shadow-md);
}

.url-input-box {
    display: flex;
    align-items: center;
    flex: 1;
    padding-left: 0.75rem;
    gap: 0.5rem;
}

.url-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

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

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

.btn-paste {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 200ms var(--ease-smooth);
}

.btn-paste:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-fetch {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    flex-shrink: 0;
}

/* Platform Support Chips */
.platform-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.platform-chip {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 200ms var(--ease-smooth);
}

.platform-chip:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.chip-yt .chip-dot { background: #ef4444; }
.chip-ig .chip-dot { background: #ec4899; }
.chip-tt .chip-dot { background: #06b6d4; }
.chip-fb .chip-dot { background: #3b82f6; }

/* ── 7. VIDEO & MEDIA INFO CARD ──────────────────────────────── */
.video-info-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 400ms var(--ease-out-expo);
    margin-bottom: 2rem;
}

.video-preview-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 170px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface-elevated);
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 300ms var(--ease-smooth);
}

.video-thumbnail-wrapper:hover .video-thumbnail {
    transform: scale(1.05);
}

.platform-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-subtle);
    color: #fff;
}

.video-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    overflow: hidden;
}

.video-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-details {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Format Selection Tabs */
.format-selection {
    margin-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.25rem;
}

.format-tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.format-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    gap: 0.2rem;
}

.format-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 200ms var(--ease-smooth);
}

.format-tab:hover {
    color: var(--text-primary);
}

.format-tab.active {
    background: var(--bg-surface-elevated);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

/* Format Cards Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
}

.format-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 200ms var(--ease-smooth);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
}

.format-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    background: var(--bg-surface-hover);
}

.format-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 0 1px var(--primary), 0 4px 15px rgba(99, 102, 241, 0.2);
}

.format-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.format-resolution {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.format-ext {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.format-note {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.format-size {
    font-size: 0.7rem;
    font-weight: 500;
    color: #a5b4fc;
}

/* ── 8. PHOTO GALLERY GRID (COMPACT & MODERN) ────────────────── */
.photo-gallery-section {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.photo-zip-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient-glow);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-md);
    gap: 1rem;
}

.photo-zip-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.photo-zip-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.photo-zip-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.65rem;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.photo-grid::-webkit-scrollbar { width: 5px; }
.photo-grid::-webkit-scrollbar-track { background: transparent; }
.photo-grid::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
}
.photo-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.photo-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    transition: all 200ms var(--ease-smooth);
}

.photo-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.photo-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), 0 0 15px var(--primary-glow);
}

.photo-card-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 250ms var(--ease-smooth);
}

.photo-card:hover .photo-card-img {
    transform: scale(1.08);
}

.photo-card-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.photo-card-overlay-btn {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 22, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 200ms var(--ease-smooth);
    z-index: 3;
}

.photo-card:hover .photo-card-overlay-btn {
    opacity: 1;
}

.photo-card-overlay-btn .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

/* ── 9. INLINE PROGRESS & ACTION BUTTONS ─────────────────────── */
.download-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.inline-progress-wrap {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    animation: fadeIn 200ms var(--ease-smooth);
}

.inline-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inline-progress-status {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.inline-progress-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-progress-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: #a5b4fc;
    font-variant-numeric: tabular-nums;
}

.btn-cancel {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms var(--ease-smooth);
}

.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #f87171;
    color: #fff;
    transform: scale(1.02);
}

.inline-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.inline-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 200ms ease;
    position: relative;
}

.inline-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.6s infinite linear;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── 10. BUTTONS & INTERACTIVE ELEMENTS ──────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 200ms var(--ease-smooth);
    user-select: none;
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--border-focus);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 25px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-medium);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── 11. AUTH CARD (LOGIN) ───────────────────────────────────── */
.auth-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2.2rem;
    max-width: 420px;
    margin: 3rem auto;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 500ms var(--ease-out-expo);
}

.auth-lock-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 200ms var(--ease-smooth);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ── 12. ERROR BANNER & TOASTS ───────────────────────────────── */
.error-message {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fca5a5;
    font-size: 0.85rem;
    animation: shake 400ms var(--ease-smooth);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.error-close {
    background: transparent;
    border: none;
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 150ms;
}

.error-close:hover { opacity: 1; }

.error-banner {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fca5a5;
    font-size: 0.8rem;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-medium);
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: toastSlideIn 250ms var(--ease-spring);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--error); }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ── 13. FOOTER ──────────────────────────────────────────────── */
.app-footer {
    margin-top: auto;
    text-align: center;
    padding: 1.5rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── 14. ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ── 15. RESPONSIVE BREAKPOINTS ──────────────────────────────── */
@media (max-width: 640px) {
    .app-container {
        padding: 1rem 0.85rem 2rem;
    }

    .video-preview-row {
        flex-direction: column;
    }

    .video-thumbnail-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .url-input-container {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: 0.65rem;
    }

    .btn-fetch {
        width: 100%;
    }

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

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}