/* ============================================================
   creator-studio.css — All styles for the Creator Studio page
   ============================================================ */

/* ── Layout ───────────────────────────────────────────────── */
.cs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}

@media (max-width: 900px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-sidebar { display: none; }
}

.cs-sidebar {
  border-right: 1px solid var(--clr-border);
  padding: 1.1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  background: var(--clr-bg-secondary, rgba(15,23,42,0.8));
}

.cs-main {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.4rem;
  gap: 1.1rem;
}

/* ── Sidebar navigation ───────────────────────────────────── */
.cs-nav-section {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--clr-text-muted);
  padding: .5rem .5rem .2rem;
  margin-top: .5rem;
}

.cs-nav-btn {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: left;
  padding: .55rem .75rem;
  border-radius: .65rem;
  border: none;
  background: transparent;
  color: var(--clr-text);
  cursor: pointer;
  font-size: .88rem;
  transition: background .15s;
}

.cs-nav-btn:hover { background: rgba(148,163,184,.12); }

.cs-nav-btn.active {
  background: rgba(59,130,246,.15);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.25);
}

.cs-nav-icon {
  font-size: 1rem;
  width: 1.3rem;
  text-align: center;
}

.cs-nav-badge {
  margin-left: auto;
  font-size: .68rem;
  background: rgba(34,197,94,.2);
  color: #86efac;
  border-radius: 999px;
  padding: .1rem .45rem;
}

/* ── Panel system ─────────────────────────────────────────── */
.cs-panel { display: none; flex-direction: column; gap: 1rem; }
.cs-panel.active { display: flex; }

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

.cs-panel-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.cs-panel-sub { font-size: .85rem; color: var(--clr-text-muted); margin: .2rem 0 0; }

/* ── Cards ────────────────────────────────────────────────── */
.cs-card {
  border: 1px solid var(--clr-border);
  border-radius: .9rem;
  padding: 1rem;
  background: var(--clr-card);
}

.cs-card-title { font-size: .9rem; font-weight: 600; margin: 0 0 .55rem; }

.cs-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.cs-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }

@media (max-width: 700px) {
  .cs-grid-2, .cs-grid-3 { grid-template-columns: 1fr; }
}

/* ── Form inputs ──────────────────────────────────────────── */
.cs-label {
  font-size: .8rem;
  color: var(--clr-text-muted);
  margin-bottom: .3rem;
  display: block;
}

.cs-label-mt { margin-top: .75rem; }

.cs-input {
  width: 100%;
  background: rgba(15,23,42,.7);
  border: 1px solid rgba(148,163,184,.3);
  border-radius: .6rem;
  padding: .55rem .75rem;
  color: var(--clr-text);
  font-size: .9rem;
  resize: vertical;
}

.cs-input:focus { outline: none; border-color: rgba(59,130,246,.5); }

.cs-textarea { min-height: 90px; }

.cs-select {
  appearance: none;
  background: rgba(15,23,42,.7)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right .65rem center / 14px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.cs-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: .65rem;
  border: none;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  transition: opacity .15s, transform .1s;
}

.cs-btn:active { transform: scale(.97); }
.cs-btn:disabled { opacity: .45; cursor: not-allowed; }

