/* ===== APP SHELL ===== */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--fg);
  text-decoration: none;
}

.nav-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(57, 255, 136, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
}

.app-main {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 100vh;
  padding-top: 56px;
}

/* ===== CREATOR PANEL (LEFT) ===== */
.creator-panel {
  padding: 36px 28px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg);
}

.creator-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.creator-sub {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
  text-transform: uppercase;
}

/* ===== TEMPLATES ===== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tpl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--fg-muted);
}

.tpl-btn:hover {
  border-color: rgba(57, 255, 136, 0.4);
  color: var(--fg);
}

.tpl-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--fg);
}

.tpl-icon { font-size: 18px; }

.tpl-name {
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== PROMPT INPUT ===== */
.prompt-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  padding: 14px 16px;
  resize: none;
  transition: border-color 0.2s;
  width: 100%;
}

.prompt-input:focus {
  outline: none;
  border-color: rgba(57, 255, 136, 0.5);
}

.prompt-input::placeholder { color: var(--fg-muted); }

.prompt-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-display);
}

.prompt-tip {
  font-size: 12px;
  color: var(--fg-muted);
  font-style: italic;
}

/* ===== EXAMPLES ===== */
.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.examples-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-weight: 600;
}

.example-chip {
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.example-chip:hover {
  color: var(--accent);
  border-color: rgba(57, 255, 136, 0.3);
}

/* ===== GENERATE BUTTON ===== */
.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: #0A0A0A;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
  letter-spacing: 0.3px;
}

.generate-btn:hover {
  background: #4DFFAA;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(57, 255, 136, 0.3);
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.generate-btn.loading .btn-label::after {
  content: '...';
  animation: dots 1.2s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.btn-icon {
  font-size: 18px;
  transition: transform 0.2s;
}

.generate-btn:hover .btn-icon { transform: translateX(4px); }

/* ===== ERROR ===== */
.error-msg {
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: #ff6b6b;
}

/* ===== PREVIEW PANEL (RIGHT) ===== */
.preview-panel {
  background: var(--bg-elevated);
  overflow-y: auto;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  gap: 16px;
}

.empty-icon { font-size: 64px; margin-bottom: 8px; }

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--fg);
}

.empty-state p {
  font-size: 15px;
  color: var(--fg-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ===== LOADING STATE ===== */
.loading-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  gap: 24px;
}

.spinner-ring {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-label {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--fg-muted);
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 220px;
}

.lstep {
  font-size: 13px;
  color: var(--fg-muted);
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.lstep.active {
  color: var(--accent);
  border-color: rgba(57, 255, 136, 0.3);
  background: var(--accent-dim);
}

.lstep.done {
  color: var(--fg-muted);
  opacity: 0.6;
}

/* ===== RESULT STATE ===== */
.result-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== VIDEO META BAR ===== */
.video-meta {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.vm-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--fg);
}

.vm-hook {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(57,255,136,0.05) 100%);
  border: 1px solid rgba(57, 255, 136, 0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--fg);
  line-height: 1.5;
  margin-bottom: 12px;
}

.vm-hook-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.vm-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vm-pill {
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-weight: 600;
}

/* ===== STORYBOARD ===== */
.storyboard {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.storyboard-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.scene-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.scene-card:hover { border-color: rgba(57,255,136,0.25); }

.scene-thumb {
  position: relative;
  background: var(--bg);
  overflow: hidden;
  aspect-ratio: 9/16;
  max-height: 100px;
}

.scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-caption-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 8px 6px 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.scene-num-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #0A0A0A;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-info {
  padding: 14px 16px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.scene-caption {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}

.scene-vo {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.scene-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.scene-tag {
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

.scene-tag.transition { color: var(--accent-blue); border-color: rgba(59,130,246,0.3); }

/* ===== VIDEO FOOTER (CTA + HASHTAGS) ===== */
.video-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vf-cta {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.vf-cta-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.vf-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vf-hashtag {
  font-size: 13px;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-weight: 600;
}

/* ===== EXPORT BAR ===== */
.export-bar {
  padding: 16px 28px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: #0A0A0A;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover {
  background: #4DFFAA;
  transform: translateY(-1px);
}

.export-btn.secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
}

.export-btn.secondary:hover {
  background: var(--bg-elevated);
  border-color: rgba(57, 255, 136, 0.3);
  color: var(--accent);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  z-index: 1000;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== MOBILE ===== */
@media (max-width: 900px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .creator-panel {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
  }

  .preview-panel { min-height: 60vh; }

  .scene-card {
    grid-template-columns: 110px 1fr;
  }

  .scene-thumb { max-height: 80px; }
}
