/* ================================
   Absolute Teamsport – Adventskalender
   Global Styles
   ================================ */

:root {
  --bg: #020712;
  --bg-card: #07111f;
  --bg-card-soft: #0b1727;
  --primary: #78be20;
  --primary-soft: rgba(120, 190, 32, 0.16);
  --primary-strong: #9cff3b;
  --text: #f5f7fb;
  --muted: #9197aa;
  --danger: #ff4b6b;
  --border-soft: rgba(255, 255, 255, 0.05);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.65);
  --radius-card: 22px;
  --radius-pill: 999px;
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
  --door-locked-bg: linear-gradient(145deg, #101a28, #050c18);
  --door-open-bg: radial-gradient(circle at 0 0, rgba(120,190,32,0.25), #050b16);
  --door-hover-bg: radial-gradient(circle at 0 0, rgba(120,190,32,0.4), #050b16);
}

/* Reset & Basics */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #07152b 0, #020712 45%, #000 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* z-Stack: Schnee liegt oben drüber, sonst nix */

body {
  position: relative;
}

/* Layout – Page & Card */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 32px 16px 40px;
}

.card {
  position: relative;
  overflow: visible;        /* wichtig, damit der Weihnachtsmann rausgucken darf */
  max-width: 1200px;
  margin: 40px auto;
  padding: 24px 28px 32px;
  border-radius: 18px;
  background: radial-gradient(circle at top left, #131824 0, #05070b 55%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.75);
}

/* Weihnachtsmann, der rechts hinter der Karte hervorschaut (Desktop/Tablet) */
.card::after {
  content: "";
  position: absolute;
  right: -80px;           /* wie weit er „rausguckt“ */
  bottom: 0;
  width: 220px;
  height: 320px;
  background: url("../assets/santa-peek.png") no-repeat center bottom;
  background-size: contain;
  pointer-events: none;   /* nicht anklickbar */
  opacity: 0.98;
  z-index: 3;
}

/* Card Glow */

.card::before {
  content: "";
  position: absolute;
  inset: -160px -220px auto auto;
  background: radial-gradient(circle at top right, rgba(120, 190, 32, 0.12), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

/* Header */

.header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* Logo Row – ATS Dreifach-Logo */

.logo-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-row img {
  height: 34px;
  display: block;
}

/* Claim */

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--muted);
}

/* Header Right – Buttons / Nav */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */

.btn,
.btn-secondary {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), opacity var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #021204;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0),
    0 12px 30px rgba(120, 190, 32, 0.25);
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(120, 190, 32, 0.36);
}

.btn-secondary {
  background: rgba(6, 13, 25, 0.8);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: #050b16;
  border-color: var(--primary-soft);
}

/* Copy / Introtexte */

h1 {
  margin: 26px 0 6px;
  font-size: 26px;
  letter-spacing: 0.03em;
}

.subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

/* Calendar Grid */

.calendar-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

/* Türchen-Tiles
   ================================================== */

.door-tile {
  position: relative;
  padding: 16px 14px 15px;
  border-radius: 18px;
  background: var(--door-locked-bg);
  border: 1px solid var(--border-soft);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    background var(--transition-med), border-color var(--transition-med),
    filter var(--transition-med), opacity var(--transition-med);
}

/* Schnee + Raureif auf den Türchen */
.door-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 8%,  rgba(255,255,255,0.55) 0, rgba(255,255,255,0) 34%),
    radial-gradient(circle at 80% 16%, rgba(255,255,255,0.45) 0, rgba(255,255,255,0) 38%),
    radial-gradient(circle at 30% 70%, rgba(255,255,255,0.40) 0, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 75% 85%, rgba(255,255,255,0.35) 0, rgba(255,255,255,0) 42%);
  background-repeat: no-repeat;
  opacity: 0.7;
  box-shadow:
    0 -4px 8px rgba(255,255,255,0.28) inset,
    0 -2px 3px rgba(255,255,255,0.55) inset;
}

