/* ========================================================================
   35LINE MAN CAVE — VISUAL WOW STACK
   Atmospheric (B) + Interactive (D)
   - B1 Weather-synced hero    (body[data-weather])
   - B2 Time-of-day overlay    (body[data-time])
   - B3 Dust particles         (canvas#vw-dust)
   - B4 Floor reflection       (.bike-card .bike-card-img / .modal-bike-photo)
   - D1 Glass morphism         (.fleet-card / .modal-card)
   - D2 Magnetic buttons       (added via JS, pure transform)
   ======================================================================== */

/* ------------------------------------------------------------------ */
/*  Dust particles — canvas overlay                                   */
/* ------------------------------------------------------------------ */
#vw-dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;            /* above hero media, below content */
  opacity: 0.55;
  mix-blend-mode: screen;
}

/* light-beam gradient that the dust floats through (any hero variant) */
.hero,
.about-hero,
.brand-hero,
.err-wrap,
.booked-wrap {
  position: relative;
}
.hero::before,
.about-hero::before,
.brand-hero::before,
.err-wrap::before,
.booked-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 70% 60% at 80% 0%,
      rgba(255, 200, 150, 0.10),
      transparent 60%
    ),
    linear-gradient(
      115deg,
      transparent 40%,
      rgba(255, 200, 150, 0.06) 50%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

/* ------------------------------------------------------------------ */
/*  Time-of-Day — data-time = dawn|day|dusk|night                     */
/* ------------------------------------------------------------------ */
.hero::after,
.about-hero::after,
.brand-hero::after,
.err-wrap::after,
.booked-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: soft-light;
  transition: opacity 1.2s ease;
  background: transparent;
}
body[data-time="dawn"]  .hero::after,
body[data-time="dawn"]  .about-hero::after,
body[data-time="dawn"]  .brand-hero::after,
body[data-time="dawn"]  .err-wrap::after,
body[data-time="dawn"]  .booked-wrap::after { background: linear-gradient(180deg, rgba(255,170,120,0.18), transparent 50%); }
body[data-time="day"]   .hero::after,
body[data-time="day"]   .about-hero::after,
body[data-time="day"]   .brand-hero::after,
body[data-time="day"]   .err-wrap::after,
body[data-time="day"]   .booked-wrap::after { background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 60%); }
body[data-time="dusk"]  .hero::after,
body[data-time="dusk"]  .about-hero::after,
body[data-time="dusk"]  .brand-hero::after,
body[data-time="dusk"]  .err-wrap::after,
body[data-time="dusk"]  .booked-wrap::after { background: linear-gradient(180deg, rgba(255,90,60,0.20), transparent 60%); }
body[data-time="night"] .hero::after,
body[data-time="night"] .about-hero::after,
body[data-time="night"] .brand-hero::after,
body[data-time="night"] .err-wrap::after,
body[data-time="night"] .booked-wrap::after {
  background:
    radial-gradient(ellipse 60% 50% at 30% 80%, rgba(107,140,255,0.14), transparent 60%),
    linear-gradient(180deg, rgba(10,10,30,0.30), transparent 60%);
}

/* ------------------------------------------------------------------ */
/*  Weather — body[data-weather] = clear|rain|cloud|night              */
/* ------------------------------------------------------------------ */
/* Rain — diagonal subtle streaks (CSS only, lightweight) */
body[data-weather="rain"] #vw-weather {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image:
    linear-gradient(115deg,
      transparent 0%,
      rgba(180, 200, 220, 0.05) 40%,
      rgba(180, 200, 220, 0.10) 50%,
      transparent 60%);
  background-size: 2px 100vh;
  animation: vw-rain 0.6s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.9;
}
@keyframes vw-rain {
  from { background-position: 0 0; }
  to   { background-position: 0 100vh; }
}

/* Cloudy — dimmer, cooler palette */
body[data-weather="cloud"] .hero-overlay {
  background:
    linear-gradient(180deg, rgba(20, 25, 35, 0.55), rgba(10, 12, 18, 0.85)) !important;
}

/* Clear day — slight warm glow on hero */
body[data-weather="clear"] .hero-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 75% 20%, rgba(255, 180, 100, 0.10), transparent 70%);
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/*  Floor reflection — soft drop shadow under bike media               */
/* ------------------------------------------------------------------ */
.bike-card .bike-media { position: relative; }
.bike-card .bike-media::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -6px;
  height: 10px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.65) 0%, transparent 70%);
  filter: blur(5px);
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.bike-card:hover .bike-media::after {
  opacity: 0.95;
  transform: scaleX(1.08);
}

/* ------------------------------------------------------------------ */
/*  Glass morphism — bike cards (.bike-card is dynamic, used both pages)*/
/* ------------------------------------------------------------------ */
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .bike-card {
    background: rgba(20, 20, 22, 0.55) !important;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 4px 18px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.25s cubic-bezier(.2,.8,.2,1),
                box-shadow 0.25s ease,
                border-color 0.25s ease;
  }
  .bike-card:hover {
    transform: translateY(-3px);
    border-color: rgba(229, 54, 44, 0.35);
    box-shadow:
      0 12px 32px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(229, 54, 44, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

/* ------------------------------------------------------------------ */
/*  Magnetic buttons — base transition                                 */
/*  (the actual magnet pull is JS — this just smooths it out)          */
/* ------------------------------------------------------------------ */
.btn,
.btn-primary,
.btn-ghost {
  transition: transform 0.18s cubic-bezier(.2,.8,.2,1),
              background 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  will-change: transform;
}

.vw-magnetic {
  /* Class added by JS to opt-in. Right now we apply to .btn-primary only */
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}

/* ------------------------------------------------------------------ */
/*  Language Toggle (TH ↔ EN)                                          */
/* ------------------------------------------------------------------ */
.vw-lang-toggle {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 1250;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1),
              background 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.vw-lang-toggle:hover {
  background: rgba(229, 54, 44, 0.85);
  border-color: rgba(229, 54, 44, 1);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(229, 54, 44, 0.4);
}
/* First-time pulse so foreigners notice it */
.vw-lang-toggle.vw-lang-pulse {
  animation: vw-lang-attention 1.4s ease-in-out 3;
}
@keyframes vw-lang-attention {
  0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
  50%      { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
                         0 0 0 6px rgba(229, 54, 44, 0.0),
                         0 0 24px rgba(229, 54, 44, 0.55); }
}
.vw-lang-flag { font-size: 14px; }
.vw-lang-label { letter-spacing: 0.12em; }

/* Brief flash effect when language switches */
.vw-lang-flash {
  animation: vw-flash 0.28s ease;
}
@keyframes vw-flash {
  0%   { opacity: 1; }
  40%  { opacity: 0.55; }
  100% { opacity: 1; }
}

/* Don't let the lang toggle overlap the cookie banner */
.cookie-consent ~ .vw-lang-toggle,
body:has(.cookie-consent.is-visible) .vw-lang-toggle {
  bottom: 96px;
}

/* Mobile: keep button reachable, smaller margin */
@media (max-width: 600px) {
  .vw-lang-toggle {
    bottom: 14px;
    left: 14px;
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* ------------------------------------------------------------------ */
/*  Reduced motion — turn it all off                                  */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  #vw-dust,
  body[data-weather="rain"] #vw-weather,
  .hero::before,
  body[data-time] .hero::after { display: none !important; }
  .bike-card { transition: none !important; transform: none !important; }
}
