/* ==========================================================================
   Design System & Tokens - Flashcards Video Repository
   สถาบันส่งเสริมการเรียนรู้ภาคเหนือ (สกร. ภาคเหนือ)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Primary & Accent Palettes */
  --primary-900: #0a1e36;
  --primary-800: #0f2c4f;
  --primary-700: #143e6d;
  --primary-600: #1b5391;
  --primary-500: #2563eb;
  --primary-400: #3b82f6;
  --primary-100: #dbeafe;
  --primary-50: #eff6ff;

  --accent-cyan: #0284c7;
  --accent-cyan-light: #e0f2fe;
  --accent-emerald: #059669;
  --accent-emerald-light: #d1fae5;
  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-purple: #7c3aed;
  --accent-purple-light: #ede9fe;
  --accent-rose: #e11d48;
  --accent-rose-light: #ffe4e6;

  /* Neutrals */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-light: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #475569;
  --text-white: #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-thai: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

body {
  font-family: var(--font-thai);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Smooth focus rings */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* ==========================================================================
   Header & Hero Section
   ========================================================================== */

.app-header {
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-800) 50%, #0d233d 100%);
  color: var(--text-white);
  padding: 2.5rem 1.5rem 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(2, 132, 199, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.brand-badge-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.app-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.app-subtitle {
  color: #94a3b8;
  font-size: 1.05rem;
  font-weight: 400;
  max-width: 800px;
  margin-bottom: 1.5rem;
}

/* Base URL Callout Box */
.base-url-bar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  backdrop-filter: blur(10px);
}

.base-url-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #cbd5e1;
  font-weight: 500;
}

.base-url-text {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.9rem;
}

.base-url-actions {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   Stats Overview Bar
   ========================================================================== */

.stats-container {
  max-width: 1360px;
  margin: -1.25rem auto 1.5rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-purple { background: #f5f3ff; color: #7c3aed; }
.icon-emerald { background: #ecfdf5; color: #059669; }
.icon-amber { background: #fffbeb; color: #d97706; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Main Content Container
   ========================================================================== */

.main-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 4rem;
}

/* ==========================================================================
   Controls Bar: Search, Filters, View Modes & Batch Tools
   ========================================================================== */

.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.8rem 0.75rem 2.75rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-thai);
  font-size: 0.95rem;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  display: none;
}

.clear-search-btn:hover {
  color: var(--text-main);
}

.tools-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Topic Filters Bar */
.topic-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-thai);
  text-decoration: none;
}

.filter-chip:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: var(--text-white);
  box-shadow: 0 2px 6px rgba(27, 83, 145, 0.25);
}

.chip-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-white);
}

/* Secondary Filter / Sort Row */
.filter-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.sub-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sub-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.type-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-thai);
}

.type-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.type-btn.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 600;
}

.view-mode-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.view-mode-btn {
  background: transparent;
  border: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  font-family: var(--font-thai);
}

.view-mode-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* ==========================================================================
   Buttons & Tool Components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-thai);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-600);
  color: var(--text-white);
  border-color: var(--primary-600);
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-outline-white {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-sub);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Result Header
   ========================================================================== */

.result-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-count-text {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-weight: 500;
}

.result-count-highlight {
  font-weight: 700;
  color: var(--primary-600);
}

/* ==========================================================================
   Grid View Layout (Video Cards)
   ========================================================================== */

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

/* Video Player Thumbnail Container */
.card-media-wrap {
  position: relative;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
}

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

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.card-media-wrap:hover .card-play-overlay {
  opacity: 1;
}

.play-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.2s ease, background 0.2s ease;
}

.card-media-wrap:hover .play-circle-btn {
  transform: scale(1);
}

.card-media-badge-group {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  z-index: 2;
}

.card-duration-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Card Content Area */
.card-content {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-code {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.card-topic-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-700);
  line-height: 1.35;
}

/* URL Box in Card */
.url-copy-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.url-copy-text {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
  user-select: all;
}

.url-copy-icon-btn {
  background: transparent;
  border: none;
  color: var(--primary-600);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.url-copy-icon-btn:hover {
  background: #e2e8f0;
  color: var(--primary-800);
}

/* Card Actions */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ==========================================================================
   Table / List View
   ========================================================================== */

.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.video-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.video-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.video-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.video-table tr:hover td {
  background: #f8fafc;
}

.table-code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

.table-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #334155;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  gap: 0.4rem;
  white-space: nowrap;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-main {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-supp {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f5d0fe;
}

.badge-ex {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-dark {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   Modal Player (HD Theater)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  width: 100%;
  max-width: 960px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  max-height: 90vh;
}

.modal-backdrop.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.modal-video-box {
  background: #000000;
  aspect-ratio: 16 / 9;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-video-box video {
  width: 100%;
  height: 100%;
  max-height: 520px;
  display: block;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.meta-item {
  background: #f8fafc;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.meta-item-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-item-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.15rem;
}

.modal-url-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.modal-url-input {
  flex: 1;
  font-family: var(--font-mono);
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  background: #f8fafc;
  color: #1e293b;
}

.modal-footer {
  padding: 0.85rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-playback-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speed-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
}

.speed-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
}

/* ==========================================================================
   Export & Batch Modal
   ========================================================================== */

.export-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.export-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.export-opt-card {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #ffffff;
}

.export-opt-card:hover {
  border-color: var(--primary-400);
  background: #eff6ff;
}

.export-opt-title {
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.export-opt-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.export-textarea {
  width: 100%;
  height: 180px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.75rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  resize: vertical;
  background: #f8fafc;
  color: #1e293b;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideInUp 0.25s ease forwards;
  border-left: 4px solid #10b981;
}

.toast.hide {
  animation: fadeOut 0.2s ease forwards;
}

.toast-icon {
  color: #10b981;
  font-size: 1.1rem;
}

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

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  background: #0a1727;
  color: #94a3b8;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.footer-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-title {
  color: #f8fafc;
  font-weight: 600;
  font-size: 1rem;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed #cbd5e1;
}

.empty-icon {
  font-size: 3rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 450px;
  margin: 0 auto 1.25rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .app-title {
    font-size: 1.6rem;
  }
  
  .stats-container {
    margin-top: -1rem;
  }

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

  .controls-panel {
    padding: 1rem;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-group {
    justify-content: space-between;
  }

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

  .modal-container {
    max-height: 95vh;
  }

  .modal-meta-grid {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}