/* Standard-Weihnachts-Icon auf jedem Türchen */
.door-tile::after {
  content: "🎄";
  position: absolute;
  font-size: 22px;
  top: 8px;
  right: 12px;
  pointer-events: none;
}

/* Abwechslung pro Türchen – andere Icons & Ecken */
.calendar-grid a:nth-child(4n+1).door-tile::after {
  content: "🎄";
  top: 8px;
  right: 12px;
}

.calendar-grid a:nth-child(4n+2).door-tile::after {
  content: "⭐";
  top: 8px;
  left: 12px;
}

.calendar-grid a:nth-child(4n+3).door-tile::after {
  content: "🎁";
  bottom: 8px;
  right: 12px;
}

.calendar-grid a:nth-child(4n+4).door-tile::after {
  content: "🕯️";
  bottom: 8px;
  left: 12px;
}

/* Türchen noch gesperrt */
.door-locked {
  cursor: default;
  opacity: 0.85;
}

/* Hover für „echte“ Links */
.door-clickable {
  cursor: pointer;
}

.door-clickable:hover {
  background: var(--door-hover-bg);
  border-color: var(--primary-soft);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

/* Zahlen & Texte im Türchen */
.door-day {
  font-size: 22px;
  font-weight: 700;
}

.door-label {
  font-size: 13px;
  color: var(--muted);
}

.door-status-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* Schloss-Icon unten */
.lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 9px;
}

/* Badge „geöffnet“ */
.badge-open {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(120, 190, 32, 0.14);
  color: var(--primary-strong);
  border: 1px solid rgba(120, 190, 32, 0.4);
}

/* Icons auf ganz kleinen Screens etwas kleiner */
@media (max-width: 540px) {
  .door-tile::after {
    font-size: 18px;
  }
}

/* bereits geöffnet */

.door-opened {
  background: var(--door-open-bg);
  border-color: rgba(120, 190, 32, 0.55);
}

/* ================================
   Weihnachts-Optik auf den Türchen
   ================================ */

/* leichter Schneelayer auf jedem Türchen */
.calendar-grid .door-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,0.45) 0, rgba(255,255,255,0) 35%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.35) 0, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 30% 70%, rgba(255,255,255,0.3) 0, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 70% 85%, rgba(255,255,255,0.25) 0, rgba(255,255,255,0) 45%);
  background-repeat: no-repeat;
  opacity: 0.25;
  mix-blend-mode: screen;
}

/* Standard-Icon (falls keine nth-child-Regel greift) */
.calendar-grid .door-tile::after {
  content: "🎄";
  position: absolute;
  font-size: 22px;
  top: 8px;
  right: 12px;
  pointer-events: none;
}

/* Variation der Icons & Positionen für unterschiedliche Türchen */
.calendar-grid a:nth-child(4n+1).door-tile::after {
  content: "🎄";
  top: 8px;
  right: 12px;
}

.calendar-grid a:nth-child(4n+2).door-tile::after {
  content: "⭐";
  top: 8px;
  left: 12px;
}

.calendar-grid a:nth-child(4n+3).door-tile::after {
  content: "🎁";
  bottom: 8px;
  right: 12px;
}

.calendar-grid a:nth-child(4n+4).door-tile::after {
  content: "🕯️";
  bottom: 8px;
  left: 12px;
}

/* Icons auf Handy etwas kleiner, damit sie nix überdecken */
@media (max-width: 540px) {
  .calendar-grid .door-tile::after {
    font-size: 18px;
  }
}

/* Tür-Inhalt */

.door-day {
  font-size: 22px;
  font-weight: 700;
}

.door-label {
  font-size: 13px;
  color: var(--muted);
}

/* Statuszeile unten */

.door-status-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* Schloss-Icon */

.lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 9px;
}

/* Kleine Badge */

.badge-open {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(120, 190, 32, 0.14);
  color: var(--primary-strong);
  border: 1px solid rgba(120, 190, 32, 0.4);
}

/* Footer */

