/* ============================================================
   INVERSA — style.css
   Aesthetic: Industrial-Futuristic / Terminal-Noir
   Fonts: Syne (display) + Space Mono (mono/body)
   ============================================================ */

:root {
  --bg:         #0a0a0f;
  --bg-panel:   #111118;
  --bg-field:   #16161f;
  --bg-hover:   #1c1c28;
  --border:     #2a2a3a;
  --border-hi:  #3d3d55;
  --accent:     #00c896;
  --accent-dim: #009a74;
  --accent-glow:#00c89633;
  --red:        #ff4d6d;
  --yellow:     #f5c842;
  --text-1:     #f0f0f8;
  --text-2:     #9090a8;
  --text-3:     #5a5a72;
  --mono:       'Space Mono', monospace;
  --display:    'Syne', sans-serif;
  --radius:     6px;
  --radius-lg:  12px;
  --transition: 0.18s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.7;
}

/* ── Background ───────────────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,200,150,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,150,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}
.orb-1 { width: 600px; height: 600px; background: #00c896; top: -200px; right: -100px; animation: floatOrb 18s ease-in-out infinite alternate; }
.orb-2 { width: 400px; height: 400px; background: #7c3aed; bottom: -100px; left: -80px; animation: floatOrb 22s ease-in-out infinite alternate-reverse; }
.orb-3 { width: 300px; height: 300px; background: #00c896; top: 50%; left: 50%; transform: translate(-50%,-50%); animation: floatOrb 14s ease-in-out infinite alternate; opacity: 0.06; }

@keyframes floatOrb {
  from { transform: translate(0, 0); }
  to   { transform: translate(30px, 20px); }
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-mark {
  font-size: 22px;
  color: var(--accent);
  animation: spinMark 8s linear infinite;
  display: inline-block;
}

@keyframes spinMark {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.logo-text {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--text-1);
}

.logo-tag {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 1px;
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
}

.header-badges { display: flex; gap: 10px; align-items: center; }

.badge {
  font-size: 10px;
  font-family: var(--mono);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.badge--free {
  background: rgba(0,200,150,.12);
  color: var(--accent);
  border: 1px solid rgba(0,200,150,.3);
}

.badge--live {
  background: rgba(245,200,66,.08);
  color: var(--yellow);
  border: 1px solid rgba(245,200,66,.25);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 72px 24px 48px;
}

.hero-inner { max-width: 680px; margin: 0 auto; }

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 700;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--text-1);
  margin-bottom: 20px;
}

.hero-title em {
  font-style: normal;
  color: var(--text-2);
}

.title-accent {
  color: var(--accent);
  position: relative;
}

.title-accent::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.4;
}

.hero-sub {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
}

/* ── App Shell ────────────────────────────────────────────── */
.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

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

/* ── Panel ────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  background: rgba(0,200,150,.1);
  border: 1px solid rgba(0,200,150,.2);
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
}

.panel-header h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-1);
  letter-spacing: 0.3px;
  flex: 1;
}

/* ── Form ─────────────────────────────────────────────────── */
form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }

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

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

label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-2);
}

.req { color: var(--accent); }
.opt { color: var(--text-3); font-weight: 400; text-transform: none; letter-spacing: 0; }

input[type="text"] {
  width: 100%;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 13px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="text"]::placeholder { color: var(--text-3); }

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-hint {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.3px;
}

.select-wrap { position: relative; }

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 12px;
}

select {
  width: 100%;
  appearance: none;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 13px;
  padding: 11px 32px 11px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
select option { background: #1a1a28; }

/* ── Advanced Toggle ──────────────────────────────────────── */
.advanced-toggle { margin: -4px 0; }

.toggle-btn {
  background: none;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toggle-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform var(--transition);
}

.toggle-btn.active .toggle-icon { transform: rotate(45deg); }

.advanced-fields {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: -10px;
  animation: slideDown 0.25s ease;
}

.advanced-fields.open { display: flex; }

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

/* ── Style Presets ────────────────────────────────────────── */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.chip {
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: rgba(0,200,150,.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Generate Button ──────────────────────────────────────── */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.btn-generate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
}

.btn-generate:hover:not(:disabled) {
  background: #00e0aa;
  box-shadow: 0 0 30px rgba(0,200,150,.4);
  transform: translateY(-1px);
}

.btn-generate:active:not(:disabled) { transform: translateY(0); }

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

.btn-generate.loading {
  background: var(--accent-dim);
  pointer-events: none;
}

.btn-icon { font-size: 18px; }
.btn-label { flex: 1; text-align: center; }
.btn-arrow { font-size: 16px; transition: transform var(--transition); }
.btn-generate:hover .btn-arrow { transform: translateX(4px); }

.rate-limit-msg {
  font-size: 11px;
  color: var(--red);
  text-align: center;
  padding: 8px;
  border: 1px solid rgba(255,77,109,.25);
  border-radius: var(--radius);
  background: rgba(255,77,109,.06);
}

/* ── Output Panel ─────────────────────────────────────────── */
.panel--output { min-height: 520px; display: flex; flex-direction: column; }

.output-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.action-btn:hover {
  border-color: var(--border-hi);
  color: var(--text-1);
}

.action-btn--primary {
  background: rgba(0,200,150,.08);
  border-color: rgba(0,200,150,.25);
  color: var(--accent);
}

.action-btn--primary:hover {
  background: rgba(0,200,150,.18);
  box-shadow: 0 0 12px rgba(0,200,150,.15);
}

.action-btn.copied {
  background: rgba(0,200,150,.15);
  border-color: var(--accent);
  color: var(--accent);
}

.download-group { display: flex; gap: 6px; }

/* ── Output States ────────────────────────────────────────── */
.output-empty,
.output-loading,
.output-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  min-height: 380px;
}

.empty-icon {
  font-size: 48px;
  color: var(--text-3);
  animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.output-empty p { color: var(--text-2); font-size: 13px; }
.empty-sub { color: var(--text-3); font-size: 12px; }
.empty-sub strong { color: var(--text-2); }

/* Loader */
.loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-text {
  color: var(--text-1);
  font-size: 14px;
  font-weight: 700;
}

.loader-sub { color: var(--text-3); font-size: 11px; }

.dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* Error */
.error-icon { font-size: 36px; color: var(--red); }
.output-error p { color: var(--red); font-size: 13px; max-width: 400px; }

/* ── Output Content ───────────────────────────────────────── */
.output-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 24px 0;
}

.output-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meta-tag {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.meta-tag.highlight {
  border-color: rgba(0,200,150,.3);
  background: rgba(0,200,150,.07);
  color: var(--accent);
}

.output-text {
  flex: 1;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  outline: none;
  transition: border-color var(--transition);
  animation: fadeIn 0.4s ease;
}

.output-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Variation headings inside output */
.output-text .variation-heading {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 11px;
  text-transform: uppercase;
  display: block;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,200,150,.2);
}

.output-text::-webkit-scrollbar { width: 5px; }
.output-text::-webkit-scrollbar-track { background: transparent; }
.output-text::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

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

.output-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 20px;
  font-size: 10px;
  color: var(--text-3);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* ── Scrollbar Global ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .logo-tag { display: none; }
  .hero { padding: 48px 16px 32px; }
  .app-shell { padding: 0 12px 60px; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .output-actions { width: 100%; }
  form { padding: 16px; }
  .field-row { grid-template-columns: 1fr; }
}
