/* ═══════════════════════════════════════════════
   Transavia Door Checker — style.css
   Brand guide: Transavia internal
═══════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────── */
:root {
  --green:        #09CE78;
  --green-dark:   #01AB60;
  --green-deep:   #008048;
  --pink:         #E20076;
  --blue:         #140D8A;
  --purple:       #F385FF;
  --orange:       #FF8867;
  --beige:        #F9F0E9;
  --light-blue:   #0053FF;

  --text-dark:    #222222;
  --text-mid:     #444444;
  --text-light:   #888888;
  --border:       #DDDDDD;

  --white:        #FFFFFF;

  --radius-sm:    8px;
  --radius-md:    16px;
  --radius-lg:    24px;
  --radius-pill:  999px;

  --shadow-sm:    0 2px 8px rgba(0,0,0,.06);
  --shadow-md:    0 8px 32px rgba(0,0,0,.10);
  --shadow-lg:    0 20px 60px rgba(0,0,0,.14);

  --font-stack:   'Nexa', system-ui, -apple-system, sans-serif;

  --transition:   0.3s ease;
}

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

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

body {
  font-family: var(--font-stack);
  background: var(--beige);
  color: var(--text-dark);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Header ──────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  padding: 0 clamp(16px, 4vw, 48px);
  height: 64px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 16px rgba(1,171,96,.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link { display: flex; align-items: center; }

.logo-img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.header-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}

/* ── Main ────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 6vw, 80px) clamp(16px, 4vw, 48px);
}

/* ── State panels ────────────────────────────── */
.state-panel {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: fadeUp .5s ease both;
}

.hidden { display: none !important; }

/* ── Loading ─────────────────────────────────── */
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: .02em;
}

/* ── Error ───────────────────────────────────── */
.error-icon { font-size: 3rem; }

.error-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  text-align: center;
}

.error-body {
  font-size: 1rem;
  color: var(--text-mid);
  text-align: center;
}

.retry-btn {
  padding: 12px 28px;
  background: var(--green);
  color: var(--white);
  font-size: .95rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  letter-spacing: .04em;
  transition: background var(--transition), transform var(--transition);
}
.retry-btn:hover { background: var(--green-dark); transform: translateY(-2px); }
.retry-btn:active { transform: translateY(0); }

/* ── Verdict ─────────────────────────────────── */
.verdict-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg);
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: background var(--transition);
}

/* YES state */
.verdict-wrap.is-yes {
  background: linear-gradient(145deg, #edfff5 0%, #d4fde8 100%);
  border: 2px solid var(--green);
  box-shadow: 0 0 0 0 rgba(9,206,120,.4);
  animation: fadeUp .5s ease both, pulseGlow 3s ease-in-out 0.6s infinite;
}

/* NO state */
.verdict-wrap.is-no {
  background: linear-gradient(145deg, #fff0f7 0%, #ffe0ef 100%);
  border: 2px solid var(--pink);
  box-shadow: var(--shadow-md);
  animation: fadeUp .5s ease both, shakeOnce 0.6s ease 0.5s both;
}

.verdict-icon {
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.12));
  animation: iconPop .6s cubic-bezier(0.34, 1.56, 0.64, 1) .15s both;
}

.verdict-text {
  font-size: clamp(3rem, 14vw, 8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  animation: iconPop .6s cubic-bezier(0.34, 1.56, 0.64, 1) .25s both;
}

.is-yes .verdict-text { color: var(--green-dark); }
.is-no  .verdict-text { color: var(--pink); }

.verdict-sub {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
  color: var(--text-mid);
  text-align: center;
  max-width: 480px;
  animation: fadeUp .5s ease .4s both;
}

/* ── Reason tags ─────────────────────────────── */
.reason-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.reason-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(226,0,118,.08);
  border: 1px solid rgba(226,0,118,.25);
  color: var(--pink);
  font-size: .85rem;
  font-weight: 700;
  animation: fadeUp .4s ease both;
}

/* ── Weather strip ───────────────────────────── */
.weather-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  width: 100%;
  animation: fadeUp .5s ease .3s both;
}

.weather-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.weather-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.weather-card__icon { font-size: 1.6rem; }

.weather-card__value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -.01em;
}

.weather-card__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  text-align: center;
}

/* Highlight bad-value cards */
.weather-card.is-bad .weather-card__value { color: var(--pink); }
.weather-card.is-bad { border-color: rgba(226,0,118,.3); background: #fff5fa; }

.weather-card.is-key { border-color: rgba(9,206,120,.4); }
.weather-card.is-key.is-bad { border-color: rgba(226,0,118,.4); background: #fff5fa; }

/* ── Footer ──────────────────────────────────── */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 14px clamp(16px, 4vw, 48px);
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: .8rem;
  color: var(--text-light);
  font-weight: 700;
}

.footer-sep { opacity: .4; margin: 0 2px; }

.footer-credit a {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-credit a:hover { color: var(--green); }

#countdown { color: var(--green-dark); font-weight: 800; }

/* ── Animations ──────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes iconPop {
  from { opacity: 0; transform: scale(.5); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0  0px rgba(9,206,120,.35); }
  50%       { box-shadow: 0 0 0 16px rgba(9,206,120,.0); }
}

@keyframes shakeOnce {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX(7px); }
  45%  { transform: translateX(-5px); }
  60%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
  .site-header { height: 56px; }
  .logo-img { height: 28px; }
  .header-label { display: none; }

  .weather-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Sky background ──────────────────────────────── */
.sky-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sky-particles { width: 100%; height: 100%; position: relative; }

/* Sunny — rotating rays emanate from top-right */
.sun-wrap {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  animation: sunSpin 20s linear infinite;
}

.sun-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 6px;
  margin-top: -3px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(255,210,60,.18) 0%, transparent 100%);
  border-radius: 3px;
}

[data-sky="sunny"] .sky-bg {
  background: radial-gradient(ellipse at 95% 0%, rgba(255,220,80,.12) 0%, transparent 60%);
}

/* Rainy — falling drops */
.rain-drop {
  position: absolute;
  top: -20px;
  width: 2px;
  height: 18px;
  background: linear-gradient(180deg, transparent, rgba(80,130,200,.5));
  border-radius: 2px;
  animation: rainFall linear infinite;
}

[data-sky="rainy"] .sky-bg {
  background: linear-gradient(180deg, rgba(100,130,180,.06) 0%, transparent 100%);
}

/* ── Key badge (feels-like card) ─────────────────── */
/* subtle green border to signal it's the decision metric */

/* ── Sunny verdict modifier ──────────────────────── */
.verdict-wrap.is-yes.is-sunny {
  background: linear-gradient(145deg, #fffbe8 0%, #fff3b0 100%);
  border-color: #f0c000;
  animation: fadeUp .5s ease both, sunnyPulse 3s ease-in-out 0.6s infinite;
}

.verdict-wrap.is-yes.is-sunny .verdict-text { color: #c8900a; }

/* ── Extra animations ────────────────────────────── */
@keyframes sunSpin {
  to { transform: rotate(360deg); }
}

@keyframes rainFall {
  from { transform: translateY(-20px); }
  to   { transform: translateY(100vh); }
}

@keyframes sunnyPulse {
  0%, 100% { box-shadow: 0 0 0  0px rgba(240,192,0,.35); }
  50%       { box-shadow: 0 0 0 16px rgba(240,192,0,.0); }
}

/* Ensure main content sits above sky bg */
.site-header, .main-content, .site-footer { position: relative; z-index: 1; }
