/**
 * FFK Modern - Weihnachtsmodus (Craft Edition)
 * Freies Fanfarenkorps Alt-Laatzen e. V. 1991
 * High-End Festive Styling, Micro-Interactions & Anti-Slop Discipline
 */

/* ==========================================================================
   1. WEIHNACHTS-DESIGNTOKENS & ROOT PROPERTIES
   ========================================================================== */
:root {
  --xmas-red: #dc2626;
  --xmas-darkred: #991b1b;
  --xmas-gold: #f59e0b;
  --xmas-lightgold: #fef3c7;
  --xmas-green: #059669;
  --xmas-snow: #f8fafc;
  --xmas-ice: #e0f2fe;
  --xmas-ice-glow: rgba(56, 189, 248, 0.35);
  --xmas-gold-glow: rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   2. WEIHNACHTS-TOGGLE SWITCH (Im Header & Quick Drawer)
   ========================================================================== */
.ffk-xmas-toggle {
  display: none !important; /* Außerhalb der Weihnachtszeit (01.12. - 25.12.) standardmäßig unsichtbar */
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  user-select: none;
}

/* Nur während der Weihnachtszeit (01.12. - 25.12.) oder bei aktiver Vorschau anzeigen */
body.ffk-xmas-season .ffk-xmas-toggle,
body.ffk-xmas-active .ffk-xmas-toggle {
  display: inline-flex !important;
}

/* Fanko Weihnachtsgruß Button im Weihnachtsmodus hervorheben */
body.ffk-xmas-active .ffk-fanko-xmas-btn,
body.ffk-xmas-season .ffk-fanko-xmas-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.45) !important;
  animation: ffkXmasPulse 2.5s infinite ease-in-out;
}

@keyframes ffkXmasPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(220, 38, 38, 0.45); }
  50% { transform: scale(1.04); box-shadow: 0 0 20px rgba(245, 158, 11, 0.7); }
}

@media (max-width: 991px) {
  /* Auf mobilen Geräten Desktop-Header-Toggle verbergen, im Drawer belassen */
  body.ffk-xmas-season .ffk-header-actions .ffk-xmas-toggle,
  body.ffk-xmas-active .ffk-header-actions .ffk-xmas-toggle {
    display: none !important;
  }
}

.ffk-xmas-toggle:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #f59e0b;
  box-shadow: 0 4px 16px var(--xmas-gold-glow);
  transform: translateY(-1px);
}

.ffk-xmas-toggle:active {
  transform: scale(0.97);
}

.ffk-xmas-icon {
  font-size: 15px;
  display: inline-block;
  transition: transform 0.35s ease;
}

.ffk-xmas-toggle:hover .ffk-xmas-icon {
  transform: rotate(20deg) scale(1.15);
}

.ffk-xmas-switch {
  width: 32px;
  height: 18px;
  background: #334155;
  border-radius: 9999px;
  position: relative;
  transition: background-color 0.25s ease;
}

.ffk-xmas-switch-knob {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.ffk-xmas-active .ffk-xmas-toggle {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.85) 0%, rgba(153, 27, 27, 0.95) 100%);
  border-color: #fbbf24;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
}

body.ffk-xmas-active .ffk-xmas-switch {
  background: #15803d;
}

body.ffk-xmas-active .ffk-xmas-switch-knob {
  transform: translateX(14px);
  background: #fef3c7;
}

/* ==========================================================================
   3. SCHNEE-CANVAS (Hardware-beschleunigt, Null Layout-Shift)
   ========================================================================== */
#ffk-snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9990;
  display: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.ffk-xmas-active #ffk-snow-canvas {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   4. WEIHNACHTS-LICHTERKETTE (FAIRY LIGHTS) AN DER NAVIGATION
   ========================================================================== */
.ffk-xmas-lights {
  display: none;
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 100%;
  height: 18px;
  overflow: hidden;
  pointer-events: none;
  z-index: 100;
  background-repeat: repeat-x;
}

body.ffk-xmas-active .ffk-xmas-lights {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}

.ffk-light-bulb {
  width: 7px;
  height: 11px;
  border-radius: 50% 50% 40% 40%;
  position: relative;
  animation: ffkLightTwinkle 2.5s infinite ease-in-out;
}

.ffk-light-bulb::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 1.5px;
  width: 4px;
  height: 3px;
  background: #475569;
  border-radius: 1px;
}

.ffk-light-gold {
  background: #fbbf24;
  box-shadow: 0 2px 9px rgba(251, 191, 36, 0.8);
  animation-delay: 0s;
}

.ffk-light-red {
  background: #ef4444;
  box-shadow: 0 2px 9px rgba(239, 68, 68, 0.8);
  animation-delay: 0.6s;
}

.ffk-light-green {
  background: #10b981;
  box-shadow: 0 2px 9px rgba(16, 185, 129, 0.8);
  animation-delay: 1.2s;
}

.ffk-light-cyan {
  background: #38bdf8;
  box-shadow: 0 2px 9px rgba(56, 189, 248, 0.8);
  animation-delay: 1.8s;
}

@keyframes ffkLightTwinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); filter: brightness(1.25); }
}

