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

:root {
  --bg: #0a0a0f;
  --surface: #141418;
  --surface2: #1c1c22;
  --border: #2a2a32;
  --text: #e4e4e7;
  --text-dim: #71717a;
  --accent: #f97316;
  --radius: 12px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}

.subtitle {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 400;
}

main {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 200px);
}

/* ---- Form Panel ---- */
.form-panel {
  padding: 32px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

.form-panel h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ---- AI Upload Zone ---- */
.ai-upload {
  margin-bottom: 22px;
  border-radius: 12px;
  overflow: hidden;
}

.ai-dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ai-dropzone:hover,
.ai-dropzone.dragover {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.05);
}

.ai-dropzone p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.ai-dropzone strong {
  color: var(--text);
}

.ai-browse {
  color: #a78bfa;
  cursor: pointer;
  text-decoration: underline;
}

.ai-hint {
  font-size: 11px !important;
  opacity: 0.5;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 12px;
  font-size: 13px;
  color: #a78bfa;
}

.ai-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(167, 139, 250, 0.3);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

/* ---- Engine Toggle ---- */
.ai-engine-toggle {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.engine-btn {
  padding: 5px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.engine-btn.active {
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.html-dot { background: #f97316; }
.photo-dot { background: #a78bfa; }

/* ---- Live Pipeline Dashboard ---- */
.ai-pipeline {
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.04);
  overflow: hidden;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.pipeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pipeline-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a78bfa;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(167, 139, 250, 0); }
}

.pipeline-steps {
  padding: 8px 0;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-dim);
  animation: stepFadeIn 0.3s ease-out;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(167, 139, 250, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.step-check { color: #22c55e; font-size: 14px; }
.step-skip { color: #f59e0b; font-size: 12px; }
.step-error { color: #ef4444; font-size: 14px; }

.step-model {
  color: #a78bfa;
  font-weight: 600;
  white-space: nowrap;
}

.step-model.gpt { color: #74aa9c; }
.step-model.rembg { color: #f59e0b; }
.step-model.engine { color: #f97316; }

.step-action {
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-time {
  color: rgba(255,255,255,0.2);
  font-size: 10px;
  white-space: nowrap;
}

.ai-result {
  padding: 14px 18px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
}

.ai-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
  margin-bottom: 6px;
}

.ai-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.4;
}

.ai-extras {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ai-extras .ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-dim);
}

.ai-extras .ai-tag.logo-tag { color: #a78bfa; }
.ai-extras .ai-tag.product-tag { color: #f97316; }

.ai-extras .ai-tag img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.ai-retry {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.ai-retry:hover {
  border-color: var(--text);
  color: var(--text);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.6;
}

.field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hours-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hours-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  min-width: 60px;
}

.hours-row input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.hours-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Category Grid ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cat-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.cat-card:hover {
  border-color: var(--cat-color);
}

.cat-card.active {
  border-color: var(--cat-color);
  background: color-mix(in srgb, var(--cat-color) 10%, var(--surface));
  box-shadow: 0 0 0 1px var(--cat-color);
}

.cat-icon {
  font-size: 22px;
  line-height: 1;
}

/* ---- Generate Button — FIXED orange, never changes ---- */
.generate-btn {
  width: 100%;
  padding: 14px;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 8px;
}

.generate-btn:hover {
  opacity: 0.9;
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* ---- Quick Fill ---- */
.quick-fill {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.quick-fill > span {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
}

#quick-fill-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#quick-fill-btns button {
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

#quick-fill-btns button:hover {
  border-color: #f97316;
}

/* ---- Preview Panel ---- */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--surface);
  position: relative;
}

.preview-area {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 9/16;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

/* ==========================================================
   LIVE BANNER + ENTRANCE ANIMATIONS
   Mirrors the Remotion composition's staggered entrance.
   Each element starts invisible, then animates in with delay.
   ========================================================== */

.live-banner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  font-family: "Inter", sans-serif;
}

/* Single screen layout */

/* ---- Full-bleed background photo ---- */
.lb-bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  opacity: 0;
}

/* Dark overlay gradient for text readability */
.lb-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.62) 0%,
    rgba(0,0,0,0.42) 30%,
    rgba(0,0,0,0.48) 60%,
    rgba(0,0,0,0.82) 100%
  );
  pointer-events: none;
}

/* (old pattern overlays removed — replaced by full-bleed photos) */

.lb-glow {
  position: absolute;
  top: -20%;
  left: 20%;
  width: 60%;
  height: 40%;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

/* glow controlled by GSAP */

/* (category illustrations replaced by full-bleed photos) */

.lb-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10% 8% 4%;
  gap: 0;
}

/* ---- Store Name ---- */
.lb-name {
  font-size: 44px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 2%;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
  word-break: break-word;
}

.lb-name.lb-name-sm { font-size: 34px; }
.lb-name.lb-name-md { font-size: 38px; }

/* ---- Underline (animated, accent colored) ---- */
.lb-underline {
  height: 2px;
  width: 0%;
  margin-bottom: 5%;
}

/* ---- Products ---- */
.lb-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.lb-product {
  font-size: 22px;
  font-weight: 300;
  color: rgba(255,255,255,0.9);
  text-align: center;
  line-height: 1.3;
}

/* ---- Slogan / Welcome (handwriting font) ---- */
.lb-slogan {
  font-family: "Dancing Script", cursive;
  font-size: 32px;
  font-weight: 500;
  text-align: center;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
}

/* ---- Product PNG overlay (absolute, does NOT push flex items) ---- */
.lb-product-png {
  position: absolute;
  top: 28%;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 45%;
  max-height: 30%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
  z-index: 2;
  pointer-events: none;
}

/* ---- Spacer ---- */
.lb-spacer {
  flex: 1;
  min-height: 4%;
}

/* ---- Hours Schedule ---- */
.lb-hours {
  width: 92%;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 5% 6% 6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lb-hours-title-sm {
  font-size: 8px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 3px;
  margin-bottom: 2px;
}

.lb-schedule {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-day {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.lb-day-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
}

.lb-day-time {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

.lb-day-time.closed {
  opacity: 0.35;
  font-style: italic;
}

/* ---- Replay Button ---- */
.replay-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.replay-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* All animations handled by GSAP timeline */

/* ---- Render Overlay ---- */
.render-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 16px;
}

.rendering-state {
  text-align: center;
  color: var(--text-dim);
}

.progress-ring {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.progress-ring span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.rendering-state p {
  font-size: 14px;
}

/* ---- Video Result ---- */
.video-result-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.video-result-wrapper .preview-area {
  border-radius: 16px 16px 0 0;
}

.video-result-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border-radius: 0 0 16px 16px;
  width: 100%;
  max-width: 360px;
}

.download-btn {
  padding: 8px 20px;
  background: #f97316;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.15s;
}

.download-btn:hover {
  opacity: 0.9;
}

.back-btn {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.back-btn:hover {
  border-color: #f97316;
}

.render-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}

/* ---- Gallery ---- */
.gallery {
  padding: 32px;
  border-top: 1px solid var(--border);
}

.gallery h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-card {
  aspect-ratio: 9/16;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
}

.gallery-card:hover {
  border-color: #f97316;
}

.gallery-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card .card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 12px;
  font-weight: 500;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  .form-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .preview-area {
    max-width: 300px;
  }
}