.footer-links {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Forms (Login / Register / Admin) */

.form-layout {
  margin-top: 28px;
  display: flex;
  gap: 40px;
}

.form-panel {
  width: 100%;
  max-width: 420px;
}

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: var(--muted);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
input[type="number"],
textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 11, 20, 0.95);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

input:focus,
textarea:focus {
  border-color: rgba(120, 190, 32, 0.7);
  box-shadow: 0 0 0 1px rgba(120, 190, 32, 0.25);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 75, 107, 0.1);
  border: 1px solid rgba(255, 75, 107, 0.6);
  font-size: 13px;
}

/* Door-Detail Seite */

.door-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1.3fr);
  gap: 24px;
}

.door-detail-headline {
  font-size: 22px;
  margin: 0 0 6px;
}

.door-teaser {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.door-content {
  font-size: 14px;
  line-height: 1.6;
}

.door-content p {
  margin: 0 0 10px;
}

.door-image-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.door-image-card img {
  width: 100%;
  display: block;
  border-radius: 14px;
}

/* Simple Tür-Opening-Animation Overlay */

.door-animation-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #05142b 0, #000 60%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.door-animation-overlay.active {
  display: flex;
}

.door-animation-inner {
  width: min(360px, 80vw);
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at top, #0c1830 0, #02040a 50%, #000 100%);
}

/* Türenhälften */

.door-half {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #111b2f, #050b16);
  transform-origin: left center;
  animation: doorOpen 1.4s ease forwards;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
}

/* rechte Hälfte spiegelt nur, damit es wie eine echte Tür wirkt */

.door-half.right {
  transform-origin: right center;
}

@keyframes doorOpen {
  0% {
    transform: perspective(1400px) rotateY(0deg);
  }
  100% {
    transform: perspective(1400px) rotateY(-90deg);
  }
}

/* Glow dahinter */

.door-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(120, 190, 32, 0.3), transparent 60%);
  opacity: 0;
  animation: doorGlow 1.6s ease forwards;
}

@keyframes doorGlow {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Konfetti (einfach Punkte, schwarz/grün/weiß) */

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Snow Layer – echte Flocken */

.snow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0.9;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  animation-name: snowFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes snowFall {
  0% {
    transform: translate3d(0, -10px, 0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 110vh, 0);
    opacity: 0;
  }
}

/* Responsive */

@media (max-width: 1024px) {
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .door-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .card {
    padding: 22px 18px 20px;
    border-radius: 24px;
    margin: 24px auto 40px;
  }

  .page {
    padding: 24px 12px 180px; /* unten etwas mehr Platz, weil Santa am Displayrand sitzt */
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  h1 {
    font-size: 22px;
  }

  .logo-row img {
    height: 28px;
  }

  .footer-links {
    flex-direction: column;
    gap: 6px;
  }

  /* Auf mobilen Geräten: Weihnachtsmann unten am Displayrand andocken
     und ein Stück in den Screen reinholen */
  .card::after {
    position: fixed;
    right: 10px;     /* vorher -10px => jetzt etwas weiter im Bild */
    bottom: -8px;
    width: 180px;
    height: 250px;
    z-index: 4;       /* über der Karte, unter dem Schnee */
  }
}

@media (max-width: 540px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .door-tile {
    padding: 14px 11px 13px;
  }

  .door-day {
    font-size: 20px;
  }

  .logo-row img {
    height: 24px;
  }

  /* auf ganz kleinen Geräten Santa etwas kleiner, aber sichtbar im Bild */
  .card::after {
    width: 150px;
    height: 210px;
    right: 5px;   /* etwas weiter in den Screen */
    bottom: -12px;
  }
}

/* ===========================================
   HARTE WEIHNACHTS-DEKO FÜR DIE TÜRCHEN
   (wird alles davor überstimmen)
   =========================================== */

.door-tile {
  position: relative;
  overflow: hidden; /* damit der Schnee nicht übersteht */
}

/* Schneeschicht oben auf jedem Türchen */
.door-tile::before {
  content: "" !important;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.8) 0%,
      rgba(255,255,255,0.15) 25%,
      rgba(255,255,255,0) 55%
    ),
    radial-gradient(circle at 15% 15%, rgba(255,255,255,0.6) 0, rgba(255,255,255,0) 40%);
  opacity: 0.6;
  mix-blend-mode: screen;
  z-index: 1;
}

