:root {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #0f172a;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --shadow-color: rgba(15, 23, 42, 0.15);

  --stripe-sandwich: #fde7b2;
  --stripe-soup: #f8c6c6;
  --stripe-salad: #bdebd9;
  
  --theme-sandwich-bg: #fffbeb;
  --theme-sandwich-accent: #f59e0b;
  --theme-sandwich-card: #fef3c7;
  --theme-sandwich-text: #78350f;
  
  --theme-soup-bg: #fff1f2;
  --theme-soup-accent: #f43f5e;
  --theme-soup-card: #ffe4e6;
  --theme-soup-text: #881337;
  
  --theme-salad-bg: #f0fdf4;
  --theme-salad-accent: #10b981;
  --theme-salad-card: #dcfce7;
  --theme-salad-text: #14532d;

  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(
    90deg,
    var(--stripe-sandwich) 0 33.333%,
    var(--stripe-soup) 33.333% 66.666%,
    var(--stripe-salad) 66.666% 100%
  );
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  transition: background-color 0.7s ease;
  overflow-x: hidden;
}

/* Animated viewport backdrop: sandwich, soup, salad (logo order). */
.background-bands {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  overflow: hidden;
  pointer-events: none;
}

.background-band {
  flex: 1 1 0;
  min-width: 0;
  opacity: 1;
  transition:
    flex-grow 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    flex-basis 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.45s ease;
}

.background-band--sandwich { background: var(--stripe-sandwich); }
.background-band--soup { background: var(--stripe-soup); }
.background-band--salad { background: var(--stripe-salad); }

/* Theme states applied to body and expanded backdrop band. */
body.theme-sandwich {
  background: var(--stripe-sandwich);
}
body.theme-soup {
  background: var(--stripe-soup);
}
body.theme-salad {
  background: var(--stripe-salad);
}

body.theme-sandwich .background-band--sandwich,
body.theme-soup .background-band--soup,
body.theme-salad .background-band--salad {
  flex-grow: 100;
  opacity: 1;
}

body.theme-sandwich .background-band:not(.background-band--sandwich),
body.theme-soup .background-band:not(.background-band--soup),
body.theme-salad .background-band:not(.background-band--salad) {
  flex-grow: 0;
  flex-basis: 0;
  opacity: 0;
}

.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  position: relative;
}

.lang-switch {
  position: absolute;
  top: 0;
  right: 0;
}

.pill-btn {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--border-color);
  transition: var(--transition-smooth);
}

.pill-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--border-color);
}

.pill-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--border-color);
}

.logo-badge {
  font-size: 2.5rem;
  letter-spacing: 4px;
  margin-bottom: 12px;
  display: inline-block;
  animation: pulseEmoji 3s infinite ease-in-out;
}

@keyframes pulseEmoji {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.title {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 14px;
}

.title-highlight {
  color: var(--text-main);
  -webkit-text-fill-color: currentColor;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: #334155;
  font-weight: 600;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.45;
}

/* Main Card */
.main-card {
  background: var(--card-bg);
  border: 3px solid var(--border-color);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 6px 6px 0px var(--border-color);
  transition: var(--transition-smooth);
}

@media (min-width: 640px) {
  .main-card {
    padding: 40px 36px;
  }
}

/* Search Form */
.search-form {
  width: 100%;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 540px) {
  .input-wrapper {
    flex-direction: row;
  }
}

.search-input {
  flex: 1;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  outline: none;
  transition: var(--transition-smooth);
}

.search-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.submit-btn {
  background: #0f172a;
  color: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 28px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 3px 3px 0px var(--border-color);
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.submit-btn:hover {
  background: #1e293b;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--border-color);
}

.submit-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--border-color);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Dedicated Debates Card (Placed below main card & why section with spacing) */
.debates-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 24px 22px;
  box-shadow: 4px 4px 0px var(--border-color);
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition-smooth);
}

.debates-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.debates-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.debate-pill {
  background: #f8fafc;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--border-color);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.debate-pill:hover {
  background: #ffffff;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--border-color);
  color: var(--text-main);
}

