/* ==========================================================================
   BMX Projekt – Design Theme
   Vereinsfarben: Gelb (#ffe600) / Schwarz / Weiß
   Wird NACH den Inline-Styles geladen und verfeinert das Design global.
   ========================================================================== */

:root {
  --bmx-yellow: #ffe600;
  --bmx-yellow-soft: rgba(255, 230, 0, 0.15);
  --bmx-black: #0a0a0a;
  --bmx-dark: #121212;
  --bmx-white: #fafafa;
}

/* --------------------------------------------------------------------------
   Grundstimmung: feiner Verlauf statt flacher Fläche
   -------------------------------------------------------------------------- */
body {
  background-color: var(--bmx-dark);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 230, 0, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 255, 255, 0.02), transparent);
  background-attachment: scroll;
  color: var(--bmx-white);
}

/* Textauswahl in Vereinsgelb */
::selection {
  background: var(--bmx-yellow);
  color: var(--bmx-black);
}

/* Schlanke Scrollbar in Vereinsfarben */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--bmx-yellow) var(--bmx-black);
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bmx-black); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--bmx-yellow), #b3a100);
  border-radius: 6px;
  border: 2px solid var(--bmx-black);
}

/* Tastatur-Fokus deutlich sichtbar */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--bmx-yellow);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Navigation: animierte Unterstreichung
   -------------------------------------------------------------------------- */
header nav a {
  position: relative;
  padding-bottom: 4px;
}
header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--bmx-yellow);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
header nav a:hover::after,
header nav a.text-neon::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Logo leicht vergrößern beim Hover */
header a img {
  transition: transform 0.3s ease, filter 0.3s ease;
}
header a:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(255, 230, 0, 0.4));
}

/* --------------------------------------------------------------------------
   Überschriften: Neon-Akzente bekommen einen weichen Schein
   -------------------------------------------------------------------------- */
h1 .text-neon,
h2 .text-neon {
  text-shadow: 0 0 30px rgba(255, 230, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Buttons: Verlauf + Glanz-Effekt beim Hover
   -------------------------------------------------------------------------- */
.btn-neon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fff176 0%, var(--bmx-yellow) 40%, #e6cf00 100%);
  color: var(--bmx-black);
  box-shadow: 0 0 12px rgba(255, 230, 0, 0.25);
  transition: all 0.3s ease;
}
.btn-neon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-neon:hover::before { left: 125%; }
.btn-neon:hover {
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.55);
  transform: translateY(-2px);
}

.btn-outline-neon {
  border: 2px solid var(--bmx-yellow);
  color: var(--bmx-yellow);
  transition: all 0.3s ease;
}
.btn-outline-neon:hover,
.btn-outline-neon.active {
  background: var(--bmx-yellow);
  color: var(--bmx-black);
  box-shadow: 0 0 18px rgba(255, 230, 0, 0.45);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Karten: sanftes Anheben + gelber Rahmen-Schimmer
   -------------------------------------------------------------------------- */
.card-hover,
.news-item,
.race-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.card-hover:hover,
.news-item:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 230, 0, 0.5);
  box-shadow:
    0 14px 35px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 230, 0, 0.08);
}

/* Bilder in Karten beim Hover sanft zoomen */
.news-item > div:first-child,
.card-hover > div:first-child {
  overflow: hidden;
}
.news-item > div:first-child {
  transition: transform 0.5s ease;
}
.news-item:hover > div:first-child {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Timeline (Rennsport): pulsierender Punkt für aktive Rennen
   -------------------------------------------------------------------------- */
@keyframes bmx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}
.timeline-dot[style*="background:#fff"] {
  animation: bmx-pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Footer & Social Icons
   -------------------------------------------------------------------------- */
footer {
  background:
    linear-gradient(180deg, rgba(255, 230, 0, 0.03), transparent 40%),
    #000;
}
footer .fa-instagram:hover,
footer .fa-facebook-square:hover,
footer .fa-youtube:hover {
  filter: drop-shadow(0 0 6px rgba(255, 230, 0, 0.6));
}

/* --------------------------------------------------------------------------
   Feinheiten
   -------------------------------------------------------------------------- */
/* Gelbe Trennlinie unter Section-Headern (nutzt vorhandene border-neon) */
.border-neon {
  border-color: rgba(255, 230, 0, 0.7) !important;
}

/* Tabellen: Zebra-Streifen für bessere Lesbarkeit */
.race-table tbody tr:nth-child(even):not(:hover) {
  background-color: rgba(255, 255, 255, 0.015);
}

/* Back-to-Top Button: sanfter Puls */
#backToTop {
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
#backToTop:hover {
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.7);
}

/* Cookie-Banner Buttons angleichen */
#cookie-banner button {
  transition: all 0.3s ease;
}

/* Weniger Bewegung für Nutzer, die das wünschen */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   LIGHT MODE
   Aktiv, wenn <html class="light"> gesetzt ist (Umschalter in der Navigation,
   gespeichert in localStorage via js/theme.js).
   ========================================================================== */

/* Umschalt-Button in der Navigation */
#theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 230, 0, 0.4);
  background: transparent;
  color: var(--bmx-yellow);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
