/* ============================================================
   WINNING STORY VIDEO — Storyboard CSS v1.0
   ============================================================ */

/* ── Mode button untuk sidebar ── */
#btn-mode-storyboard { }

/* ── Main Section ── */
#view-storyboard {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Storyboard Header ── */
.sb-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 20px;
  border-bottom: 1px solid #1e2433;
  margin-bottom: 24px;
}
.sb-header-left .sb-kicker {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  color: #ff7180;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sb-header-left h2 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.sb-header-left p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  max-width: 520px;
  line-height: 1.6;
}
.sb-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── Config bar (frame count + template) ── */
.sb-config-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: #0e1118;
  border: 1px solid #1e2433;
  border-radius: 12px;
  margin-bottom: 24px;
}
.sb-config-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-config-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #64748b;
  text-transform: uppercase;
  white-space: nowrap;
}
.sb-count-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sb-count-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #2d3340;
  background: #12151b;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.sb-count-chip:hover { border-color: #d6a75d; color: #fff; }
.sb-count-chip.active {
  background: linear-gradient(135deg, #d6a75d22, #d6a75d0a);
  border-color: #d6a75d;
  color: #d6a75d;
  box-shadow: 0 0 12px #d6a75d22;
}
.sb-config-sep {
  width: 1px;
  height: 28px;
  background: #1e2433;
}
.sb-total-badge {
  font-size: 12px;
  color: #4ade80;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Storyboard info bar ── */
.sb-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #091509, #091210);
  border: 1px solid #1a3020;
  border-radius: 10px;
  margin-bottom: 22px;
}
.sb-info-bar span {
  font-size: 12px;
  color: #4ade80;
  font-weight: 600;
}
.sb-info-bar strong { color: #fff; }

/* ── Frames grid ── */
.sb-frames-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
@media (max-width: 900px) { .sb-frames-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sb-frames-grid { grid-template-columns: 1fr; } }

/* ── Frame card ── */
.sb-frame-card {
  background: var(--frame-bg, #0d0f13);
  border: 1px solid color-mix(in srgb, var(--frame-accent, #d6a75d) 25%, transparent);
  border-left: 3px solid var(--frame-accent, #d6a75d);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.sb-frame-card:hover {
  border-color: var(--frame-accent, #d6a75d);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--frame-accent, #d6a75d) 15%, transparent);
}

/* Frame header */
.sb-frame-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: color-mix(in srgb, var(--frame-accent, #d6a75d) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--frame-accent, #d6a75d) 15%, transparent);
}
.sb-frame-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--frame-accent, #d6a75d);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}
.sb-frame-label {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-frame-duration {
  font-size: 10px;
  color: var(--frame-accent, #d6a75d);
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb, var(--frame-accent, #d6a75d) 12%, transparent);
  padding: 2px 7px;
  border-radius: 999px;
}

/* Frame visual (image area) */
.sb-frame-visual {
  position: relative;
  background: #08090d;
  min-height: 130px;
  display: flex;
  align-items: stretch;
}
.sb-frame-placeholder {
  width: 100%;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.sb-frame-placeholder span { font-size: 32px; }
.sb-frame-placeholder small {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--frame-accent, #d6a75d);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sb-frame-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.sb-frame-overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px 7px;
  background: linear-gradient(to top, #000d 0%, #0000 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-overlay-title {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  text-shadow: 0 1px 4px #000;
  display: block;
}
.sb-overlay-caption {
  font-size: 9.5px;
  color: #e2e8f0cc;
  line-height: 1.35;
  display: block;
  text-shadow: 0 1px 4px #000;
}

/* VO row */
.sb-frame-vo {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 8px 11px;
  border-top: 1px solid #14181f;
  background: #09090d;
}
.sb-vo-icon {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
  white-space: nowrap;
  margin-top: 1px;
}
.sb-vo-text {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.45;
  font-style: italic;
}

/* Frame action buttons */
.sb-frame-edit-actions {
  display: flex;
  gap: 6px;
  padding: 9px 11px;
  border-top: 1px solid #14181f;
  background: #070809;
}
.sb-btn-edit-frame,
.sb-btn-gen-frame,
.sb-btn-import-img {
  flex: 1;
  min-height: 30px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #2d3340;
  background: #12151b;
  color: #94a3b8;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-btn-edit-frame:hover  { background: #1e2430; border-color: #60a5fa; color: #60a5fa; }
.sb-btn-gen-frame:hover   { background: #1a1408; border-color: #d6a75d; color: #d6a75d; }
.sb-btn-import-img:hover  { background: #0a1508; border-color: #4ade80; color: #4ade80; }

/* ── Export/Action bar ── */
.sb-export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 20px;
  background: #0e1016;
  border: 1px solid #1e2433;
  border-radius: 12px;
  margin-bottom: 28px;
}
.sb-export-bar-title {
  font-size: 10px;
  font-weight: 800;
  color: #d6a75d;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  width: 100%;
}
.sb-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid transparent;
}
.sb-export-btn.primary {
  background: linear-gradient(135deg, #d6a75d, #c48f45);
  color: #0a0800;
  border-color: #d6a75d;
  box-shadow: 0 4px 16px #d6a75d30;
}
.sb-export-btn.primary:hover { background: linear-gradient(135deg, #e8bc70, #d6a75d); box-shadow: 0 6px 20px #d6a75d45; }
.sb-export-btn.secondary {
  background: #161b25;
  color: #e2e8f0;
  border-color: #2d3340;
}
.sb-export-btn.secondary:hover { background: #1e2430; border-color: #4ade80; color: #fff; }
.sb-export-btn.video-btn {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  border-color: #7c3aed;
  box-shadow: 0 4px 16px #7c3aed30;
}
.sb-export-btn.video-btn:hover { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 6px 20px #7c3aed45; }

/* Voice toggle */
.sb-voice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
.sb-voice-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}
.sb-voice-toggle input { opacity: 0; width: 0; height: 0; }
.sb-voice-slider {
  position: absolute;
  inset: 0;
  background: #2d3340;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.sb-voice-slider:before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.sb-voice-toggle input:checked + .sb-voice-slider { background: #7c3aed; }
.sb-voice-toggle input:checked + .sb-voice-slider:before { transform: translateX(16px); }

/* ── Modals ── */
.sb-modal-wrap {
  position: fixed;
  inset: 0;
  background: #000a;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.sb-modal {
  background: #111318;
  border: 1px solid #2d3340;
  border-radius: 16px;
  padding: 26px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 24px 60px #000c;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.sb-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.sb-modal-subtitle {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #d6a75d;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.sb-modal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sb-modal-field label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sb-modal-field input,
.sb-modal-field textarea {
  background: #0c0e12;
  border: 1px solid #262c38;
  border-radius: 8px;
  color: #e2e8f0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 10px 13px;
  transition: border-color .18s;
  width: 100%;
  box-sizing: border-box;
}
.sb-modal-field input:focus,
.sb-modal-field textarea:focus { border-color: #d6a75d; outline: none; }
.sb-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.sb-modal-btn {
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  transition: all .18s;
}
.sb-modal-btn.save  { background: #d6a75d; border-color: #d6a75d; color: #0a0800; }
.sb-modal-btn.save:hover { background: #e8bc70; }
.sb-modal-btn.cancel { background: transparent; border-color: #2d3340; color: #94a3b8; }
.sb-modal-btn.cancel:hover { background: #1e2430; color: #fff; }
.sb-modal-btn.chatgpt { background: #10a37f; border-color: #10a37f; color: #fff; }
.sb-modal-btn.chatgpt:hover { background: #0e8f6f; }

/* Prompt modal wide */
#sb-prompt-modal .sb-modal { max-width: 660px; }
#sb-prompt-modal textarea {
  min-height: 220px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #94a3b8;
  resize: vertical;
}
#sb-prompt-modal textarea:focus { color: #e2e8f0; border-color: #d6a75d; }

/* Slideshow modal */
#sb-slideshow-modal .sb-modal {
  max-width: 640px;
}
.sb-slideshow-screen {
  position: relative;
  background: #060810;
  border: 1px solid #1e2433;
  border-radius: 12px;
  min-height: 320px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-ss-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  background: linear-gradient(to top, #000e 0%, #0000 100%);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sb-ss-overlay strong { font-size: 16px; font-weight: 800; color: #fff; display: block; text-shadow: 0 2px 8px #000; }
.sb-ss-overlay span   { font-size: 12px; color: #e2e8f0cc; display: block; }
.sb-slideshow-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sb-slideshow-counter {
  font-size: 11px;
  font-weight: 700;
  color: #d6a75d;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sb-slideshow-vo {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.5;
}