.cs-btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.cs-btn-green   { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.cs-btn-orange  { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.cs-btn-ghost   { background: rgba(148,163,184,.12); color: var(--clr-text); border: 1px solid rgba(148,163,184,.25); }

/* Small button variant */
.cs-btn-sm { font-size: .78rem; padding: .3rem .65rem; }

/* Preset grid button */
.cs-btn-preset { font-size: .78rem; padding: .45rem; }

/* Video mode button */
.cs-btn-video-mode { flex-direction: column; gap: .2rem; padding: .65rem; text-align: center; }

/* Runtime mode button */
.cs-btn-runtime { flex-direction: column; gap: .25rem; padding: .9rem; text-align: center; }

/* Button row utility */
.cs-btn-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.cs-btn-row-center { justify-content: center; }

/* ── Output box ───────────────────────────────────────────── */
.cs-output {
  background: rgba(7,12,28,.85);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: .75rem;
  padding: .85rem 1rem;
  min-height: 100px;
  font-size: .88rem;
  color: var(--clr-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.cs-output-placeholder { color: var(--clr-text-muted); font-style: italic; }

.cs-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .65rem;
}

/* ── Status pills ─────────────────────────────────────────── */
.cs-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
}

.cs-pill-blue   { background: rgba(59,130,246,.18); color: #93c5fd; }
.cs-pill-green  { background: rgba(34,197,94,.18);  color: #86efac; }
.cs-pill-amber  { background: rgba(251,191,36,.18);  color: #fcd34d; }
.cs-pill-red    { background: rgba(239,68,68,.18);   color: #fca5a5; }

/* ── Queue rows ───────────────────────────────────────────── */
.cs-queue { display: flex; flex-direction: column; gap: .6rem; }

.cs-queue-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .65rem;
  align-items: center;
  background: rgba(15,23,42,.6);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: .75rem;
  padding: .65rem .85rem;
}

.cs-queue-meta { font-size: .76rem; color: var(--clr-text-muted); margin-top: .15rem; }
.cs-queue-empty { color: var(--clr-text-muted); font-size: .85rem; padding: .5rem 0; }

/* ── Progress bar ─────────────────────────────────────────── */
.cs-progress-track { background: rgba(148,163,184,.15); border-radius: 999px; height: 5px; overflow: hidden; }
.cs-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #22c55e); transition: width .4s; }

/* ── AI overlay toggle ────────────────────────────────────── */
.cs-ai-toggle {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.1rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(59,130,246,.45);
}

.cs-ai-panel {
  position: fixed;
  bottom: 5rem;
  right: 1.2rem;
  width: min(400px, calc(100vw - 2rem));
  height: min(520px, 80vh);
  background: var(--clr-bg-secondary, rgba(12,18,35,.96));
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  z-index: 99;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.cs-ai-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.cs-ai-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-ai-title { margin: 0; font-size: .95rem; }

.cs-ai-close { background: none; border: none; color: var(--clr-text-muted); cursor: pointer; font-size: 1.2rem; }

.cs-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.cs-ai-msg {
  max-width: 88%;
  padding: .55rem .8rem;
  border-radius: .75rem;
  font-size: .86rem;
  line-height: 1.45;
}

.cs-ai-msg.user { background: rgba(59,130,246,.22); align-self: flex-end; }
.cs-ai-msg.bot  { background: rgba(148,163,184,.1);  align-self: flex-start; }

.cs-ai-input-row {
  padding: .75rem;
  border-top: 1px solid rgba(148,163,184,.2);
  display: flex;
  gap: .5rem;
}

.cs-ai-input {
  flex: 1;
  background: rgba(7,12,28,.8);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: .6rem;
  padding: .5rem .75rem;
  color: var(--clr-text);
  font-size: .87rem;
}

.cs-ai-send {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: .6rem;
  padding: .5rem .85rem;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
}

/* ── Platform chips ───────────────────────────────────────── */
.cs-platform-chips { display: flex; flex-wrap: wrap; gap: .5rem; }

.cs-platform-chip {
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.3);
  background: rgba(15,23,42,.6);
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: .8rem;
  transition: all .15s;
}

.cs-platform-chip.selected {
  border-color: rgba(34,197,94,.6);
  background: rgba(34,197,94,.12);
  color: #86efac;
}

/* ── Schedule calendar ────────────────────────────────────── */
.cs-schedule-slots { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }

.cs-day-slot {
  aspect-ratio: 1;
  border-radius: .5rem;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(15,23,42,.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  cursor: pointer;
  font-size: .7rem;
  color: var(--clr-text-muted);
}

.cs-day-slot.has-item { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); color: #93c5fd; }
.cs-day-slot.today    { border-color: rgba(34,197,94,.5); color: #86efac; }

/* ── Platform timing cards ────────────────────────────────── */
.cs-platform-time {
  border-radius: .75rem;
  padding: .75rem;
  border: 1px solid transparent;
}

.cs-pt-blue   { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.25); }
.cs-pt-purple { background: rgba(168,85,247,.1);  border-color: rgba(168,85,247,.25); }
.cs-pt-red    { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.25); }
.cs-pt-sky    { background: rgba(14,165,233,.1);  border-color: rgba(14,165,233,.25); }
.cs-pt-teal   { background: rgba(20,184,166,.1);  border-color: rgba(20,184,166,.25); }
.cs-pt-orange { background: rgba(249,115,22,.1);  border-color: rgba(249,115,22,.25); }

.cs-pt-blue   .cs-pt-label { color: #93c5fd; font-size: .82rem; font-weight: 600; }
.cs-pt-purple .cs-pt-label { color: #d8b4fe; font-size: .82rem; font-weight: 600; }
.cs-pt-red    .cs-pt-label { color: #fca5a5; font-size: .82rem; font-weight: 600; }
.cs-pt-sky    .cs-pt-label { color: #7dd3fc; font-size: .82rem; font-weight: 600; }
.cs-pt-teal   .cs-pt-label { color: #5eead4; font-size: .82rem; font-weight: 600; }
.cs-pt-orange .cs-pt-label { color: #fdba74; font-size: .82rem; font-weight: 600; }

.cs-pt-value { font-size: .8rem; color: var(--clr-text-muted); margin-top: .3rem; }

/* ── Analytics connect rows ───────────────────────────────── */
.cs-connect-row {
  background: rgba(15,23,42,.7);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: .75rem;
  padding: .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-connect-name { font-size: .9rem; font-weight: 600; }
.cs-connect-status { font-size: .78rem; color: var(--clr-text-muted); }
.cs-analytics-note { font-size: .8rem; color: var(--clr-text-muted); margin-top: .85rem; }

/* ── Runtime panel ────────────────────────────────────────── */
.cs-runtime-icon { font-size: 1.4rem; }
.cs-runtime-name { font-size: .88rem; }
.cs-runtime-desc { font-size: .75rem; color: var(--clr-text-muted); }
.cs-chip-wrap    { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.cs-hw-list      { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--clr-text-muted); font-size: .83rem; }

/* ── Video elements ───────────────────────────────────────── */
.cs-drop-zone {
  border: 2px dashed rgba(148,163,184,.25);
  border-radius: .75rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--clr-text-muted);
  font-size: .85rem;
  background: rgba(7,12,28,.5);
}

.cs-drop-icon { font-size: 2rem; margin-bottom: .4rem; }
.cs-drop-text { margin-bottom: .2rem; }
.cs-drop-sub  { font-size: .78rem; }

.cs-timeline-preview {
  background: rgba(7,12,28,.85);
  border-radius: .65rem;
  padding: 1rem;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.cs-mode-sub {
  font-size: .74rem;
  color: var(--clr-text-muted);
}

/* ── Image output canvas ──────────────────────────────────── */
.cs-img-canvas {
  border-radius: .65rem;
  overflow: hidden;
  background: rgba(7,12,28,.8);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  font-size: .85rem;
  text-align: center;
  padding: 1rem;
}

/* ── Script textarea ──────────────────────────────────────── */
.cs-script-textarea { min-height: 200px; }
.cs-voice-textarea  { min-height: 130px; }
.cs-sub-textarea    { min-height: 150px; }

/* ── Monospace text ───────────────────────────────────────── */
.cs-mono { font-family: monospace; font-size: .84rem; }

/* ── Meta row (word count + duration) ────────────────────── */
.cs-meta-row { display: flex; align-items: center; gap: .65rem; }

/* ── Speed label ──────────────────────────────────────────── */
.cs-speed-label { font-size: .8rem; color: var(--clr-text-muted); }

/* ── Vault note ───────────────────────────────────────────── */
.cs-vault-note { font-size: .82rem; color: var(--clr-text-muted); }

/* ── Text utilities ───────────────────────────────────────── */
.cs-muted-text { font-size: .84rem; color: var(--clr-text-muted); }
.cs-m0         { margin: 0; }

/* ── Display utility ──────────────────────────────────────── */
.hidden { display: none; }

/* ── Spacing utilities ────────────────────────────────────── */
.mt-50  { margin-top: .5rem; }
.mt-60  { margin-top: .6rem; }
.mt-65  { margin-top: .65rem; }
.mt-70  { margin-top: .7rem; }
.mt-75  { margin-top: .75rem; }
.mt-80  { margin-top: .8rem; }
.mt-85  { margin-top: .85rem; }
.mt-90  { margin-top: .9rem; }
.mb-65  { margin-bottom: .65rem; }

/* ── Gap utilities ────────────────────────────────────────── */
.cs-gap-45  { gap: .45rem; }
.cs-gap-55  { gap: .55rem; }
.cs-mb-65   { margin-bottom: .65rem; }
