/* ═══════════════════════════════════════════════════════════════════════
   Sequence Builder — Design System
   Dark theme, RTL-first, vibrant teal/emerald palette
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────────────── */

:root {
  /* Palette */
  --bg-0: #0a0e17;
  --bg-1: #111827;
  --bg-2: #1f2937;
  --bg-3: #374151;
  --bg-hover: #293548;
  --border: #374151;
  --border-light: #4b5563;

  /* Accent — teal/emerald */
  --accent: #14b8a6;
  --accent-dim: #0d9488;
  --accent-glow: rgba(20, 184, 166, 0.15);
  --accent-text: #5eead4;

  /* Step type colors */
  --color-rukn: #f59e0b;
  --color-sunnah: #10b981;
  --color-wajib: #3b82f6;
  --color-info: #8b5cf6;

  /* Segment type colors */
  --color-step: #94a3b8;
  --color-instruction: #f472b6;
  --color-ayat: #34d399;

  /* Text */
  --text-0: #f9fafb;
  --text-1: #e5e7eb;
  --text-2: #9ca3af;
  --text-3: #6b7280;

  /* Feedback */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --t-fast: 150ms var(--ease);
  --t-med: 250ms var(--ease);
}

/* ─── Reset ──────────────────────────────────────────────────────────── */

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

html {
  font-size: 14px;
  background: var(--bg-0);
  color: var(--text-1);
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  direction: rtl;
  min-height: 100vh;
  overflow: hidden;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ─── Typography ─────────────────────────────────────────────────────── */

h1 { font-size: 1.25rem; font-weight: 700; color: var(--text-0); }
h2 { font-size: 1rem; font-weight: 600; color: var(--text-0); }
h3 { font-size: .875rem; font-weight: 600; color: var(--text-1); }
label { font-size: .8rem; color: var(--text-2); display: block; margin-bottom: var(--sp-xs); }

/* ─── App Shell ──────────────────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ─── Top Bar ────────────────────────────────────────────────────────── */

.top-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.top-bar .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-text);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.top-bar .actions {
  display: flex;
  gap: var(--sp-sm);
  margin-right: auto;
}

/* ─── Main Layout ────────────────────────────────────────────────────── */

.main-layout {
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ─── Panel ──────────────────────────────────────────────────────────── */

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-1);
  border-inline-start: 1px solid var(--border);
}

.panel:first-child { border-inline-start: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: 6px 12px;
  border: none;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-0);
}
.btn-primary:hover { background: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid color-mix(in srgb, var(--error) 30%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }

.btn-icon {
  padding: 4px 6px;
  font-size: 1rem;
  background: transparent;
  color: var(--text-2);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  line-height: 1;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-0); }

.btn-sm { padding: 3px 8px; font-size: .75rem; }

/* ─── Input ──────────────────────────────────────────────────────────── */

.input, .select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-size: .8rem;
  font-family: inherit;
  transition: border-color var(--t-fast);
  direction: rtl;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.select { cursor: pointer; appearance: none; }
.input-xs { padding: 4px 8px; font-size: 0.75rem; }

.quick-edit-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-3);
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.input-group {
  margin-bottom: var(--sp-md);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: .8rem;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

/* ─── Search ─────────────────────────────────────────────────────────── */

.search-box {
  position: relative;
  margin-bottom: var(--sp-md);
}
.search-box .input { padding-right: 32px; }
.search-box .search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: .85rem;
  pointer-events: none;
}

/* ─── Segment Card (Sidebar) ─────────────────────────────────────────── */

.segment-card {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  margin-bottom: var(--sp-sm);
  user-select: none;
}
.segment-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.segment-card.active-video {
  border-color: var(--primary);
  background: var(--bg-1);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.segment-card .seg-name {
  flex: 1;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-0);
  font-family: 'IBM Plex Mono', monospace;
  direction: ltr;
  text-align: right;
}

.segment-card .seg-time {
  font-size: .7rem;
  color: var(--text-3);
  font-family: 'IBM Plex Mono', monospace;
  direction: ltr;
}

.segment-card .seg-grip {
  color: var(--text-3);
  font-size: .85rem;
}

/* ─── Section Block ──────────────────────────────────────────────────── */

.section-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-lg);
  transition: border-color var(--t-med);
}

