/* ============================================================
   POTUS Insult Generator — style.css
   Retro dark-government parody aesthetic
   ============================================================ */

/* ---------- Google Fonts (Courier-style + display) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Share+Tech+Mono&display=swap');

/* ---------- CSS Custom Properties (design tokens) ---------- */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #1c2330;
  --border:      #30363d;
  --gold:        #d4af37;
  --gold-dim:    #8a7020;
  --text:        #c9d1d9;
  --text-muted:  #8b949e;
  --stamp-red:   #9b2335;
  --stamp-blue:  #1a3a5c;
  --font-mono:   'Share Tech Mono', 'Courier New', monospace;
  --font-display:'Special Elite', 'Courier New', serif;
  --radius:      4px;
  --transition:  0.35s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  padding: 1rem;
  line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Page header ---------- */
.site-header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 2rem;
}

.seal {
  display: inline-block;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px double var(--gold);
  background: var(--surface);
  color: var(--gold);
  font-size: 2.8rem;
  line-height: 84px;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.25);
  animation: sealPulse 4s ease-in-out infinite;
}

@keyframes sealPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(212,175,55,.25); }
  50%       { box-shadow: 0 0 32px rgba(212,175,55,.5);  }
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.35rem;
}

.confidential-banner {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.2rem 1rem;
  border: 2px solid var(--stamp-red);
  color: var(--stamp-red);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
  opacity: 0.9;
}

/* ---------- Main layout ---------- */
.container {
  max-width: 780px;
  margin: 0 auto;
}

/* ---------- Form panel (government form aesthetic) ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.panel::before {
  content: attr(data-label);
  position: absolute;
  top: -0.65rem;
  left: 1rem;
  background: var(--surface);
  color: var(--gold-dim);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0 0.4rem;
}

.panel-dashed {
  border-style: dashed;
}

/* ---------- Form controls ---------- */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.mode-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mode-btn {
  flex: 1 1 auto;
  padding: 0.55rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  text-transform: uppercase;
}

.mode-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.mode-btn.active {
  background: var(--stamp-blue);
  border-color: var(--gold);
  color: var(--gold);
}

select, input[type="text"] {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
}

select option { background: var(--surface2); }

/* ---------- Chaos slider ---------- */
.chaos-track {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chaos-label-left, .chaos-label-right {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 80px;
}
.chaos-label-right { text-align: right; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  background: linear-gradient(to right, var(--stamp-blue) 0%, var(--gold) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  box-shadow: 0 0 6px rgba(212,175,55,.6);
  transition: box-shadow var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(212,175,55,.9);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  cursor: pointer;
}

.chaos-desc {
  font-size: 0.78rem;
  color: var(--gold-dim);
  margin-top: 0.3rem;
  font-style: italic;
}

/* ---------- Generate button ---------- */
.btn-generate {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn-generate:hover:not(:disabled) {
  background: var(--gold);
  color: var(--bg);
  box-shadow: 0 0 18px rgba(212,175,55,.4);
}

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

/* ---------- Output panel ---------- */
#output-panel {
  display: none;
  opacity: 0;
  transition: opacity var(--transition);
}

#output-panel.visible {
  display: block;
}

#output-panel.fade-in {
  opacity: 1;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.output-stamp {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 2px solid var(--stamp-red);
  color: var(--stamp-red);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: rotate(2deg);
}

.output-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.output-target {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.output-statement {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text);
  line-height: 1.7;
  padding: 1rem;
  background: var(--surface2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1rem;
}

.output-narrator {
  font-size: 0.78rem;
  color: var(--gold-dim);
  font-style: italic;
  margin-bottom: 0.6rem;
  padding: 0.4rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.output-closer {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.6rem;
}

.output-easter {
  margin-top: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: rgba(212,175,55,0.08);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--gold);
  display: none;
}

.output-easter.visible { display: block; }

/* ---------- Loading spinner ---------- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

/* ---------- Error message ---------- */
.error-msg {
  color: var(--stamp-red);
  font-size: 0.85rem;
  padding: 0.5rem 0;
  display: none;
}
.error-msg.visible { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px dashed var(--border);
  margin-top: 2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  line-height: 1.8;
}

.site-footer .footer-stamp {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  margin-top: 0.5rem;
  border-radius: var(--radius);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Responsive adjustments ---------- */
@media (max-width: 480px) {
  .mode-buttons { flex-direction: column; }
  .chaos-track  { flex-direction: column; align-items: flex-start; }
  .chaos-label-right { text-align: left; }
  input[type="range"] { width: 100%; }
}

/* ---------- Ad unit containers ---------- */
.ad-unit {
  text-align: center;
  overflow: hidden;
}

.ad-unit--leaderboard {
  max-width: 780px;
  margin: 0 auto 1.5rem;
  min-height: 90px;
}

.ad-unit--rectangle {
  max-width: 780px;
  margin: 0 auto 1.5rem;
  min-height: 250px;
}

.ad-unit--footer {
  max-width: 780px;
  margin: 1.5rem auto 0;
  min-height: 90px;
}
