/**
 * AI Command Center — Video Animation Studio Styles
 * Fully compatible with Executive High-Contrast Light Theme (Default) and Cyber Dark Theme.
 * Adheres to modern-web-guidance: accessible tabs, single-row toolbars, responsive grids.
 */

:root {
  --vs-accent: #6366f1;
  --vs-accent-hover: #4f46e5;
  --vs-accent-subtle: rgba(99, 102, 241, 0.12);
  --vs-track-bg: var(--bg-subtle, #f8fafc);
  --vs-track-border: var(--border-color, #e2e8f0);
  --vs-playhead: #ef4444;
  --vs-keyframe: #f59e0b;
}

/* ==========================================================================
   Page Shell & Header
   ========================================================================== */

#pageVideoStudio {
  background: var(--bg-main, #ffffff);
  color: var(--text-main, #0f172a);
}

.vs-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.vs-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.vs-tab-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding: 0.25rem 0.25rem 0.75rem 0.25rem;
  overflow-x: auto;
  flex-shrink: 0;
  box-sizing: border-box;
}

.vs-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-shrink: 0;
  height: 38px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  color: var(--text-secondary, #475569);
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

.vs-tab-btn:hover {
  background: var(--vs-accent-subtle);
  color: var(--vs-accent);
}

.vs-tab-btn.active {
  background: var(--vs-accent-subtle);
  color: var(--vs-accent);
  border-color: rgba(99, 102, 241, 0.35);
  font-weight: 700;
  position: relative;
}

.vs-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -0.75rem;
  left: 10%;
  width: 80%;
  height: 3px;
  background: var(--vs-accent);
  border-radius: 3px 3px 0 0;
}

/* ==========================================================================
   Dashboard KPI Grid & Filter Bar
   ========================================================================== */

.vs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vs-kpi-card {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vs-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.vs-kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim, #64748b);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vs-kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.vs-kpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary, #475569);
}

/* ==========================================================================
   Project Cards & Gallery Grid
   ========================================================================== */

.vs-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.vs-project-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.vs-project-card:hover {
  border-color: var(--vs-accent);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  transform: translateY(-3px);
}

.vs-card-thumb-wrap {
  width: 100%;
  height: 160px;
  background: #0f172a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vs-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vs-project-card:hover .vs-card-thumb-img {
  transform: scale(1.04);
}

.vs-card-badge-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 0.35rem;
}

.vs-card-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.vs-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.vs-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-card-meta {
  font-size: 0.75rem;
  color: var(--text-dim, #64748b);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vs-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-subtle, #f8fafc);
}

/* ==========================================================================
   Project Workspace & Storyboard Editor
   ========================================================================== */

.vs-workspace-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.vs-storyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.vs-scene-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  transition: all 0.2s ease;
}

.vs-scene-card.active-scene {
  border-color: var(--vs-accent);
  box-shadow: 0 0 0 2px var(--vs-accent-subtle);
}

.vs-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vs-scene-num-badge {
  background: var(--vs-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-scene-preview-box {
  width: 100%;
  height: 120px;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
}

/* ==========================================================================
   Scene Editor & Inspector
   ========================================================================== */

.vs-inspector-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .vs-inspector-grid {
    grid-template-columns: 1fr;
  }
}

.vs-stage-canvas-wrap {
  background: #090d16;
  border-radius: 12px;
  height: 520px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
}

.vs-inspector-panel {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vs-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vs-control-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim, #64748b);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   Multi-Track Timeline Editor
   ========================================================================== */

.vs-timeline-container {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.vs-timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.vs-tracks-scroll {
  overflow-x: auto;
  position: relative;
  background: var(--vs-track-bg);
  border: 1px solid var(--vs-track-border);
  border-radius: 8px;
  min-height: 240px;
}

.vs-timecode-ruler {
  height: 26px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.65rem;
  font-family: monospace;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #334155;
  position: sticky;
  top: 0;
  z-index: 5;
}

.vs-track-row {
  display: flex;
  align-items: center;
  height: 52px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  position: relative;
}

.vs-track-header {
  width: 140px;
  min-width: 140px;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  background: var(--bg-subtle, #f1f5f9);
  border-right: 1px solid var(--border-color, #e2e8f0);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: sticky;
  left: 0;
  z-index: 4;
}

.vs-track-lane {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
}

.vs-timeline-clip {
  position: absolute;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--vs-accent), #7e22ce);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: filter 0.15s ease;
}

.vs-timeline-clip:hover {
  filter: brightness(1.1);
}

.vs-timeline-clip.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--vs-accent);
}

.vs-timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--vs-playhead);
  z-index: 10;
  pointer-events: none;
}

.vs-timeline-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 12px;
  background: var(--vs-playhead);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ==========================================================================
   Production Monitor & Event Log
   ========================================================================== */

.vs-monitor-terminal {
  background: #090d16;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  border-radius: 10px;
  padding: 1rem;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #1e293b;
}

.vs-log-entry {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.vs-log-time {
  color: #64748b;
  flex-shrink: 0;
}

.vs-log-stage {
  color: #a855f7;
  font-weight: 700;
  flex-shrink: 0;
}

.vs-log-msg {
  color: #e2e8f0;
}

