/* ============================================
   Fake Data API Playground — Styles
   Theme: Dark mode with Sunset Fire palette
   ============================================ */

:root {
  --primary: #F97316;
  --primary-dim: rgba(249, 115, 22, 0.15);
  --secondary: #FB923C;
  --accent: #14B8A6;
  --accent-dim: rgba(20, 184, 166, 0.2);
  --bg: #1A100A;
  --bg-card: rgba(30, 18, 10, 0.65);
  --bg-surface: #241810;
  --border: rgba(249, 115, 22, 0.12);
  --border-hover: rgba(249, 115, 22, 0.3);
  --text: #F5F0E8;
  --text-dim: #A8937D;
  --danger: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 250ms ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-glow: 0 0 40px rgba(249, 115, 22, 0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(249, 115, 22, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.04) 0%, transparent 60%);
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glow);
}

/* Header */
.header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.04) 0%, transparent 100%);
}
.header-inner { max-width: 800px; margin: 0 auto; }
.logo { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.logo-icon { font-size: 2rem; }
.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.25rem; }

/* Main */
.main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Section */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.section-header .section-title { margin-bottom: 0; }
.section-actions { display: flex; gap: 0.5rem; }

/* Builder */
.builder-section { padding: 1.5rem; }
.entity-row { margin-bottom: 1rem; }
.control-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.control-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}
.control-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Fields */
.fields-area { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn 200ms ease;
}
.field-row .control-label { margin-bottom: 0.25rem; }
.field-remove {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  align-self: end;
  margin-bottom: 2px;
}
.field-remove:hover { background: rgba(239, 68, 68, 0.35); }

/* Options */
.options-section { padding: 1.5rem; }
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  align-items: end;
}
.control-actions { display: flex; gap: 0.5rem; align-items: end; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #E05A00);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35); }
.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(20, 184, 166, 0.35); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.15); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

/* Output */
.output-section { width: 100%; }
.output-panels { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.output-panel { padding: 1.5rem; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.panel-header .section-title { margin-bottom: 0; }
.panel-actions { display: flex; gap: 0.5rem; }

.json-output, .curl-output {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--secondary);
  line-height: 1.7;
  overflow: auto;
  max-height: 500px;
  white-space: pre;
  tab-size: 2;
}
.curl-output { max-height: 120px; color: var(--accent); }

.endpoint-display {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.endpoint-url {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--primary);
  word-break: break-all;
}

.stats {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(20, 184, 166, 0.4);
  z-index: 1000;
  transition: transform 300ms ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .output-panels { grid-template-columns: 1.4fr 1fr; }
}
@media (max-width: 600px) {
  .header h1 { font-size: 1.35rem; }
  .options-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .main { padding: 1.25rem 1rem 3rem; gap: 1.25rem; }
}

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