/* styles.css - ENCABO' UGC Prompt Generator (Light Theme) */
/* Branding: Black #131311, Navy #08082a, Lime #dbff00, Cream #eff0ed */

/* --- Base --- */
body {
  background: #eff0ed;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #131311;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: Georgia, 'Times New Roman', serif;
  color: #08082a;
}

/* --- Cards --- */
.card {
  background: #ffffff;
  border: 1px solid rgba(8, 8, 42, 0.08);
  box-shadow: 0 1px 3px rgba(8, 8, 42, 0.04);
}

/* --- Scene cards --- */
.scene-card {
  transition: all 0.2s;
  cursor: pointer;
  min-height: 44px;
  background: #ffffff;
}

.scene-card:hover {
  transform: scale(1.05);
  border-color: #08082a;
}

.scene-card:focus-visible {
  outline: 2px solid #08082a;
  outline-offset: 2px;
}

.scene-card.selected {
  border-color: #08082a;
  border-width: 3px;
  box-shadow: 0 0 16px rgba(8, 8, 42, 0.15);
  background: rgba(8, 8, 42, 0.03);
}

.scene-icon {
  font-size: 1.8rem;
}

/* --- Phrase rows --- */
.phrase-row {
  background: rgba(8, 8, 42, 0.02);
  transition: background 0.15s;
  border: 1px solid transparent;
}

.phrase-row:hover {
  background: rgba(8, 8, 42, 0.05);
}

.phrase-row .move-btn {
  opacity: 0;
  transition: opacity 0.15s;
}
.phrase-row:hover .move-btn {
  opacity: 1;
}
@media (max-width: 768px) {
  .phrase-row .move-btn { opacity: 1; }
}

.phrase-row.warning {
  border-left: 3px solid #f59e0b;
}

/* --- Primary button: Navy bg + White text --- */
.btn-primary {
  background: #08082a;
  color: #eff0ed;
  font-weight: 600;
}

.btn-primary:hover {
  background: #131350;
}

/* --- Secondary button --- */
.btn-secondary {
  background: #eff0ed;
  color: #08082a;
  border: 1px solid rgba(8, 8, 42, 0.15);
  font-weight: 500;
}

.btn-secondary:hover {
  background: #e5e6e3;
}

/* --- Platform buttons --- */
.platform-btn {
  transition: all 0.2s;
  min-height: 44px;
  background: #ffffff;
}

.platform-btn.active {
  background: #08082a;
  border-color: #08082a;
  color: #eff0ed;
}

/* --- Tabs normal/batch --- */
.tab-btn {
  transition: all 0.15s;
  border-bottom: 2px solid transparent;
  color: #131311;
}

.tab-btn.active {
  border-bottom-color: #08082a;
  color: #08082a;
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  color: #131350;
}

/* --- Preview --- */
#previewOutput {
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* --- Form inputs --- */
.input-field {
  background: #ffffff;
  border: 1px solid rgba(8, 8, 42, 0.12);
  color: #131311;
}

.input-field:focus {
  border-color: #08082a;
  outline: none;
  box-shadow: 0 0 0 2px rgba(8, 8, 42, 0.1);
}

/* --- Mobile responsive: hidden/visible panels --- */
@media (max-width: 767px) {
  .hidden-mobile {
    display: none !important;
  }

  body {
    padding-bottom: 4rem;
  }

  .scene-icon {
    font-size: 1.4rem;
  }

  .timeline-bar {
    height: 2rem;
  }

  .combobox-dropdown {
    min-width: 200px;
  }
}

@media (min-width: 768px) {
  .hidden-mobile {
    display: block !important;
  }

  #panelConfig,
  #panelScript,
  #panelOutput {
    display: block !important;
  }
}

/* --- Animations --- */
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

/* --- Onboarding tooltips --- */
.onboarding-tooltip {
  max-width: 300px;
}

@media (max-width: 640px) {
  .onboarding-tooltip {
    max-width: calc(100vw - 32px);
  }
}

/* --- Combobox overrides --- */
.combobox-wrapper {
  min-width: 80px;
}

.combobox-display {
  min-height: 28px;
}

/* --- Touch targets --- */
@media (pointer: coarse) {
  button,
  .combobox-display,
  select,
  .scene-card {
    min-height: 44px;
  }

  input[type="number"] {
    min-height: 36px;
  }
}

/* --- Scrollbar custom --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 8, 42, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(8, 8, 42, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(8, 8, 42, 0.3);
}

/* --- Session restore banner --- */
#sessionBanner {
  animation: fadeIn 0.3s ease-out;
}

/* --- Mobile bottom nav --- */
#mobileNav {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(8, 8, 42, 0.08);
}

#mobileNav button {
  min-height: 56px;
  transition: color 0.15s;
  color: #131311;
}

#mobileNav button:active {
  background: rgba(8, 8, 42, 0.05);
}

/* --- Focus visible --- */
*:focus-visible {
  outline: 2px solid #08082a;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* --- ENCABO' apostrophe accent --- */
.encabo-apostrophe {
  color: #dbff00;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  text-shadow: 0 0 8px rgba(219, 255, 0, 0.3);
}

/* On light backgrounds, use navy apostrophe */
.encabo-apostrophe-dark {
  color: #08082a;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
}

/* --- Subtle label uppercase tracking --- */
.label-uppercase {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.65rem;
}

/* --- Select dropdowns --- */
select option {
  background: #ffffff;
  color: #131311;
}

/* --- JSON import mode --- */
.json-input {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  resize: vertical;
}

/* --- Param pills (scene parameter badges) --- */
.param-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  background: rgba(8, 8, 42, 0.06);
  color: #08082a;
}

/* --- Formula badge colors --- */
.badge-vulnerability { background: #fef3c7; color: #92400e; }
.badge-failed_solutions { background: #fee2e2; color: #991b1b; }
.badge-demo { background: #dbeafe; color: #1e40af; }
.badge-proof { background: #dcfce7; color: #166534; }

/* --- Prompt preview toggle --- */
.prompt-preview {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.prompt-preview.expanded {
  max-height: 600px;
  overflow-y: auto;
}

/* --- Per-segment reference image --- */
.scene-ref-preview img {
  transition: opacity 0.2s ease;
}
