/* ==========================================================================
   SaveTube Pro — Ultra-Modern Responsive Stylesheet
   Theme: Studio Dark (Default) & Studio Light
   Version: 2.6 Ultra
   ========================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - Dark Mode Default */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --bg-input: rgba(15, 23, 42, 0.9);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Base Reset & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.mono {
  font-family: var(--font-mono);
}

/* Background Effects */
.bg-gradient-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-grid-pattern {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

body.light-theme .bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Gradient Text & Badges */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 13, 22, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.85);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge-version {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
  user-select: none;
}

.nav-btn svg {
  flex-shrink: 0;
}

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

.nav-btn.active {
  background: var(--accent-primary);
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.nav-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  transition: var(--transition);
  line-height: 1;
}

.nav-btn.active .nav-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
}

body.dark-theme .sun-icon { display: block; }
body.dark-theme .moon-icon { display: none; }
body.light-theme .sun-icon { display: none; }
body.light-theme .moon-icon { display: block; }

/* Main Container */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  position: relative;
  z-index: 10;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

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

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 36px;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 16px;
}

.badge-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 32px;
}

/* Input Card & Form */
.input-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.input-card:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 10px 6px 16px;
}

.input-icon {
  color: var(--accent-primary);
  display: flex;
  align-items: center;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-primary);
}

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

.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient-brand);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary.loading .btn-text {
  visibility: hidden;
}

.btn-spinner {
  display: none;
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.loading .btn-spinner {
  display: block;
}

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

/* Sample Chips Row */
.sample-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 4px 8px;
}

.sample-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.sample-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
}