/* ==========================================================================
   5. SCHNEEKAPPE AUF DEM VEREINSLOGO
   ========================================================================== */
.ffk-logo-snowcap {
  display: none;
  position: absolute;
  top: -8px;
  left: -2px;
  width: 44px;
  height: 20px;
  pointer-events: none;
  z-index: 10;
}

body.ffk-xmas-active .ffk-logo-snowcap {
  display: block;
}

/* ==========================================================================
   6. WEIHNACHTS-HERO BADGE & FESTLICHER AKZENT
   ========================================================================== */
.ffk-xmas-hero-badge {
  display: none;
  margin-bottom: 16px;
  animation: ffkFadeSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.ffk-xmas-active .ffk-xmas-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.22) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 9999px;
  color: #fef3c7;
  font-size: 13.5px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes ffkFadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   7. WEIHNACHTS-FANKO & WEIHNACHTSBAUM MIT GESCHENKEN
   ========================================================================== */
/* Mütze komplett deaktiviert - Fankos Originalkopf bleibt 100% frei */
.ffk-fanko-santa-hat {
  display: none !important;
}

/* Geschmückter 3D Weihnachtsbaum neben Drache Fanko */
.ffk-fanko-xmas-tree {
  display: none;
  position: absolute;
  bottom: 8px;
  left: -142px;
  width: 150px;
  height: auto;
  pointer-events: none;
  z-index: 1; /* Hinter Fanko, damit Fankos winkende Hand im Vordergrund glänzt */
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65));
  transform-origin: bottom center;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ffk-fanko-xmas-tree img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.35));
}

body.ffk-xmas-active .ffk-fanko-xmas-tree {
  display: block;
  animation: ffkTreeAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ffkTreeAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 640px) {
  .ffk-fanko-xmas-tree {
    left: -95px;
    width: 110px;
    bottom: 6px;
  }
}

body.ffk-xmas-active .ffk-fanko-badge-pill {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
  border-color: #fbbf24 !important;
  color: #fef3c7 !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5) !important;
}

/* Weihnachtlicher Button in Fankos Menü */
.ffk-fanko-xmas-btn {
  display: none;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.35) 0%, rgba(153, 27, 27, 0.5) 100%) !important;
  border: 1px solid #fbbf24 !important;
  color: #fef3c7 !important;
}

body.ffk-xmas-active .ffk-fanko-xmas-btn {
  display: inline-flex !important;
}

/* ==========================================================================
   8. FESTLICHE KARTEN- UND BORDER-EFFEKTE (SUBTIL & HOCHWERTIG)
   ========================================================================== */
body.ffk-xmas-active .ffk-glass-card,
body.ffk-xmas-active .ffk-meilenstein-card {
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

body.ffk-xmas-active .ffk-glass-card::before,
body.ffk-xmas-active .ffk-meilenstein-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #dc2626 0%, #fbbf24 50%, #059669 100%);
  opacity: 0.85;
  border-radius: 12px 12px 0 0;
  z-index: 2;
  pointer-events: none;
}

/* ==========================================================================
   9. FLIEGENDER WEIHNACHTSMANN-SCHLITTEN (EASTER EGG)
   ========================================================================== */
.ffk-santa-sleigh {
  position: fixed;
  top: 60px;
  left: -200px;
  width: 140px;
  height: 50px;
  pointer-events: none;
  z-index: 9995;
  opacity: 0;
  display: none;
}

body.ffk-xmas-active .ffk-santa-sleigh.ffk-flying {
  display: block;
  opacity: 0.85;
  animation: ffkFlyAcross 14s linear forwards;
}

@keyframes ffkFlyAcross {
  0% { transform: translateX(0) translateY(0); opacity: 0; }
  5% { opacity: 0.9; }
  50% { transform: translateX(calc(50vw + 100px)) translateY(30px); opacity: 0.95; }
  95% { opacity: 0.9; }
  100% { transform: translateX(calc(100vw + 400px)) translateY(-15px); opacity: 0; }
}

/* ==========================================================================
   10. WEIHNACHTS-HERO: FANKO WEIHNACHTSVIDEO STATT KLANGWELTEN-BOX
   ========================================================================== */
.ffk-hero-xmas-video-card {
  display: none;
  position: relative;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(220, 38, 38, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.ffk-hero-xmas-video-card:hover {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(245, 158, 11, 0.4);
}

/* Solange Weihnachtsmodus aktiv ist (01.12. - 25.12. oder ?xmas=1):
   Klangwelten-Box ausblenden und stattdessen das Weihnachtsvideo anzeigen! */
body.ffk-xmas-season .ffk-hero-stage-card,
body.ffk-xmas-active .ffk-hero-stage-card {
  display: none !important;
}

body.ffk-xmas-season .ffk-hero-xmas-video-card,
body.ffk-xmas-active .ffk-hero-xmas-video-card {
  display: block !important;
}

/* ==========================================================================
   11. BARRIEREFREIHEIT (PREFERS-REDUCED-MOTION)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  #ffk-snow-canvas,
  .ffk-santa-sleigh {
    display: none !important;
  }
  .ffk-fanko-santa-hat,
  .ffk-light-bulb {
    animation: none !important;
  }
}