.debate-pill:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--border-color);
}

/* Loading & States */
.hidden {
  display: none !important;
}

.state-container {
  text-align: center;
  padding: 36px 12px;
  animation: fadeIn 0.3s ease;
}

.spinner-container {
  margin-bottom: 20px;
}

.floating-emojis {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 2.6rem;
}

.float-emoji {
  display: inline-block;
  animation: bounce 1.2s infinite ease-in-out alternate;
}

.float-emoji:nth-child(2) {
  animation-delay: 0.2s;
}

.float-emoji:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0% { transform: translateY(0px) scale(0.9); }
  100% { transform: translateY(-18px) scale(1.1); }
}

.loading-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Error Box */
.error-box {
  background: #fee2e2;
  border: 2px solid #ef4444;
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  margin: 0 auto;
}

.error-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.error-text {
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 16px;
  line-height: 1.4;
}

.secondary-btn {
  background: #ffffff;
  border: 2px solid #991b1b;
  color: #991b1b;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.secondary-btn:hover {
  background: #fef2f2;
}

/* Result Section */
.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: popIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 8px 0;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.verdict-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.verdict-icon {
  font-size: clamp(4.8rem, 14vw, 6.2rem);
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
  animation: wiggle 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  transform-origin: center bottom;
}

@keyframes wiggle {
  0% { transform: scale(0.6) rotate(0deg); opacity: 0; }
  40% { transform: scale(1.15) rotate(-12deg); opacity: 1; }
  70% { transform: scale(0.95) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.verdict-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  line-height: 1.15;
}

/* Category specific verdict styling */
.verdict-sandwich .verdict-title {
  color: var(--theme-sandwich-text);
}
.verdict-soup .verdict-title {
  color: var(--theme-soup-text);
}
.verdict-salad .verdict-title {
  color: var(--theme-salad-text);
}

.action-buttons {
  width: 100%;
  display: flex;
  justify-content: center;
}

.primary-btn {
  background: #0f172a;
  color: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 3px 3px 0px var(--border-color);
  transition: var(--transition-smooth);
}

.primary-btn:hover {
  background: #1e293b;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--border-color);
}

.primary-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--border-color);
}

/* Outside Why Section */
.why-outside-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: -6px;
  animation: fadeIn 0.4s ease;
}

.why-text-trigger {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  transition: var(--transition-smooth);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(15, 23, 42, 0.35);
}

.why-text-trigger:hover {
  opacity: 0.85;
  text-decoration-color: var(--text-main);
  transform: translateY(-1px);
}

.why-chevron {
  display: inline-block;
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.why-text-trigger.active .why-chevron {
  transform: rotate(180deg);
}

.reasoning-box {
  width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 22px 24px;
  margin-top: 14px;
  background: #ffffff;
  box-shadow: 4px 4px 0px var(--border-color);
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.theme-sandwich .reasoning-box {
  background: var(--theme-sandwich-card);
  border-color: var(--theme-sandwich-text);
  box-shadow: 4px 4px 0px var(--theme-sandwich-text);
}

body.theme-soup .reasoning-box {
  background: var(--theme-soup-card);
  border-color: var(--theme-soup-text);
  box-shadow: 4px 4px 0px var(--theme-soup-text);
}

body.theme-salad .reasoning-box {
  background: var(--theme-salad-card);
  border-color: var(--theme-salad-text);
  box-shadow: 4px 4px 0px var(--theme-salad-text);
}

.reasoning-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text-main);
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 600;
  padding: 12px 0 24px;
}

.footer-disclaimer {
  max-width: 620px;
  margin: 10px auto 0;
  font-size: 0.76rem;
  line-height: 1.5;
  font-weight: 600;
}

.footer-links {
  margin-top: 12px;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition-smooth);
}

.footer-link:hover {
  color: var(--text-main);
}

@media (prefers-reduced-motion: reduce) {
  .background-band {
    transition-duration: 0.01ms;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
