/* ============================================
   WEBSITE PROMPT GENERATOR — Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111114;
  --bg-tertiary: #1a1a1f;
  --bg-card: #15151a;
  --border: #2a2a32;
  --border-hover: #3a3a45;
  --text-primary: #f0f0f5;
  --text-secondary: #9090a0;
  --text-muted: #606070;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-glow-strong: rgba(99, 102, 241, 0.3);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --pill-bg: #1e1e25;
  --pill-selected: rgba(99, 102, 241, 0.12);
  --pill-border-selected: #6366f1;
  --pill-disabled: #12121599;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Grain Texture Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* --- Container --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.header {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f0f0f5 0%, #6366f1 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 12px;
}

.header p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  max-width: 500px;
  margin: 0 auto;
}

/* --- Sections --- */
.section {
  margin-bottom: 32px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

/* --- Card --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}

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

/* --- Input Fields --- */
.input-group {
  margin-bottom: 20px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

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

.text-input::placeholder {
  color: var(--text-muted);
}

/* --- Select --- */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

.select-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

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

.select-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* --- Toggle Switch --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  top: 2px;
  left: 2px;
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(22px);
  background: white;
}

/* --- Radio Pill Group --- */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill {
  cursor: pointer;
}

.radio-pill input {
  display: none;
}

.radio-pill-label {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.radio-pill input:checked + .radio-pill-label {
  background: var(--pill-selected);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.radio-pill-label:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* --- Controls Card --- */
.controls-card {
  padding: 0 !important;
  overflow: hidden;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.control-cell {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.control-cell:nth-child(2n) {
  border-right: none;
}

.control-cell-full {
  grid-column: 1 / -1;
  border-right: none;
}

.control-cell .input-label {
  margin-bottom: 10px;
}

.controls-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-tertiary);
}

/* --- Options Header Row --- */
.options-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.toggle-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* --- RNG Button --- */
.rng-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.rng-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.rng-btn:active {
  transform: translateY(0);
}

.rng-btn .dice-icon {
  font-size: 1.2rem;
  display: inline-block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rng-btn.spinning .dice-icon {
  transform: rotate(720deg);
}

/* --- Stats Bar --- */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-weight: 700;
  color: var(--accent-hover);
  font-family: 'JetBrains Mono', monospace;
}

/* --- Options Container --- */
.option-section {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}

.section-header:hover {
  background: var(--bg-tertiary);
}

.section-title {
  flex: 1;
}

.section-count {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 10px;
  border-radius: var(--radius-xl);
}

.chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.option-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 18px 18px;
  transition: all 0.3s ease;
}

.option-section.collapsed .options-grid {
  display: none;
}

/* --- Option Pill --- */
.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.option-pill:hover:not(.disabled) {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.option-pill.selected {
  background: var(--pill-selected);
  border-color: var(--pill-border-selected);
}

.option-pill.selected .pill-label {
  color: var(--accent-hover);
}

.option-pill.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.option-checkbox {
  display: none;
}

.pill-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  white-space: nowrap;
}

/* --- Footer Options --- */
.footer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.footer-option:last-child {
  border-bottom: none;
}

.footer-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.footer-checkbox input {
  display: none;
}

.footer-checkmark {
  position: absolute;
  top: 0; left: 0;
  width: 20px;
  height: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-checkbox input:checked + .footer-checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.footer-checkmark svg {
  width: 12px;
  height: 12px;
  stroke: white;
  opacity: 0;
  transition: opacity var(--transition);
}

.footer-checkbox input:checked + .footer-checkmark svg {
  opacity: 1;
}

.footer-option-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-option-text a {
  color: var(--accent-hover);
  text-decoration: none;
}

/* --- Output Section --- */
.output-card {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
}

/* --- Floating Action Bar --- */
.floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 0 20px 20px;
  pointer-events: none;
}

.floating-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(21, 21, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.5);
  pointer-events: all;
}

.fab-generate {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.fab-generate:hover {
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.fab-generate:active {
  transform: translateY(0);
}

.fab-copy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.fab-copy:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.fab-copy.copied {
  border-color: var(--success);
  color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}

.prompt-display {
  padding: 24px;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-primary);
  max-height: 600px;
  overflow-y: auto;
  cursor: text;
  user-select: text;
}

.prompt-display .prompt-line {
  margin-bottom: 4px;
}

.prompt-display .prompt-heading {
  font-weight: 700;
  color: var(--accent-hover);
  margin-top: 16px;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.prompt-display .prompt-subheading {
  font-weight: 600;
  color: var(--text-primary);
  font-style: italic;
  margin-top: 12px;
  margin-bottom: 2px;
}

.prompt-display .prompt-item {
  padding-left: 16px;
  color: var(--text-secondary);
  position: relative;
}

.prompt-display .prompt-item::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.prompt-display .prompt-spacer {
  height: 8px;
}

.prompt-display .prompt-intro {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.prompt-display .prompt-footer-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* --- Copy Toast --- */
.copy-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #22c55e;
  color: white;
  padding: 14px 32px;
  border-radius: var(--radius-xl);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 40px rgba(34, 197, 94, 0.5);
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- Buttons --- */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn-secondary.copied {
  border-color: var(--success);
  color: var(--success);
}

/* --- Two Column Grid --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Page Footer --- */
.page-footer {
  text-align: center;
  padding: 40px 0 100px;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 40px 0 30px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 18px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .control-cell {
    border-right: none;
    padding: 16px 18px;
  }

  .control-cell-full {
    grid-column: 1;
  }

  .controls-footer {
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .radio-group {
    gap: 6px;
  }

  .radio-pill-label {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .rng-btn {
    width: 100%;
    justify-content: center;
  }

  .options-grid {
    padding: 6px 12px 14px;
    gap: 6px;
  }

  .option-pill {
    padding: 5px 10px;
  }

  .pill-label {
    font-size: 0.72rem;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .floating-bar {
    padding: 0 12px 12px;
  }

  .floating-bar-inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .fab-generate, .fab-copy {
    padding: 12px 16px;
    font-size: 0.82rem;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }

  .section-header {
    padding: 12px 14px;
    font-size: 0.82rem;
  }
}
