/* ---------- Variables ---------- */
:root {
  --bg: #0f1724;
  --panel: #0b1220;
  --muted: #98a8b3;
  --accent: #3ddc97;
  --card: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  --glass: rgba(255,255,255,0.03);
  --radius: 14px;
  --gutter: 18px;
  --max-width: 960px;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ---------- Reset & base ---------- */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--ui);
  background:
    radial-gradient(800px 300px at 10% 10%, rgba(61,220,151,0.05), transparent 60%),
    linear-gradient(180deg, #08101a 0%, var(--bg) 100%);
  color: #e6eef3;
  padding: 36px;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* ---------- Video Player ---------- */
.video-player {
    box-shadow: 0 20px 60px rgba(2,8,20,0.8);
}

.video-container {
    position: relative;
}

.video-controls {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover .video-controls {
    opacity: 1;
}

.play-pause {
    transition: all 0.2s ease;
}

.play-pause:hover {
    transform: scale(1.1);
}
.video-timeline {
    cursor: pointer;
    transition: height 0.2s ease;
}

.video-timeline:hover {
    height: 6px;
}

.video-timeline .progress {
    transition: width 0.1s linear;
}
/* ---------- Layout ---------- */
.video-script {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    box-shadow: 0 12px 40px rgba(2,8,20,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.video-script::-webkit-scrollbar {
    width: 6px;
}

.video-script::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 3px;
}
/* Header */
.script-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.script-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.script-header .subtitle {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Script list */
.script {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}

/* Section card */
.section {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.02);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}

.section:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(2,8,20,0.6);
}

/* Time / badge column */
.section::before {
  content: attr(data-time);
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: linear-gradient(90deg, rgba(61,220,151,0.08), rgba(61,220,151,0.02));
  padding: 8px 10px;
  border-radius: 10px;
  align-self: start;
  justify-self: center;
  margin: 6px 0 0 0;
  box-shadow: inset 0 -6px 24px rgba(3,8,12,0.12);
}

/* Right column content */
.section .section-title {
  margin: 0 0 6px 0;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.section .visuals {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: inline-block;
  padding: 6px 10px;
  background: var(--glass);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.02);
}

.section .narration {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: #e7f2f7;
  padding-right: 6px;
}

/* Small meta row (optional) */
.section .meta {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.02);
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

/* Small play icon using pseudo element */
.section .play {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.02);
  background: linear-gradient(90deg, rgba(255,255,255,0.01), rgba(255,255,255,0.02));
}

/* Compact / mobile adjustments */
@media (max-width: 1024px) {
    .script-wrap {
        grid-template-columns: 1fr;
    }
    .video-script {
        order: 2;
    }
}

@media (max-width: 720px) {
.section {
    grid-template-columns: 1fr;
  }
  .section::before {
    justify-self: start;
    margin-bottom: 6px;
  }
  .script-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Utility: printable-friendly */
@media print {
  body {
    background: white;
    color: black;
  }
  .script-wrap {
    box-shadow: none;
    border: none;
    background: white;
    color: black;
  }
  .section {
    border: 1px solid #ddd;
  }
  .section::before {
    color: #333;
  }
}

/* ---------- Extra fancy lines (visual separators) ---------- */
.section::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -30px;
  width: 160px;
  height: 160px;
  transform: rotate(15deg);
  background: radial-gradient(circle at 30% 30%, rgba(61,220,151,0.03), transparent 20%);
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.8;
}

/* Highlight important section */
.section.focus {
  border: 1px solid rgba(61,220,151,0.22);
  box-shadow: 0 28px 60px rgba(61,220,151,0.06);
}

/* Form styling */
form input,
form select {
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}

form input:focus,
form select:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  transition: all 0.2s ease;
}
button:hover {
  transform: translateY(-1px);
}

/* Video Generation Modal */
#videoModal {
    backdrop-filter: blur(8px);
}

#videoModal > div {
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

#generatedVideo {
    aspect-ratio: 16/9;
    background: #000;
}

#closeModal {
    transition: transform 0.2s ease;
}

#closeModal:hover {
    transform: rotate(90deg);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

#progressBar {
    animation: pulse 1.5s infinite;
}