/* Loading Card & Shimmer */
.loading-card {
  max-width: 820px;
  margin: 24px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.skeleton-shimmer {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.skeleton-thumb {
  width: 200px;
  height: 112px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  animation: pulse 1.5s infinite;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.skeleton-line {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  animation: pulse 1.5s infinite;
}

.skeleton-line.title { height: 24px; width: 80%; }
.skeleton-line.subtitle { height: 16px; width: 50%; }
.skeleton-line.pill { height: 14px; width: 30%; }

.loading-text {
  font-size: 0.88rem;
  color: var(--accent-cyan);
  text-align: center;
  font-weight: 500;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}

/* Inspected Media Card */
.media-card {
  max-width: 980px;
  margin: 32px auto 0;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.media-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.media-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

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

.thumb-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
}

.media-thumb-container:hover .thumb-play-overlay {
  opacity: 1;
}

.media-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.media-quality-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--gradient-brand);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.media-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.media-tags-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.tag-pill.accent {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.media-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.media-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.author-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

.author-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.verified-badge {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.media-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* In-Browser Stream Player */
.inline-player-container {
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
}

.player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Format Tabs Header */
.format-tabs-wrapper {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.format-tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
}

/* Tab Panes */
.tab-pane {
  display: none;
  padding-top: 20px;
}

.tab-pane.active {
  display: block;
}

/* Smart Video Size Optimizer Card */
.optimizer-card {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.optimizer-card:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

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

.optimizer-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
}

.optimizer-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.optimizer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.optimizer-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.45;
}

.optimizer-desc strong {
  color: var(--accent-emerald);
}

.compression-controls-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

.compression-buttons-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.comp-btn {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.comp-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.comp-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
}

.comp-btn-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.comp-btn.active .comp-btn-title {
  color: var(--accent-emerald);
}

.comp-btn-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.compression-settings-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.compression-settings-row .setting-item {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compression-settings-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Dynamic Format Size Presentation */
.size-cell-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.size-original {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.8;
}

.size-optimized {
  font-weight: 800;
  color: var(--accent-emerald);
}

.badge-saving {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.text-emerald {
  color: var(--accent-emerald);
}

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

.toolbar-info .info-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toolbar-info .info-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.container-selector, .embed-art-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-select, .form-input, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

/* Switch Component - Fully visible in both Day (Light) and Night (Dark) mode */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch-label input { display: none; }

.switch-slider {
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border: 1.5px solid #94a3b8;
  border-radius: var(--radius-full);
  position: relative;
  transition: all 0.25s ease;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-theme .switch-slider {
  background: #334155;
  border-color: #64748b;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  top: 2.5px;
  left: 3px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-label input:checked + .switch-slider {
  background: #10b981;
  border-color: #059669;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.switch-label input:checked + .switch-slider::before {
  transform: translateX(19px);
}

.switch-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Light Mode Overrides for Maximum Clarity and High Contrast */
body.light-theme .optimizer-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
}

body.light-theme .comp-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .comp-btn:hover {
  background: rgba(16, 185, 129, 0.06);
  border-color: #10b981;
}

body.light-theme .comp-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #065f46;
}

body.light-theme .comp-btn.active .comp-btn-title {
  color: #047857;
}

body.light-theme .form-select,
body.light-theme .form-input,
body.light-theme .form-textarea {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
}

body.light-theme .formats-table th {
  background: #f1f5f9;
  color: #475569;
}

body.light-theme .formats-table td {
  border-bottom-color: #e2e8f0;
}

body.light-theme .formats-table tr:hover td {
  background: #f8fafc;
}

body.light-theme .btn-download-stream {
  background: rgba(99, 102, 241, 0.1);
  border: 1.5px solid rgba(99, 102, 241, 0.35);
  color: #4338ca;
}

body.light-theme .btn-download-stream:hover {
  background: #4f46e5;
  color: #ffffff;
}

body.light-theme .action-btn-outline {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

body.light-theme .tag-pill {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}

body.light-theme .tag-pill.accent {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .sample-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

body.light-theme .sample-chip:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
  color: #4338ca;
}

body.light-theme .header-nav {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.light-theme .nav-btn {
  color: #475569;
}

body.light-theme .nav-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.05);
}

body.light-theme .nav-btn.active {
  background: #4f46e5;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
}

body.light-theme .nav-count-badge {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

body.light-theme .nav-btn.active .nav-count-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
}

body.light-theme .tab-btn {
  color: #475569;
}

body.light-theme .tab-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #0f172a;
}

body.light-theme .tab-btn.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #4338ca;
}

body.light-theme .subtitle-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
}

body.light-theme .btn-sm-outline {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

body.light-theme .btn-sm-outline:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: #6366f1;
  color: #4338ca;
}

body.light-theme .studio-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
}

body.light-theme .timeline-visual-box {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
}

body.light-theme .timeline-track {
  background: #cbd5e1;
}

/* Formats Table */
.formats-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.formats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.formats-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.formats-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.formats-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.text-right { text-align: right; }

.quality-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quality-name {
  font-weight: 700;
  color: var(--text-primary);
}

.quality-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.quality-tag.gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.quality-tag.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.btn-download-stream {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-download-stream:hover {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Precision Clipper & Visual Timeline */
.clipper-container {
  padding: 10px 0;
}

.clipper-intro h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.clipper-intro p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.timeline-visual-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.timeline-track {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  overflow: hidden;
}

.timeline-range-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.timeline-time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.clipper-presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.clipper-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.clip-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.time-input-group {
  display: flex;
  gap: 6px;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

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

.text-accent {
  color: var(--accent-cyan);
}

/* Audio Studio FX */
.audio-studio-container {
  padding: 10px 0;
}

.studio-intro h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.studio-intro p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.studio-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.studio-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.studio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.studio-label {
  font-weight: 700;
  font-size: 0.92rem;
}

.studio-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Subtitles */
.subtitles-container h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitles-container p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.subtitles-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subtitle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.sub-lang {
  font-weight: 600;
  margin-right: 8px;
}

.sub-code {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.sub-actions {
  display: flex;
  gap: 8px;
}

.btn-sm-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-sm-outline:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Metadata Form */
.meta-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.meta-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.meta-field input {
  width: 100%;
}

/* History Section */
.history-section {
  max-width: 960px;
  margin: 0 auto;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header-row h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.empty-state-box {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

.empty-state-box h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state-box p {
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  font-size: 0.9rem;
}

/* Guide Section */
.guide-section {
  max-width: 960px;
  margin: 0 auto;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.guide-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.guide-card-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.guide-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.guide-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* QR Code Modal Box */
.qr-code-box {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.qr-code-box svg {
  display: block;
}

/* Progress Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  padding: 28px;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-primary);
  animation: pulse 1s infinite;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

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

.video-minipreview {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  align-items: center;
}

.modal-thumb {
  width: 90px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.modal-meta h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stage Stepper */
.stage-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}

.stage-step.active .step-circle {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.stage-step.done .step-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
}

.step-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stage-step.active .step-text {
  color: var(--text-primary);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 8px;
  transform: translateY(-10px);
  transition: var(--transition);
}

.step-line.done {
  background: var(--accent-emerald);
}

/* Progress Bar */
.progress-bar-wrapper {
  margin-bottom: 16px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stream-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.download-ready-actions .full-width {
  width: 100%;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(12px);
}

.toast.success {
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
}

.toast.error {
  background: rgba(244, 63, 94, 0.95);
  color: #ffffff;
}

.toast.info {
  background: rgba(99, 102, 241, 0.95);
  color: #ffffff;
}

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

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 40px 24px;
  margin-top: 60px;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

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

/* ==========================================================================
   Legal, Regulatory & Government Compliance Hub Styles
   ========================================================================== */

.legal-hub-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 0 60px 0;
}

.legal-hub-header {
  text-align: center;
  margin-bottom: 40px;
}

.legal-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 16px 0 10px 0;
  color: var(--text-primary);
}

.legal-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 30px auto;
  line-height: 1.6;
}

/* Compliance Badges Grid */
.compliance-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}

.compliance-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.compliance-badge-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.badge-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.badge-status-dot.active {
  background: var(--accent-emerald);
}

.compliance-badge-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.compliance-badge-card small {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Legal Internal Navigation Tabs */
.legal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 35px;
  padding: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.legal-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

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

.legal-nav-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

/* Legal Cards */
.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.legal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-card-header h3,
.legal-card-header h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.legal-card-body p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 18px;
}

.legal-card-body strong {
  color: var(--text-primary);
}

/* Legal Articles & Hierarchy */
.legal-article-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-color);
}

.legal-article-block h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.legal-subclause {
  margin: 18px 0;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.4);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

body.light-theme .legal-subclause {
  background: rgba(241, 245, 249, 0.7);
  border-left-color: var(--accent-primary);
}

.legal-subclause h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.legal-subclause p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.legal-footnote-box {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-sm);
}

.legal-footnote-box h6 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-rose);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.legal-footnote-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.5;
}

