/* =========================================
   VidBurst Script Generator App
   Creator Studio Energy — Dark + Orange
   ========================================= */

:root {
  --orange: #FF4A1C;
  --orange-light: #FF6B3D;
  --orange-dim: rgba(255, 74, 28, 0.12);
  --black: #111118;
  --surface: #1A1A24;
  --surface-2: #22222E;
  --surface-3: #2A2A38;
  --cream: #F9F7F4;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.3);
  --border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--black);
  color: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* NAVBAR */
.app-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 17, 24, 0.9);
  backdrop-filter: blur(16px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  text-decoration: none;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: #fff; }

/* MAIN */
.app-main {
  padding: 100px 24px 60px;
  min-height: 100vh;
}

.app-container {
  max-width: 780px;
  margin: 0 auto;
}

/* HEADER */
.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.app-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--orange-dim);
  border: 1px solid rgba(255, 74, 28, 0.25);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.app-header h1 {
  font-size: 40px;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-header p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto;
}

/* INPUT CARD */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.input-group:last-of-type { margin-bottom: 0; }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.3px;
}

.required { color: var(--orange); }

input[type="url"],
input[type="text"],
textarea,
select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255,255,255,0.35)' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.input-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.input-divider::before,
.input-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* GENERATE BUTTON */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin-top: 24px;
  background: var(--orange);
  border: none;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: -0.3px;
}

.generate-btn:hover:not(:disabled) { background: var(--orange-light); }
.generate-btn:active:not(:disabled) { transform: scale(0.98); }
.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* LOADING SPINNER */
.generate-btn .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* OUTPUT SECTION */
.output-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.output-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
}

.copy-btn {
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: var(--surface-3); color: #fff; }
.copy-btn.copied { color: #22c55e; border-color: rgba(34,197,94,0.3); }

/* SCRIPT OUTPUT CARDS */
#scriptOutput { padding: 0; }

.script-block {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.script-block:last-child { border-bottom: none; }

.script-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.script-block-header:hover { background: rgba(255,255,255,0.02); }

.script-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.script-block-icon {
  width: 28px; height: 28px;
  background: var(--orange-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange-light);
}

.script-block-toggle {
  color: var(--text-muted);
  transition: transform 0.2s;
}
.script-block.collapsed .script-block-toggle { transform: rotate(-90deg); }
.script-block.collapsed .script-block-body { display: none; }

.script-block-body { padding: 0 24px 20px; }

/* HOOK BLOCK */
.hook-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hook-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}
.hook-meta span {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 6px;
}

.hook-style {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--orange);
}

/* SCENES */
.scene-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 8px;
}
.scene-timestamp {
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-light);
  background: var(--orange-dim);
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  align-self: start;
  margin-top: 2px;
}
.scene-content { display: flex; flex-direction: column; gap: 6px; }
.scene-content p { font-size: 13px; line-height: 1.4; }
.scene-content p strong { color: var(--orange-light); display: block; font-size: 11px; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.scene-content p span { color: var(--text-secondary); }

/* SELLING POINTS */
.point-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 6px;
}
.point-bullet {
  width: 22px; height: 22px;
  background: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.point-text { font-size: 14px; line-height: 1.4; }
.point-text strong { color: rgba(255,255,255,0.6); font-weight: 500; }
.point-text span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* STYLE RECS */
.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.style-chip {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px;
}
.style-chip-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.style-chip-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

/* CAPTIONS */
.caption-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}
.caption-time {
  font-size: 11px;
  color: var(--orange-light);
  background: var(--orange-dim);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.caption-text { color: #fff; font-weight: 500; }

/* PRODUCTION NOTES */
.notes-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-left: 3px solid var(--orange);
}

/* ERROR */
.error-section { margin-bottom: 24px; }
.error-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid rgba(255,74,28,0.2);
  border-radius: 12px;
  padding: 20px 24px;
  color: var(--orange-light);
}
.error-card strong { display: block; margin-bottom: 4px; }
.error-card p { font-size: 14px; color: var(--text-secondary); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .app-main { padding: 80px 16px 40px; }
  .input-row { grid-template-columns: 1fr; }
  .style-grid { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 28px; }
  .input-card, .output-section { padding: 20px 16px; }
  .script-block-body { padding: 0 16px 16px; }
}