/* Weihnachts-Icon (Emoji) auf jedem Türchen */
.door-tile::after {
  content: "🎄" !important;
  position: absolute;
  font-size: 22px;
  top: 8px;
  right: 10px;
  pointer-events: none;
  z-index: 2;
}

/* Abwechslung: andere Emojis / Positionen je nach Türchen */
.calendar-grid .door-tile:nth-child(4n+1)::after {
  content: "🎄" !important;
  top: 8px;
  right: 10px;
}

.calendar-grid .door-tile:nth-child(4n+2)::after {
  content: "⭐" !important;
  top: 8px;
  left: 10px;
}

.calendar-grid .door-tile:nth-child(4n+3)::after {
  content: "🎁" !important;
  bottom: 8px;
  right: 10px;
}

.calendar-grid .door-tile:nth-child(4n+4)::after {
  content: "🕯️" !important;
  bottom: 8px;
  left: 10px;
}

/* Auf kleineren Screens Icons etwas kleiner */
@media (max-width: 540px) {
  .door-tile::after {
    font-size: 18px !important;
  }
}

/* ============================================
   Weihnachtslook für eingeloggten Kalender
   (.door-tile in calendar.php)
   ============================================ */

.calendar-grid .door-tile {
  position: relative;
  overflow: hidden; /* damit Schnee & Icons sauber im Tile bleiben */
}

/* Schneekappe / Raureif oben auf jedem Türchen */
.calendar-grid .door-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* oben viel Schnee, nach unten auslaufend */
  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.90) 0%,
      rgba(255,255,255,0.35) 26%,
      rgba(255,255,255,0.05) 50%,
      rgba(255,255,255,0) 70%
    ),
    radial-gradient(circle at 18% 12%, rgba(255,255,255,0.55) 0, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 80% 10%, rgba(255,255,255,0.45) 0, rgba(255,255,255,0) 38%);
  opacity: 0.75;
  mix-blend-mode: screen;
  z-index: 0; /* Schnee ist Teil des Hintergrunds, Text bleibt gut lesbar */
}

/* Standard-Icon (falls keine nth-Regel greift) – oben rechts */
.calendar-grid .door-tile::after {
  content: "🎄";
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 22px;
  pointer-events: none;
  z-index: 2;
}

/* Abwechslung: verschiedene Emojis + Ecken, immer oben */
.calendar-grid .door-tile:nth-child(6n+1)::after {
  content: "🎄";        /* Tannenbaum, oben rechts */
  top: 6px;
  right: 10px;
}

.calendar-grid .door-tile:nth-child(6n+2)::after {
  content: "❄️";       /* Schneeflocke, oben links */
  top: 6px;
  left: 10px;
}

.calendar-grid .door-tile:nth-child(6n+3)::after {
  content: "⛄";        /* Schneemann, oben rechts */
  top: 6px;
  right: 10px;
}

.calendar-grid .door-tile:nth-child(6n+4)::after {
  content: "⭐";        /* Stern, oben links */
  top: 6px;
  left: 10px;
}

.calendar-grid .door-tile:nth-child(6n+5)::after {
  content: "🎁";        /* Geschenk, oben rechts */
  top: 6px;
  right: 10px;
}

.calendar-grid .door-tile:nth-child(6n+6)::after {
  content: "🧦";        /* Weihnachtsstrümpfe, oben links */
  top: 6px;
  left: 10px;
}

/* auf ganz kleinen Screens: Icons etwas kleiner */
@media (max-width: 540px) {
  .calendar-grid .door-tile::after {
    font-size: 18px;
    top: 4px;
  }
}
