/* ============================================================
   SocialGrab — Purple Design System & Stylesheet
   ============================================================ */

:root {
  /* Color Palette - Elegant Deep Purple */
  --bg-base:               #090913;
  --bg-surface:            #121024;
  --bg-card:               rgba(20, 16, 42, 0.72);
  --bg-card-hover:         rgba(28, 22, 60, 0.85);
  --bg-card-active:        rgba(38, 30, 80, 0.95);
  --bg-input:              rgba(14, 12, 30, 0.85);
  
  /* Borders & Highlights */
  --border-subtle:         rgba(255, 255, 255, 0.08);
  --border-hover:          rgba(168, 85, 247, 0.25);
  --border-focus:          rgba(147, 51, 234, 0.65);
  --border-glow:           rgba(139, 92, 246, 0.3);
  --card-highlight:        inset 0 1px 0 0 rgba(255, 255, 255, 0.09);

  /* Primary Brand Purple */
  --primary:               #8b5cf6;
  --primary-hover:         #7c3aed;
  --primary-light:         #a78bfa;
  --primary-dark:          #6d28d9;
  --primary-glow:          rgba(139, 92, 246, 0.4);
  --primary-gradient:      linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a855f7 100%);
  --primary-gradient-hover:linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #9333ea 100%);

  /* Social Platform Accents */
  --yt-color:              #ff0033;
  --yt-gradient:           linear-gradient(135deg, #ff0033 0%, #cc0029 100%);
  --tiktok-color:          #00f2fe;
  --ig-gradient:           linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  --fb-color:              #1877f2;
  --fb-gradient:           linear-gradient(135deg, #1877f2 0%, #0d5fc2 100%);

  /* Typography Colors */
  --text-main:             #f8fafc;
  --text-muted:            #94a3b8;
  --text-dim:              #64748b;
  --text-subtle:           #475569;

  /* Functional Status */
  --danger:                #ef4444;
  --danger-bg:             rgba(239, 68, 68, 0.12);
  --danger-border:         rgba(239, 68, 68, 0.3);
  --success:               #10b981;
  --success-bg:            rgba(16, 185, 129, 0.12);
  --success-border:        rgba(16, 185, 129, 0.3);
  --info:                  #38bdf8;
  --info-bg:               rgba(56, 189, 248, 0.12);

  /* Radius System */
  --r-xs:                  6px;
  --r-sm:                  10px;
  --r-md:                  14px;
  --r-lg:                  20px;
  --r-xl:                  24px;
  --r-full:                9999px;

  /* Shadows */
  --shadow-sm:             0 2px 8px -2px rgba(0, 0, 0, 0.35);
  --shadow-md:             0 8px 24px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg:             0 20px 40px -12px rgba(0, 0, 0, 0.65);
  --shadow-glow:           0 0 30px -5px var(--primary-glow);

  /* Transitions */
  --ease-spring:           cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:           cubic-bezier(0.4, 0, 0.2, 1);
  --trans-fast:            0.15s var(--ease-smooth);
  --trans-normal:          0.25s var(--ease-smooth);
  --trans-spring:          0.35s var(--ease-spring);
}

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

html {
  font-size: 16px;
  color-scheme: dark;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(139, 92, 246, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(124, 58, 237, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, rgba(9, 9, 19, 0.85) 0%, var(--bg-base) 100%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 36px 20px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1140px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   Header & Brand Section
   ============================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 4px 2px;
}

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

.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--r-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  flex-shrink: 0;
}

.brand:hover .brand-icon {
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.55);
}

.brand-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

/* Supports with Icons Bar */
.supports-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 14, 38, 0.7);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px 6px 16px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
}

.supports-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  user-select: none;
}

.supports-icons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  border: 1px solid transparent;
}

.badge-yt      { background: rgba(255, 0, 51, 0.10); border-color: rgba(255, 0, 51, 0.28); }
.badge-tiktok  { background: rgba(0, 242, 254, 0.10); border-color: rgba(0, 242, 254, 0.28); }
.badge-ig      { background: rgba(225, 48, 108, 0.10); border-color: rgba(225, 48, 108, 0.28); }
.badge-threads { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.badge-x       { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.badge-fb      { background: rgba(24, 119, 242, 0.10); border-color: rgba(24, 119, 242, 0.28); }

/* ============================================================
   Input Card & Search Form
   ============================================================ */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg), var(--card-highlight);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.input-card:focus-within {
  border-color: rgba(147, 51, 234, 0.4);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 20px;
  width: 22px;
  height: 22px;
  color: var(--text-dim);
  pointer-events: none;
  transition: color var(--trans-fast);
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-light);
}

.url-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 18px 120px 18px 54px;
  color: var(--text-main);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: var(--trans-normal);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.url-input:hover {
  border-color: var(--border-hover);
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--border-glow), inset 0 2px 4px rgba(0, 0, 0, 0.3);
  background: rgba(18, 15, 38, 0.95);
}

