/**
 * AI Command Center — Procedural Movie Studio Styles
 * Theme-aware for Light & Dark modes, single-row accessible tablist with non-color indicator.
 */

:root {
  --ms-accent: #7c3aed;
  --ms-accent-hover: #6d28d9;
  --ms-accent-subtle: rgba(124, 58, 237, 0.12);
}

#pageMovieStudio {
  background: var(--bg-main, #ffffff);
  color: var(--text-main, #0f172a);
  width: 100%;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 3rem !important;
  box-sizing: border-box;
}

#pageMovieStudio.hidden {
  display: none !important;
}

.ms-panel[hidden] {
  display: none !important;
}

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

.ms-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--ms-accent);
  background: var(--ms-accent-subtle);
  flex-shrink: 0;
}

.ms-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.ms-tablist {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 1rem;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.ms-tab {
  position: relative;
  flex: none;
  background: transparent;
  border: none;
  color: var(--text-secondary, #475569);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ms-tab[aria-selected="true"] {
  color: var(--ms-accent);
}

.ms-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  border-block-end: 3px solid var(--ms-accent);
}

.ms-panel-inner {
  display: grid;
  gap: 1rem;
  padding-bottom: 1rem;
}

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

.ms-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.ms-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1rem;
}

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

.ms-card h3 {
  margin: 0 0 0.75rem 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.ms-form-row {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.ms-form-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
}

.ms-input,
.ms-select,
.ms-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input, #f8fafc);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-main, #0f172a);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.86rem;
}

.ms-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 220px;
}

.ms-timeline-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-subtle, #f8fafc);
  padding: 0.75rem;
}

.ms-track-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.ms-track-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
}

.ms-track-lane {
  position: relative;
  min-height: 30px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  overflow: hidden;
}

.ms-clip {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 22px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-log-box {
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  padding: 0.75rem;
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ms-media-box {
  width: 100%;
  max-height: 360px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: #000;
  object-fit: contain;
}