.section-block.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-glow) 50%, var(--bg-2));
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: calc(var(--r-lg) - 1px);
  border-top-right-radius: calc(var(--r-lg) - 1px);
  transition: background-color 0.2s ease;
  cursor: pointer;
}
.section-header.collapsed {
  border-bottom-left-radius: calc(var(--r-lg) - 1px);
  border-bottom-right-radius: calc(var(--r-lg) - 1px);
  border-bottom-color: transparent;
}
.section-header:hover {
  background: var(--bg-2);
}

.editable-title-display {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-sm);
  transition: background 0.2s;
}
.editable-title-display:hover {
  background: rgba(255,255,255,0.05); /* subtle hover for the text directly */
}

.section-header .input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-0);
  font-weight: 600;
  font-size: .9rem;
  padding: 4px 8px;
  flex: 1;
}
.section-header .input:hover { border-color: var(--border); }
.section-header .input:focus { border-color: var(--accent); background: var(--bg-2); }

.section-steps {
  padding: var(--sp-md);
  min-height: 48px;
}

/* ─── Step Card ──────────────────────────────────────────────────────── */

.step-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: var(--sp-xs);
}
.step-card:hover { background: var(--bg-hover); }
.step-card.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.step-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  width: 100%;
}

.step-type-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step-type-badge.rukn   { background: color-mix(in srgb, var(--color-rukn) 20%, transparent); color: var(--color-rukn); }
.step-type-badge.sunnah { background: color-mix(in srgb, var(--color-sunnah) 20%, transparent); color: var(--color-sunnah); }
.step-type-badge.wajib  { background: color-mix(in srgb, var(--color-wajib) 20%, transparent); color: var(--color-wajib); }
.step-type-badge.info   { background: color-mix(in srgb, var(--color-info) 20%, transparent); color: var(--color-info); }

.segment-type-badge {
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  color: #fff;
}
.segment-type-badge.step { background: var(--color-step); }
.segment-type-badge.instruction { background: var(--color-instruction); }
.segment-type-badge.ayat { background: var(--color-ayat); }

.step-card-header .step-title {
  flex: 1;
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-1);
}

.step-card-header .step-subs {
  font-size: .7rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.step-card-header .step-actions {
  display: flex;
  gap: 2px;
  opacity: 1;
  transition: opacity var(--t-fast);
}
.step-card:hover .step-card-header .step-actions,
.step-card-header .step-actions.active {
  opacity: 1;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 8px 16px;
  width: 100%;
  text-align: right;
  border: none;
  background: transparent;
  color: var(--text-0);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--t-fast);
}
.dropdown-item:hover {
  background: var(--bg-2);
}
.dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sub-segment-card .sub-segment-actions-hover {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.sub-segment-card:hover .sub-segment-actions-hover { opacity: 1; }

.sub-segments-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  margin-right: 0;
  padding-right: var(--sp-sm);
  border-right: 1px dashed var(--border-light);
}

.sub-segment-item {
  display: flex;
  align-items: center;
  font-size: .75rem;
  color: var(--text-2);
  gap: var(--sp-sm);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}

.sub-segment-item:hover {
  background: var(--bg-2);
}

.sub-segment-item.active {
  background: var(--bg-3);
  border-color: var(--accent);
}

.sub-segment-item .sub-id {
  font-family: 'IBM Plex Mono', monospace;
  direction: ltr;
  color: var(--text-1);
}

.sub-segment-item .sub-type {
  font-size: .6rem;
  background: var(--bg-3);
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  color: var(--text-2);
}

.sub-segment-actions {
  display: flex;
  margin-right: auto;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.sub-segment-item:hover .sub-segment-actions { opacity: 1; }

.sub-segment-add {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
  font-size: .75rem;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-top: 2px;
}
.sub-segment-add:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--accent-dim);
}

/* ─── Drop Zone ──────────────────────────────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  text-align: center;
  color: var(--text-3);
  font-size: .8rem;
  transition: all var(--t-med);
}
.drop-zone.active {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-glow);
}

/* ─── Video Panel ────────────────────────────────────────────────────── */

.video-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-0);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--sp-md);
  position: relative;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
}

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

/* ─── Detail Panel ───────────────────────────────────────────────────── */

.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-3);
  font-size: .85rem;
}

.sub-tabs {
  display: flex;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-md);
  flex-wrap: wrap;
}

.sub-tab {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
  font-family: 'IBM Plex Mono', monospace;
  direction: ltr;
}
.sub-tab:hover { border-color: var(--accent); }
.sub-tab.active {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
}