.url-input::placeholder {
  color: var(--text-dim);
  font-size: 0.98rem;
}

.input-actions {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans-fast);
}

.btn-icon-subtle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

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

/* ============================================================
   YouTube Options Panel
   ============================================================ */
.yt-options-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  background: rgba(20, 16, 42, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.yt-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.yt-panel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.yt-row-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 95px;
}

.yt-btn-group {
  display: flex;
  flex-wrap: wrap;
  background: rgba(14, 12, 30, 0.9);
  padding: 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  gap: 6px;
}

.yt-opt-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--r-xs);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.yt-opt-btn:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.yt-opt-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.yt-opt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.badge-mini {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
}

.yt-opt-btn.active .badge-mini {
  background: rgba(0, 0, 0, 0.25);
}

/* ============================================================
   Action Row & Primary Run Button
   ============================================================ */
.control-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.btn-run {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 14px 48px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 24px var(--primary-glow);
  min-width: 170px;
}

.btn-run:hover:not(:disabled) {
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.55);
}

.btn-run:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ============================================================
   State Banners (Loading & Error)
   ============================================================ */
.error-banner {
  display: none;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--r-sm);
  color: #fca5a5;
  padding: 14px 18px;
  font-size: 0.92rem;
  align-items: center;
  gap: 12px;
}

.loading-banner {
  display: none;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.32);
  border-radius: var(--r-md);
  padding: 20px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.98rem;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ============================================================
   Post Preview & Media Grid Section
   ============================================================ */
.preview-section {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-lg), var(--card-highlight);
}

/* Post Header */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.platform-indicator {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.platform-indicator svg {
  display: block;
  flex-shrink: 0;
}

.platform-indicator.ig      { background: var(--ig-gradient); }
.platform-indicator.fb      { background: var(--fb-gradient); }
.platform-indicator.yt      { background: var(--yt-gradient); }
.platform-indicator.tiktok  { background: #000; border: 1.5px solid var(--tiktok-color); color: var(--tiktok-color); }
.platform-indicator.threads { background: #1e293b; border: 1.5px solid rgba(255, 255, 255, 0.25); }
.platform-indicator.x       { background: #000; border: 1.5px solid #475569; }

.post-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.post-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-author {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* ============================================================
   Action Toolbar
   ============================================================ */
.action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(18, 14, 38, 0.7);
  padding: 14px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
}

.selection-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  transition: color var(--trans-fast);
}

.checkbox-pill:hover {
  color: var(--text-main);
}

.checkbox-pill input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.selection-badge {
  background: rgba(139, 92, 246, 0.16);
  color: #ddd6fe;
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.batch-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--trans-fast);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--primary);
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: var(--trans-fast);
}

.btn-accent:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-secondary:disabled,
.btn-accent:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   Media Grid & Cards
   ============================================================ */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

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

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

.card-check-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: rgba(14, 12, 30, 0.85);
  border-radius: var(--r-xs);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.card-check-overlay:hover {
  background: rgba(14, 12, 30, 0.98);
}

.card-check-overlay input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  display: block;
  margin: 0;
}

.card-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #06050e;
  overflow: hidden;
  cursor: pointer;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.play-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0b0818;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.media-card:hover .play-icon-circle {
  background: #ffffff;
}

.type-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-full);
  letter-spacing: 0.6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.type-pill.photo {
  background: rgba(16, 185, 129, 0.88);
  color: #fff;
}

.type-pill.video {
  background: rgba(139, 92, 246, 0.88);
  color: #fff;
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.resolution-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.78rem;
}

.size-pill {
  background: rgba(139, 92, 246, 0.16);
  color: #ddd6fe;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-weight: 600;
  font-size: 0.78rem;
}

.card-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.btn-item-download {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--trans-fast);
  margin-top: auto;
  width: 100%;
}

.btn-item-download:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
}

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

.btn-item-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   Lightbox Modal
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 12, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  max-width: 960px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(20, 16, 42, 0.6);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.modal-item-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--r-full);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.modal-body {
  background: #04030a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  max-height: calc(92vh - 130px);
  overflow: hidden;
  position: relative;
}

.modal-body img,
.modal-body video {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(28, 22, 60, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--r-md);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.toast svg {
  color: var(--success);
  flex-shrink: 0;
}

/* ============================================================
   Keyframe Animations
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */
@media (max-width: 1024px) {
  .preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    padding: 24px 14px 60px;
  }
  .container {
    gap: 22px;
  }
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .input-card {
    padding: 20px;
  }
  .post-card {
    padding: 18px;
  }
  .action-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .batch-buttons {
    flex-direction: column;
    width: 100%;
  }
  .btn-secondary,
  .btn-accent {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand-title {
    font-size: 1.7rem;
  }
  .control-row {
    justify-content: stretch;
  }
  .btn-run {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .url-input {
    font-size: 0.95rem;
    padding-right: 90px;
  }
  .supports-wrapper {
    width: 100%;
    justify-content: space-between;
  }
}