/* Grievance Redressal Officer Card */
.grievance-officer-card {
  margin-top: 24px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.light-theme .grievance-officer-card {
  background: #ffffff;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--shadow-sm);
}

.officer-badge-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.officer-icon {
  font-size: 2rem;
}

.officer-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.officer-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.field-value {
  font-size: 0.92rem;
  color: var(--text-primary);
}

/* FAQ Styles */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: var(--transition);
}

body.light-theme .faq-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

.faq-item:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.faq-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.faq-item p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

/* Enhanced Footer Grid */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 36px;
  width: 100%;
  margin-bottom: 30px;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 12px 0 16px 0;
  max-width: 360px;
}

.footer-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.footer-col-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-primary);
  transform: translateX(3px);
  display: inline-block;
}

.footer-officer-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-officer-snippet strong {
  color: var(--text-primary);
}

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  width: 100%;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-statutory-text {
  font-size: 0.74rem;
  max-width: 600px;
  text-align: right;
  opacity: 0.8;
}

/* ==========================================================================
   Step-by-Step How-To Section Styles
   ========================================================================== */

.how-to-section {
  max-width: 1100px;
  margin: 60px auto 40px auto;
  padding: 0 10px;
}

.section-heading-wrap {
  text-align: center;
  margin-bottom: 36px;
}