/* ─── Toast ──────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s var(--ease);
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--error); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Modal ──────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in .2s var(--ease);
}

.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  min-width: 400px;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: slide-up .25s var(--ease);
}

.modal h2 { margin-bottom: var(--sp-lg); }

.modal .project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.modal .project-item:hover { background: var(--bg-hover); }
.modal .project-item .project-date { font-size: .7rem; color: var(--text-3); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Sequence Metadata ──────────────────────────────────────────────── */

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--bg-2);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-lg);
}

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

/* ─── Separator ──────────────────────────────────────────────────────── */

.separator {
  height: 1px;
  background: var(--border);
  margin: var(--sp-md) 0;
}

/* ─── Flyout ─────────────────────────────────────────────────────────── */

.flyout-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 2000;
}

.flyout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  transition: opacity var(--t-med);
}

.flyout-wrapper {
  position: fixed;
  inset-block: 0;
  left: 0;
  max-width: 400px;
  width: 100%;
  height: 100vh;
}

.flyout-panel {
  height: 100%;
  width: 100%;
  background: var(--bg-1);
  box-shadow: var(--shadow-lg);
  border-right: 1px solid var(--border);
}

/* Animations */
.flyout-transition-enter, .flyout-transition-leave {
  transition: transform .3s var(--ease);
}
.flyout-transition-enter-start, .flyout-transition-leave-end {
  transform: translateX(-100%);
}
.flyout-transition-enter-end, .flyout-transition-leave-start {
  transform: translateX(0);
}

.flyout-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--sp-xl);
  overflow-y: auto;
  position: relative;
}

.flyout-close-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flyout-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-0);
}

.flyout-header {
  margin-bottom: var(--sp-xl);
}
.flyout-header-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.flyout-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-0);
  margin: 0;
}

/* ─── Utilities ──────────────────────────────────────────────────────── */

.flex-row { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.flex-1 { flex: 1; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: .8rem; }
.text-xs { font-size: .7rem; }
.text-mono { font-family: 'IBM Plex Mono', monospace; direction: ltr; }
.text-center { text-align: center; }
.mr-auto { margin-right: auto; }
.ml-auto { margin-left: auto; }
.hidden { display: none !important; }

/* ─── Custom Video Controls ──────────────────────────────────────────── */

.video-controls-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}

.scrubber-layer {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.scrubber-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  color: var(--text-2);
  user-select: none;
  min-width: 35px;
  direction: ltr;
}

.scrubber-track {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.scrubber-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  pointer-events: none;
  transition: width 0.1s linear;
}

.controls-layer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.media-card-header {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background-color 0.2s ease;
}
.media-card-header:hover {
  background-color: var(--bg-2);
}

/* ─── Quote Picker ───────────────────────────────────────────────────── */

.quote-card {
  border: 1px solid var(--border);
  padding: 12px;
  background: var(--bg-0);
  border-radius: var(--r-sm);
  align-items: flex-start;
  transition: all 0.2s ease;
}
.quote-card:hover {
  border-color: var(--primary);
}
.quote-card.active-quote {
  border-color: var(--primary);
  background: var(--bg-1);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.segment-tabs {
  display: flex;
  margin: 0 -24px;
  padding: 0 24px;
}
.segment-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}
.segment-tab:hover {
  color: var(--text-1);
}
.segment-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
/* ─── Mobile Responsiveness ──────────────────────────────────────────── */

.mobile-tab-bar {
  display: none;
}

@media (max-width: 800px) {
    /* Top bar is now simple enough to avoid wrapping */
  
  /* The main layout gives 100% width to panels, but controlled via JS */
  .main-layout {
    position: relative;
    padding-bottom: 60px; /* space for tab bar */
  }
  
  .panel {
    border: none !important;
  }
  
  /* Mobile Tab Bar */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    z-index: 50;
  }
  
  .mobile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 1rem;
    font-weight: 600;
  }
  .mobile-tab-btn.active {
    color: var(--accent);
    background: var(--bg-2);
    border-top: 2px solid var(--accent);
  }
  
  /* Mobile State Classes handled via Alpine */
  .app-shell.mobile-view-video .sequence-panel {
    display: none !important;
  }
  .app-shell.mobile-view-builder .video-panel {
    display: none !important;
  }
}

.flex-column {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}