#theme-toggle:hover {
  background: var(--bmx-yellow);
  color: var(--bmx-black);
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.5);
}
#theme-toggle .fa-moon { display: none; }
html.light #theme-toggle .fa-sun { display: none; }
html.light #theme-toggle .fa-moon { display: inline; }
html.light #theme-toggle {
  border-color: rgba(0, 0, 0, 0.25);
  color: #1a1a1a;
}
html.light #theme-toggle:hover {
  background: #1a1a1a;
  color: var(--bmx-yellow);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* ---- Flächen ---- */
html.light body {
  background-color: #f5f5f2;
  color: #1a1a1a;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 230, 0, 0.10), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 0, 0, 0.03), transparent);
}
html.light .bg-dark { background-color: #f5f5f2; }
html.light .bg-darker { background-color: #ffffff; }
html.light .bg-black { background-color: #ebebe8; }
html.light .bg-darker\/95 { background-color: rgba(255, 255, 255, 0.95); }
/* Navbar bleibt im Light-Mode hell – egal welche Variante der Scroll-Handler setzt */
html.light #navbar,
html.light .bg-darker\/90 { background-color: rgba(255, 255, 255, 0.95) !important; }

/* ---- Texte ---- */
html.light .text-white { color: #161616; }
html.light .text-gray-300 { color: #3f3f46; }
html.light .text-gray-400 { color: #52525b; }
html.light .text-gray-500 { color: #6b7280; }

/* Gelb auf Weiß ist unleserlich – im Light Mode dunkleres Vereinsgelb */
html.light .text-neon { color: #9c8400; }
html.light .hover\:text-neon:hover { color: #9c8400; }
html.light h1 .text-neon,
html.light h2 .text-neon { text-shadow: none; }
html.light .btn-outline-neon { border-color: #9c8400; color: #9c8400; }
html.light .btn-outline-neon:hover,
html.light .btn-outline-neon.active {
  background: var(--bmx-yellow);
  color: var(--bmx-black);
  border-color: var(--bmx-yellow);
}

/* ---- Rahmen ---- */
html.light .border-gray-800,
html.light .border-gray-700,
html.light .border-gray-600 { border-color: #e2e2dd; }

/* ---- Logo: weißes Logo auf hellem Header invertieren ---- */
html.light header img[src*="BMX_Logo_weiss"] {
  filter: invert(1) hue-rotate(180deg);
}
html.light header a:hover img {
  filter: invert(1) hue-rotate(180deg) drop-shadow(0 0 8px rgba(0, 0, 0, 0.3));
}

/* ---- Hero-Bereiche mit Foto-Hintergrund: Text bleibt hell ---- */
html.light section[class*="bg-[url"] .text-white,
html.light .hero-bg .text-white { color: #ffffff; }
html.light section[class*="bg-[url"] .text-gray-300,
html.light section[class*="bg-[url"] .text-gray-400,
html.light .hero-bg .text-gray-300,
html.light .hero-bg .text-gray-400 { color: #d1d5db; }
html.light section[class*="bg-[url"] .text-neon,
html.light .hero-bg .text-neon { color: var(--bmx-yellow); }

/* ---- Artikel ---- */
html.light .article-content p { color: #4b5563; }
html.light .article-content h3 { color: #161616; }
html.light .article-content blockquote { color: #374151; background: rgba(255, 230, 0, 0.12); }

/* ---- Formulare (Sponsoren / Training) ---- */
html.light input,
html.light select,
html.light textarea {
  background-color: #ffffff;
  border-color: #d4d4ce;
  color: #161616;
}

/* ---- Google-Maps-Karten im Light-Mode normal (ohne Dark-Filter) ---- */
html.light .map-dark { filter: none; }

/* ---- Pastellfarbene Badges: auf hellem Grund kräftigere Töne ---- */
html.light .text-yellow-300 { color: #854d0e; }
html.light .text-blue-300 { color: #1d4ed8; }
html.light .text-red-300 { color: #b91c1c; }
html.light .text-purple-300 { color: #7e22ce; }
html.light .text-green-300 { color: #15803d; }
html.light .text-green-400 { color: #15803d; }
html.light .text-amber-300 { color: #92400e; }
html.light .text-cyan-300 { color: #0e7490; }

/* ---- Rennsport: Timeline & Tabelle ---- */
html.light .timeline-container::before { background: #d6d6d0; }
html.light .race-table th { background-color: #161616; color: var(--bmx-yellow); }
html.light .race-table tr { border-bottom-color: #e2e2dd; }
html.light .race-table tr:hover { background-color: rgba(255, 230, 0, 0.15); }
html.light .race-table tbody tr:nth-child(even):not(:hover) { background-color: rgba(0, 0, 0, 0.025); }

/* Weißer "Nächstes Rennen"-Punkt wäre auf hellem Grund unsichtbar */
@keyframes bmx-pulse-dark {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
}
html.light .timeline-dot[style*="background:#fff"] {
  background: #161616 !important;
  animation: bmx-pulse-dark 2s ease-in-out infinite;
}

/* ---- Footer & Scrollbar ---- */
html.light footer {
  background: linear-gradient(180deg, rgba(255, 230, 0, 0.06), transparent 40%), #ebebe8;
}
html.light { scrollbar-color: var(--bmx-yellow) #e5e5e0; }
html.light ::-webkit-scrollbar-track { background: #e5e5e0; }
html.light ::-webkit-scrollbar-thumb { border-color: #e5e5e0; }