.section-heading-wrap .section-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 14px 0 8px 0;
  color: var(--text-primary);
}

.section-heading-wrap .section-subtitle {
  font-size: 1.02rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.how-to-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

body.light-theme .how-to-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-sm);
}

.how-to-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.step-number-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.step-card-icon {
  font-size: 1.8rem;
}

.how-to-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.how-to-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

.step-pro-tip {
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--accent-emerald);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

body.light-theme .step-pro-tip {
  background: #f0fdf4;
  color: #1e293b;
}

.step-pro-tip strong {
  color: var(--accent-emerald);
}

/* ==========================================================================
   Keywords & Supported Formats Showcase Styles
   ========================================================================== */

.keywords-showcase-section {
  max-width: 1100px;
  margin: 60px auto 60px auto;
  padding: 0 10px;
}

.keywords-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.keyword-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

body.light-theme .keyword-category-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

.keyword-category-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.cat-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.cat-icon {
  font-size: 1.6rem;
}

.cat-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}

.cat-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.keyword-pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: default;
  user-select: none;
}

body.light-theme .keyword-tag {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.keyword-tag:hover {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   Professional Mobile & Responsive Overhaul (Fluid & Adaptive UI)
   ========================================================================== */

/* Prevent horizontal overflow on any device */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

/* Tablet Screens (<= 992px) */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  /* Layout & Main Container */
  .main-content {
    padding: 16px 12px 60px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Header Overhaul */
  .app-header {
    padding: 0;
  }

  .header-container {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    row-gap: 8px;
    column-gap: 8px;
    padding: 10px 14px;
    max-width: 100%;
  }

  .brand {
    grid-area: brand;
    gap: 8px;
    align-self: center;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
  }

  .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  .brand-name {
    font-size: 1.15rem;
    font-weight: 800;
  }

  .badge-version {
    font-size: 0.65rem;
    padding: 1px 5px;
    margin-left: 4px;
  }

  .header-actions {
    grid-area: actions;
    gap: 8px;
    align-self: center;
  }

  .engine-status {
    padding: 3px 8px;
    font-size: 0.72rem;
    gap: 5px;
  }

  .engine-status .status-label {
    display: none;
  }

  .engine-status::after {
    content: "Ready";
    font-size: 0.74rem;
  }

  .theme-toggle-btn {
    width: 34px;
    height: 34px;
    padding: 6px;
  }

  /* Segmented Mobile Navigation Bar */
  .header-nav {
    grid-area: nav;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
  }

  body.light-theme .header-nav {
    background: #f1f5f9;
    border-color: #cbd5e1;
  }

  .nav-btn {
    flex: 1;
    justify-content: center;
    padding: 7px 4px;
    font-size: 0.8rem;
    gap: 5px;
    white-space: nowrap;
    text-align: center;
  }

  .nav-btn svg {
    width: 14px;
    height: 14px;
  }

  .nav-count-badge {
    min-width: 17px;
    height: 17px;
    font-size: 0.68rem;
    padding: 0 4px;
  }

  /* Hero Section */
  .hero-section {
    padding: 16px 0 14px 0;
  }

  .hero-badge {
    max-width: 100%;
    margin-bottom: 12px;
  }

  .hero-badge .badge-pill {
    font-size: 0.72rem;
    padding: 5px 12px;
    line-height: 1.4;
    white-space: normal;
    display: inline-block;
    max-width: 96%;
    border-radius: var(--radius-full);
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    word-break: break-word;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 0 4px;
    margin-bottom: 18px;
  }

  /* Input Card & Grid Form */
  .input-card {
    padding: 6px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .input-wrapper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "icon input paste"
      "inspect inspect inspect";
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
  }

  .input-icon {
    grid-area: icon;
    align-self: center;
  }

  #videoUrlInput {
    grid-area: input;
    min-width: 0;
    width: 100%;
    font-size: 0.88rem;
    padding: 4px 0;
  }

  #pasteBtn {
    grid-area: paste;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  #inspectBtn {
    grid-area: inspect;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    margin-top: 2px;
  }

  .sample-chips-row {
    justify-content: center;
    gap: 6px;
    padding: 6px 0 2px 0;
  }

  .sample-label {
    width: 100%;
    text-align: center;
    margin-bottom: 2px;
    font-size: 0.72rem;
  }

  .sample-chip {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  /* Inspected Media Preview Card */
  .media-card {
    padding: 16px 12px;
    margin-top: 18px;
    border-radius: var(--radius-md);
  }

  .media-header {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 16px;
  }

  .media-thumb-container {
    width: 100%;
    aspect-ratio: 16/9;
    height: auto;
    border-radius: var(--radius-sm);
  }

  .media-title {
    font-size: 1.1rem;
    line-height: 1.35;
    margin: 6px 0 10px 0;
  }

  .media-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }

  .action-btn-outline {
    padding: 7px 4px;
    font-size: 0.72rem;
    justify-content: center;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .format-tabs-header {
    padding-bottom: 8px;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .format-tabs-header::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .optimizer-card {
    padding: 14px 12px;
  }

  .optimizer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .optimizer-toggle-wrapper {
    justify-content: space-between;
    width: 100%;
  }

  .compression-buttons-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .comp-btn {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  .formats-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
  }

  .formats-table th, .formats-table td {
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  /* Timeline Clipper & Audio FX on Mobile */
  .clipper-timeline-card, .audio-studio-card {
    padding: 16px 12px;
  }

  .time-inputs-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .clipper-presets-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .meta-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Step-by-Step How-To Section */
  .how-to-section {
    margin: 32px auto 20px auto;
    padding: 0;
  }

  .section-heading-wrap .section-title {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .section-heading-wrap .section-subtitle {
    font-size: 0.86rem;
  }

  .how-to-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .how-to-card {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }

  /* Keywords Showcase */
  .keywords-showcase-section {
    margin: 28px auto;
    padding: 0;
  }

  .keywords-categories-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .keyword-category-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .keyword-pill-cloud {
    gap: 6px;
  }

  .keyword-tag {
    padding: 4px 9px;
    font-size: 0.74rem;
  }

  /* Legal Hub & FAQ on Mobile */
  .legal-hub-container {
    padding: 10px 0 20px 0;
  }

  .legal-main-title {
    font-size: 1.55rem;
  }

  .legal-subtitle {
    font-size: 0.88rem;
  }

  .compliance-badge-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .legal-nav-bar {
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .legal-nav-bar::-webkit-scrollbar {
    display: none;
  }

  .legal-nav-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .legal-card {
    padding: 18px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
  }

  .legal-card-header h3, .legal-card-header h2 {
    font-size: 1.2rem;
  }

  .legal-card-body p {
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .grievance-officer-card {
    padding: 16px 12px;
  }

  .officer-details-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .faq-item {
    padding: 14px 16px;
  }

  .faq-item h3 {
    font-size: 0.96rem;
  }

  .faq-item p {
    font-size: 0.85rem;
  }

  /* Footer on Mobile */
  .app-footer {
    padding: 30px 16px 40px;
    margin-top: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-desc {
    max-width: 100%;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-statutory-text {
    max-width: 100%;
    text-align: left;
  }

  /* Progress & QR Modals on Mobile */
  .modal-overlay {
    padding: 10px;
  }

  .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .modal-header h3 {
    font-size: 1.05rem;
  }

  .stage-stepper {
    gap: 4px;
  }

  .step-circle {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }

  .step-text {
    font-size: 0.68rem;
  }

  .stream-stats {
    font-size: 0.72rem;
    gap: 8px;
    flex-wrap: wrap;
  }
}
