/* ============================================================
   NuralClick — Premium Video Downloader UI
   Designer: Glassmorphism + Deep Space Dark Theme
   ============================================================ */

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

/* ── CSS Custom Properties ── */
:root {
  --bg-base: #050812;
  --bg-surface: #080e1f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  --accent-primary: #6c63ff;
  --accent-secondary: #a78bfa;
  --accent-pink: #f472b6;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --accent-orange: #fb923c;
  --accent-red: #f87171;
  --accent-yellow: #fbbf24;

  /* Platform colors */
  --youtube-color: #ff0000;
  --instagram-color: #e1306c;
  --tiktok-color: #69c9d0;
  --facebook-color: #1877f2;
  --snapchat-color: #fffc00;
  --twitter-color: #1da1f2;

  --text-primary: #f0f2ff;
  --text-secondary: #8892b0;
  --text-muted: #4a5568;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 4px 20px rgba(108, 99, 255, 0.4);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Animated Background ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6c63ff, #a78bfa);
  top: -200px; left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f472b6, #a78bfa);
  bottom: -150px; right: -150px;
  animation-delay: -4s;
}

.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #22d3ee, #6c63ff);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
}

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

/* ── Layout ── */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── Header / Nav ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 20px;
}

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

.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.5);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: 48px 0 40px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  font-size: 0.8rem;
  color: var(--accent-secondary);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  background: linear-gradient(135deg, #a78bfa, #f472b6, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* Platform icons row */
.platform-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.platform-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  cursor: default;
  backdrop-filter: blur(10px);
}

.platform-pill:hover {
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.platform-pill .icon { font-size: 1rem; }

/* ── Main Download Card ── */
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  margin-bottom: 28px;
  transition: border-color var(--transition-base);
  overflow: hidden;
}

.download-card:hover {
  border-color: var(--glass-border-hover);
}

/* URL Input Area */
.url-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.url-input-group {
  position: relative;
  flex: 1;
}

.url-input-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 52px 16px 20px;
  font-size: 0.98rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: all var(--transition-base);
  outline: none;
}

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

.url-input-group input:focus {
  border-color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.paste-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color var(--transition-fast);
  line-height: 1;
}

.paste-btn:hover { color: var(--accent-secondary); }

.platform-badge {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all var(--transition-base);
  animation: fadeSlideIn 0.25s ease;
}

.platform-badge.visible { display: flex; }

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

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

