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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --border: #1e1e2e;
  --text: #e0e0e8;
  --text-dim: #7a7a8e;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --danger: #ff4466;
  --warning: #ffaa22;
  --radius: 12px;
  --font: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scanline overlay for retro feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  z-index: 9999;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ── Header ──────────────────────────────────── */
header {
  text-align: center;
  padding: 3rem 0 2rem;
}

h1.glitch {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  position: relative;
  animation: flicker 4s infinite;
}

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
  98% { opacity: 0.6; }
  99% { opacity: 1; }
}

.subtitle {
  margin-top: 0.75rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Ad Slots ────────────────────────────────── */
.ad-slot {
  margin: 1.5rem 0;
  text-align: center;
}

.ad-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ── Input Section ───────────────────────────── */
.input-section {
  margin: 2rem 0;
}

.input-wrapper {
  display: flex;
  gap: 0;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
  transition: box-shadow 0.3s;
}

.input-wrapper:focus-within {
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.2);
}

#job-input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
}

#job-input::placeholder {
  color: var(--text-dim);
}

#analyze-btn {
  padding: 1rem 1.75rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s;
  white-space: nowrap;
}

#analyze-btn:hover {
  background: var(--accent-dim);
}

#analyze-btn:active {
  transform: scale(0.98);
}

/* ── Loading ─────────────────────────────────── */
.loading-section {
  text-align: center;
  padding: 3rem 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--accent);
  font-size: 0.85rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ── Results ─────────────────────────────────── */
.results-section {
  animation: fadeUp 0.6s ease-out;
}

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

.results-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

/* ── Risk Meter ──────────────────────────────── */
.risk-meter {
  margin-bottom: 2rem;
}

.risk-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.risk-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  background: linear-gradient(90deg, var(--accent), var(--warning), var(--danger));
}

.risk-percentage {
  font-size: 2.5rem;
  font-weight: 900;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--accent), var(--danger));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Countdown ───────────────────────────────── */
.countdown-section {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.job-title-display {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.job-title-display span {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
}

.takeover-date {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--danger);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(255, 68, 102, 0.3);
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  min-width: 2ch;
  text-align: center;
}

.countdown-label {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ── Analysis / Risk Factors / Tips ──────────── */
.analysis-section,
.risk-factors,
.survival-tips {
  margin-bottom: 1.5rem;
}

.results-card h3 {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.analysis-section p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.risk-factors ul,
.survival-tips ul {
  list-style: none;
  padding: 0;
}

.risk-factors li,
.survival-tips li {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.risk-factors li::before {
  content: '\26A0  ';
  color: var(--warning);
}

.survival-tips li::before {
  content: '\2713  ';
  color: var(--accent);
}

.survival-tips a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.survival-tips a:hover {
  color: var(--accent-dim);
}

/* ── Easter Egg Special Results ──────────────── */
.results-card.easter-egg .takeover-date {
  font-size: 1.2rem;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* ── Share Buttons ───────────────────────────── */
.share-section {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}

.share-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.05);
}

.share-btn svg {
  flex-shrink: 0;
}

.share-copy.copied {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Affiliate Section ───────────────────────── */
.affiliate-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.affiliate-section h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.affiliate-subtitle {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.affiliate-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.affiliate-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

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

.affiliate-card-text {
  flex: 1;
}

.affiliate-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.affiliate-card-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.affiliate-card a {
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  margin-left: 1rem;
  transition: all 0.2s;
}

.affiliate-card a:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── Try Another Button ──────────────────────── */
.try-another-btn {
  display: block;
  margin: 2rem auto;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid var(--text-dim);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.try-another-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ── Feedback Section ────────────────────────── */
.feedback-section {
  text-align: center;
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feedback-question {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.feedback-thumbs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.thumb-btn {
  padding: 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 0;
}

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

.thumb-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 255, 136, 0.08);
}

.thumb-btn.selected-down {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 68, 102, 0.08);
}

.feedback-text-wrapper {
  margin-top: 0.75rem;
}

.feedback-text-wrapper textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.feedback-text-wrapper textarea:focus {
  border-color: var(--accent);
}

.feedback-text-wrapper textarea::placeholder {
  color: var(--text-dim);
}

.feedback-submit {
  margin-top: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.feedback-submit:hover {
  background: var(--accent-dim);
}

.feedback-thanks {
  color: var(--accent);
  font-size: 0.85rem;
}

/* ── Footer ──────────────────────────────────── */
footer {
  text-align: center;
  padding: 3rem 0 2rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.footer-small {
  margin-top: 0.25rem;
  font-size: 0.65rem;
  opacity: 0.5;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 540px) {
  .container {
    padding: 1.5rem 1rem;
  }

  header {
    padding: 2rem 0 1.5rem;
  }

  .input-wrapper {
    flex-direction: column;
  }

  #analyze-btn {
    border-top: 2px solid var(--accent-dim);
  }

  .countdown-timer {
    gap: 1rem;
  }

  .countdown-number {
    font-size: 1.5rem;
  }

  .results-card {
    padding: 1.5rem;
  }

  .share-section {
    flex-direction: column;
    align-items: stretch;
  }

  .share-btn {
    justify-content: center;
  }

  .affiliate-card {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .affiliate-card a {
    margin-left: 0;
  }
}
