/* ── Reset & Base ──────────────────────────────────────────────── */

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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111113;
  --bg-panel: #161618;
  --bg-hover: #1c1c1f;
  --border: #2a2a2e;
  --border-subtle: #1e1e22;
  --text: #e0e0e4;
  --text-muted: #8a8a90;
  --text-dim: #5a5a60;
  --cyan: #00e5ff;
  --cyan-dim: #006b7a;
  --cyan-glow: rgba(0, 229, 255, 0.12);
  --magenta: #ff2ecb;
  --magenta-dim: #7a1660;
  --magenta-glow: rgba(255, 46, 203, 0.12);
  --green: #00e676;
  --green-dim: #0a3d1f;
  --yellow: #ffea00;
  --yellow-dim: #3d3800;
  --red: #ff3d3d;
  --red-dim: #3d0a0a;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

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

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

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Header ───────────────────────────────────────────────────── */

.header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.header__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.header__status--draft {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(255, 234, 0, 0.2);
}

.header__status--approved {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.header__status--changes-requested {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 61, 61, 0.2);
}

.header__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.header__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.header__meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header__meta-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* ── Section Labels ───────────────────────────────────────────── */

.section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--magenta);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Format Specs ─────────────────────────────────────────────── */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.spec-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.spec-card__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.spec-card__title svg {
  width: 14px;
  height: 14px;
}

.spec-card__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-card__row:last-child {
  border-bottom: none;
}

.spec-card__label {
  color: var(--text-muted);
}

.spec-card__value {
  color: var(--text);
  font-weight: 600;
}

/* ── Voice & Video Style ──────────────────────────────────────── */

.production-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 700px) {
  .production-info {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.info-card__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--magenta);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.info-card__title svg {
  width: 14px;
  height: 14px;
}

.info-card__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-card__detail {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Timeline ─────────────────────────────────────────────────── */

.timeline {
  margin-bottom: 2.5rem;
}

.timeline__bar {
  display: flex;
  height: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.timeline__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bg);
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.timeline__segment:hover {
  filter: brightness(1.2);
  z-index: 1;
}

.timeline__segment:nth-child(odd) {
  background: var(--cyan);
}

.timeline__segment:nth-child(even) {
  background: var(--magenta);
}

.timeline__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.timeline__legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.timeline__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ── Storyboard Sections ──────────────────────────────────────── */

.storyboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}

.panel:hover {
  border-color: var(--cyan-dim);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.panel__id {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cyan);
  background: var(--cyan-glow);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.panel__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-left: 0.75rem;
  flex: 1;
}

.panel__duration {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.panel__duration svg {
  width: 12px;
  height: 12px;
}

.panel__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 700px) {
  .panel__body {
    grid-template-columns: 1fr;
  }
}

.panel__script {
  padding: 1.25rem;
  border-right: 1px solid var(--border-subtle);
}

@media (max-width: 700px) {
  .panel__script {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}

.panel__script-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.panel__script-label svg {
  width: 12px;
  height: 12px;
}

.panel__script-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.panel__directions {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel__concept {
  margin-bottom: 0.75rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.panel__concept-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.panel__concept-img:hover {
  transform: scale(1.02);
}

.panel__visual,
.panel__audio {
  font-size: 0.8rem;
  line-height: 1.6;
}

.panel__visual-label,
.panel__audio-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.panel__visual-label svg,
.panel__audio-label svg {
  width: 12px;
  height: 12px;
}

.panel__visual-label {
  color: var(--magenta);
}

.panel__visual-text {
  color: var(--text-muted);
}

.panel__audio-label {
  color: var(--cyan);
}

.panel__audio-text {
  color: var(--text-muted);
}

/* ── Audio Preview ────────────────────────────────────────────── */

.audio-preview {
  margin-bottom: 2.5rem;
}

.audio-preview__card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.audio-preview__info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.audio-preview__player {
  width: 100%;
  margin-top: 0.5rem;
}

.audio-preview__player audio {
  width: 100%;
  height: 40px;
  border-radius: var(--radius);
}

.audio-preview__placeholder {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ── Comments ─────────────────────────────────────────────────── */

.comments {
  margin-bottom: 2.5rem;
}

.comments__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comment {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.comment__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment__author {
  font-size: 0.75rem;
  color: var(--cyan);
  font-weight: 600;
}

.comment__time {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.comment__section {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--magenta);
  margin-bottom: 0.4rem;
}

.comment__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.comment__delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.comment__delete:hover {
  color: var(--red);
}

.comment__delete svg {
  width: 14px;
  height: 14px;
}

.comments__empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── Comment Form ─────────────────────────────────────────────── */

.comment-form {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.comment-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 500px) {
  .comment-form__row {
    grid-template-columns: 1fr;
  }
}

.comment-form label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.comment-form input,
.comment-form select,
.comment-form textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form select:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
}

.comment-form textarea {
  min-height: 80px;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.comment-form select option {
  background: var(--bg-panel);
  color: var(--text);
}

.comment-form__submit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.comment-form__submit:hover {
  background: var(--cyan-glow);
  border-color: var(--cyan);
}

.comment-form__submit svg {
  width: 14px;
  height: 14px;
}

/* ── Approval Actions ─────────────────────────────────────────── */

.approval {
  margin-bottom: 2rem;
}

.approval__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.approval__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.approval__btn:active {
  transform: scale(0.97);
}

.approval__btn svg {
  width: 16px;
  height: 16px;
}

.approval__btn--approve {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(0, 230, 118, 0.3);
}

.approval__btn--approve:hover {
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--green);
}

.approval__btn--changes {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255, 61, 61, 0.3);
}

.approval__btn--changes:hover {
  background: rgba(255, 61, 61, 0.15);
  border-color: var(--red);
}

.approval__btn--reset {
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-color: var(--border);
}

.approval__btn--reset:hover {
  color: var(--text-muted);
  border-color: var(--text-dim);
}

.approval__current {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.approval__current strong {
  color: var(--text-muted);
}

/* ── Footer ───────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.footer a {
  color: var(--cyan);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

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

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Selection ────────────────────────────────────────────────── */

::selection {
  background: var(--cyan);
  color: var(--bg);
}

/* ── Loading ──────────────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.loading__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.75rem;
}

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

/* ── Error ────────────────────────────────────────────────────── */

.error {
  background: var(--red-dim);
  border: 1px solid rgba(255, 61, 61, 0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--red);
  font-size: 0.85rem;
  text-align: center;
  margin: 4rem auto;
  max-width: 500px;
}

/* ── Animations ───────────────────────────────────────────────── */

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

.panel,
.spec-card,
.info-card,
.comment {
  animation: fadeIn 0.3s ease both;
}

.storyboard .panel:nth-child(1) { animation-delay: 0.05s; }
.storyboard .panel:nth-child(2) { animation-delay: 0.1s; }
.storyboard .panel:nth-child(3) { animation-delay: 0.15s; }
.storyboard .panel:nth-child(4) { animation-delay: 0.2s; }
.storyboard .panel:nth-child(5) { animation-delay: 0.25s; }
.storyboard .panel:nth-child(6) { animation-delay: 0.3s; }
.storyboard .panel:nth-child(7) { animation-delay: 0.35s; }
