/* ============================================
   SceneWeaver — Demo Page Styles
   ============================================ */

/* Demo top nav */
.demo-top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 44px;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.demo-top-nav a {
  font-size: 12px;
  color: var(--fg-dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.demo-top-nav a:hover {
  color: var(--fg-muted);
}

.demo-nav-gallery {
  color: var(--accent) !important;
  opacity: 0.8;
}

.demo-nav-gallery:hover {
  opacity: 1;
}

/* Shared fullscreen layout */
.fullscreen-prompt,
.fullscreen-loading,
.fullscreen-error,
.fullscreen-vr {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* ---- PROMPT SCREEN ---- */
.fullscreen-prompt {
  background: var(--bg);
  overflow-y: auto;
}

.prompt-inner {
  max-width: 700px;
  width: 100%;
  padding: 60px 48px;
  text-align: left;
}

.prompt-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.prompt-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 28px;
}

.prompt-headline em {
  font-style: italic;
  color: var(--accent);
}

.prompt-sub {
  font-size: 17px;
  color: var(--fg-muted);
  line-height: 1.65;
  margin-bottom: 48px;
  font-weight: 300;
}

/* Prompt textarea */
.prompt-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.prompt-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  resize: none;
  outline: none;
  min-height: 120px;
}

.prompt-form textarea::placeholder {
  color: var(--fg-dim);
}

.prompt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

#char-count {
  font-size: 13px;
  color: var(--fg-dim);
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary:not(:disabled):hover {
  background: #f7b84a;
}

/* Loading dots */
.dots::after {
  content: '';
  display: inline-block;
  animation: dots 1.2s infinite;
}
@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Examples */
.prompt-examples {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.examples-label {
  font-size: 13px;
  color: var(--fg-dim);
}

.example-prompt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: border-color 0.2s, color 0.2s;
}

.example-prompt:hover {
  border-color: var(--accent-dim);
  color: var(--fg);
}

.back-link {
  display: inline-block;
  margin-top: 32px;
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--fg-muted);
}

/* ---- LOADING SCREEN ---- */
.fullscreen-loading {
  background: var(--bg-2);
}

.loading-inner {
  text-align: center;
}

.loading-orbs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: orb-pulse 1.4s ease-in-out infinite;
}

.orb-1 { animation-delay: 0s; }
.orb-2 { animation-delay: 0.2s; }
.orb-3 { animation-delay: 0.4s; }

@keyframes orb-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.loading-label {
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 8px;
}

.loading-sub {
  font-size: 14px;
  color: var(--fg-muted);
}

/* ---- ERROR SCREEN ---- */
.fullscreen-error {
  background: var(--bg);
  z-index: 20;
}

.error-inner {
  text-align: center;
  max-width: 420px;
}

.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.error-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--fg);
  margin-bottom: 12px;
}

.error-inner p {
  font-size: 15px;
  color: var(--fg-muted);
  margin-bottom: 32px;
}

/* ---- VR SCREEN ---- */
.fullscreen-vr {
  background: #000;
}

#vr-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Scene info overlay — top-left */
.scene-overlay {
  position: fixed;
  top: 28px;
  left: 28px;
  max-width: 320px;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 20px;
  pointer-events: none;
}

.scene-genre {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.scene-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.2;
}

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

/* Choices panel — bottom center */
.choices-panel {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 8, 16, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 20px 24px;
  min-width: 340px;
  max-width: 600px;
  width: auto;
  z-index: 20;
}

.choices-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 12px;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.choice-btn:hover {
  border-color: var(--accent-dim);
  background: #162040;
}

.choice-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(245, 166, 35, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 14px;
}

/* Back and restart buttons */
.back-scene-btn {
  position: fixed;
  top: 28px;
  right: 28px;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: color 0.2s, border-color 0.2s;
  z-index: 20;
}

.back-scene-btn:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.15);
}

.restart-btn {
  position: fixed;
  bottom: 32px;
  right: 28px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: color 0.2s, border-color 0.2s;
  z-index: 20;
}

.restart-btn:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.15);
}

/* VR loading overlay */
.vr-loading {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.vr-loading-bar {
  width: 200px;
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.vr-loading-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent);
  animation: loading-bar 1.5s ease-in-out infinite;
}

@keyframes loading-bar {
  0% { width: 0; margin-left: 0; }
  50% { width: 60%; }
  100% { width: 0; margin-left: 100%; }
}

/* ---- STORYBOOK IMAGE PANEL ---- */
.scene-image-panel {
  margin-bottom: 16px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.scene-image-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.scene-image-panel img.loaded {
  opacity: 1;
}

.scene-image-loader {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13, 20, 36, 0.6), rgba(26, 40, 80, 0.4));
  animation: image-shimmer 1.6s ease-in-out infinite;
  pointer-events: none;
}

.scene-image-panel img.loaded + .scene-image-loader,
.scene-image-panel.loaded .scene-image-loader {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes image-shimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.scene-image-panel.fade-in {
  animation: panel-fade-in 0.5s ease-out;
}

@keyframes panel-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  .prompt-inner {
    padding: 40px 24px;
  }

  .scene-overlay {
    max-width: calc(100vw - 56px);
    top: 16px;
    left: 16px;
  }

  .choices-panel {
    min-width: unset;
    width: calc(100% - 32px);
    bottom: 16px;
    padding: 16px;
  }
}