/* Platform badge colors */
.badge-youtube { border-color: rgba(255,0,0,0.3); color: #ff6b6b; }
.badge-instagram { border-color: rgba(225,48,108,0.3); color: #f472b6; }
.badge-tiktok { border-color: rgba(105,201,208,0.3); color: #67e8f9; }
.badge-facebook { border-color: rgba(24,119,242,0.3); color: #60a5fa; }
.badge-snapchat { border-color: rgba(255,252,0,0.3); color: #fbbf24; }
.badge-twitter { border-color: rgba(29,161,242,0.3); color: #38bdf8; }

/* ── Analyse Row ── */
.analyse-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-analyse {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  padding: 14px 28px;
  width: 100%;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-btn);
}

.fetching-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 24px 0;
  animation: fadeSlideIn 0.2s ease;
}

/* Warning banner */
.warning-banner {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #fcd34d;
  margin-bottom: 16px;
  animation: fadeSlideIn 0.25s ease;
}

/* ── Preview Card (Step 2) ── */
.preview-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
  animation: fadeUpIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.thumb-wrap {
  position: relative;
  width: 160px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--text-muted);
}

.thumb-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.video-meta { flex: 1; min-width: 0; }

.video-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-uploader {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.video-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 20px 0;
}

/* ── Options & Controls (Step 3) ── */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.option-icon {
  font-size: 1.1rem;
  opacity: 0.8;
}

/* Fixed Select styling - Force dark dropdown */
select.format-select {
  background-color: var(--bg-surface); /* Force dark background */
  color: var(--text-primary);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%238892b0' d='M7.293 10.707a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L8 8.586 5.707 6.293a1 1 0 00-1.414 1.414l3 3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 34px;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

select.format-select:hover {
    border-color: var(--glass-border-hover);
}

select.format-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

/* Style the dropdown options for supported browsers */
select.format-select option {
    background-color: #0d142b;
    color: #fff;
    padding: 10px;
}

/* Custom Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  position: relative;
  transition: background-color 0.3s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-track {
  background-color: var(--accent-green);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.toggle-label-text {
  display: none; /* Screen reader only or explicit layout */
}

/* Playlist preview items row */
.playlist-preview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.playlist-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

/* ── Main Download Button ── */
.btn-download-main {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  padding: 16px;
  font-size: 1.1rem;
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.3);
  margin-top: 20px;
}

.btn-download-main:hover {
    box-shadow: 0 12px 28px rgba(52, 211, 153, 0.4);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  padding: 14px 28px;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108, 99, 255, 0.55);
  filter: brightness(1.1);
}

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

.btn-secondary {
  background: var(--bg-card);
  border: 1.5px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 22px;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-ghost:hover { color: var(--text-primary); }

.btn-download-file {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #fff;
  padding: 12px 22px;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.4);
}

.btn-download-file:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-full { width: 100%; }

/* ── Progress Section ── */
.progress-section {
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: fadeSlideIn 0.3s ease;
  margin-bottom: 28px;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.progress-status-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pending { background: rgba(107,114,128,0.2); color: #9ca3af; }
.status-processing { background: rgba(108,99,255,0.2); color: var(--accent-secondary); }
.status-fetching_info { background: rgba(34,211,238,0.2); color: var(--accent-cyan); }
.status-completed { background: rgba(52,211,153,0.2); color: var(--accent-green); }
.status-failed { background: rgba(248,113,113,0.2); color: var(--accent-red); }

.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  height: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-cyan));
  background-size: 200% 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation: shimmer 2s linear infinite;
  position: relative;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.progress-bar-fill.completed {
  background: linear-gradient(90deg, var(--accent-green), #34d399);
  animation: none;
}

.progress-bar-fill.failed {
  background: linear-gradient(90deg, var(--accent-red), #f87171);
  animation: none;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-pct {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-secondary);
}

.progress-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-meta span { display: flex; align-items: center; gap: 4px; }

.progress-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.error-detail {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: #fca5a5;
  margin-top: 12px;
  word-break: break-all;
}

/* ── History Section ── */
.history-section { margin-top: 8px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all var(--transition-base);
  animation: fadeSlideIn 0.3s ease;
}

.history-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.history-thumb {
  width: 64px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.history-thumb-placeholder {
  width: 64px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.history-info { flex: 1; min-width: 0; }

.history-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.history-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-actions { display: flex; gap: 8px; align-items: center; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-completed { background: var(--accent-green); }
.dot-processing { background: var(--accent-primary); animation: pulse-dot 1.5s infinite; }
.dot-pending { background: var(--text-muted); }
.dot-failed { background: var(--accent-red); }

.history-dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--accent-green);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-size: 1rem;
}

.history-dl-btn:hover {
  background: rgba(52, 211, 153, 0.25);
  transform: scale(1.08);
}

.history-dl-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.platform-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-youtube { background: rgba(255,0,0,0.15); color: #f87171; }
.tag-instagram { background: rgba(225,48,108,0.15); color: #f472b6; }
.tag-tiktok { background: rgba(105,201,208,0.15); color: #67e8f9; }
.tag-facebook { background: rgba(24,119,242,0.15); color: #60a5fa; }
.tag-snapchat { background: rgba(255,252,0,0.15); color: #fbbf24; }
.tag-twitter { background: rgba(29,161,242,0.15); color: #38bdf8; }
.tag-unknown { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ── Loading Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Toast notification ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.toast-success {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.toast-error {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.toast-info {
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.4);
  color: var(--accent-secondary);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Scroll bar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .download-card { padding: 20px; }
  .url-input-wrap { flex-direction: column; align-items: stretch; }
  .platform-badge { width: 100%; justify-content: center; }
  
  .info-row { flex-direction: column; }
  .thumb-wrap { width: 100%; height: auto; aspect-ratio: 16/9; }
  
  .option-item { flex-direction: column; align-items: flex-start; gap: 12px; }
  select.format-select { width: 100%; }

  .progress-meta { flex-direction: column; gap: 4px; }
  .history-item { flex-wrap: wrap; }
  .history-actions { width: 100%; justify-content: flex-end; }
  header { flex-direction: column; gap: 14px; align-items: flex-start; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.8rem; }
  .platform-icons { gap: 8px; }
  .platform-pill { padding: 5px 10px; font-size: 0.75rem; }
}
