/* ============================================================
   GLOBAL STYLES (styles.css)
   ------------------------------------------------------------
   Diese Datei enthält allgemeine Layout-Anpassungen, Utility-
   Klassen und sorgt dafür, dass das Haupt-Layout flexibel ist,
   der Footer unten bleibt und der Cookie-Banner korrekt
   gestaltet ist.
============================================================ */

/* 1. GLOBALES LAYOUT & BODY-STILE
   ------------------------------------------------------------ */

/* Stellt sicher, dass die Seite immer die volle Höhe hat und der
   Footer nach unten gedrückt wird. */
body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Verhindert das Scrollen des Body, wenn das mobile Menü geöffnet ist.
   Wird per JavaScript gesteuert. */
body.no-scroll {
  overflow: hidden;
}

/* Sorgt dafür, dass der Hauptinhalt den verfügbaren Platz ausfüllt. */
main {
  flex-grow: 1;
}


/* 2. GLOBALE UTILITY- & ELEMENT-STILE
   ------------------------------------------------------------ */

/* Eine einfache Container-Klasse, um Inhalte zu zentrieren. */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacer-double);
}

/* Stellt sicher, dass Bilder niemals über ihren Container hinausragen. */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Globaler Standard-Stil für Buttons. Kann durch spezifischere
   Regeln (wie im Cookie-Banner) überschrieben werden. */
button {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
button:focus-visible {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px var(--shadow-color);
}


/* 3. GLOBALE INTERAKTIONS-STILE (LINKS & FOKUS)
   ------------------------------------------------------------ */

/* Fokus nur für Tastatur-Navigation (sauber & konsistent) */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 3px;
  border-radius: 8px;
}

/* ============================================================
   Seiten-Hero Banner (Global)
   ------------------------------------------------------------ */
.page-hero {
  background-color: var(--background);
  padding: 4rem 2rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.page-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .page-hero h1 {
    font-size: 2rem;
  }
  .page-hero p {
    font-size: 1rem;
  }
}


/* ===================================================================
   Cookie Consent Banner (Google Consent Mode v2)
   =================================================================== */

.cookie-banner {
  /* Position & Layout */
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999; /* Stellt sicher, dass er über allen anderen Elementen liegt */
  
  /* Größe & Abstände */
  max-width: 450px;
  width: calc(100% - 2rem);
  padding: 24px;

  /* Design & Optik */
  background-color: var(--header-bg); /* Nutzt die halbtransparente Variable! */
  color: var(--foreground);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 12px 24px var(--shadow-color);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  /* Text & Schrift */
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Standardmäßig versteckt, wird per JS gezeigt */
  display: none; 
}

/* Überschrift des Banners */
.cookie-banner h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--foreground); /* Nutzt die Variable */
}

/* Beschreibungstext */
.cookie-banner p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary); /* Nutzt die Variable für sekundären Text */
  margin: 0 0 24px 0;
}

/* Container für die Checkbox-Optionen */
.cookie-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 24px;
  text-align: left;
}

/* Einzelne Checkbox-Zeile (Label) */
.cookie-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 15px;
}

/* Versteckt die originale Checkbox */
.cookie-option input[type="checkbox"] {
  display: none;
}

/* Eigener Checkbox-Stil (der Kasten) */
.cookie-option .checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

/* Haken-Symbol (wird nur bei :checked sichtbar) */
.cookie-option .checkmark::after {
  content: '✔';
  font-size: 14px;
  color: white;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Wenn die Checkbox aktiviert ist... */
.cookie-option input[type="checkbox"]:checked + .checkmark {
  background-color: var(--accent);
  border-color: var(--accent);
}

.cookie-option input[type="checkbox"]:checked + .checkmark::after {
  opacity: 1;
  transform: scale(1);
}

/* Container für die Buttons */
.cookie-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Allgemeiner Button-Stil im Banner */
.cookie-banner button {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Spezifische Button-Stile über ihre IDs */
#accept-cookies, /* "Allen zustimmen" */
#accept-selected-cookies /* "Auswahl bestätigen" */ {
  background-color: var(--accent);
  color: var(--btn-text);
}

#accept-cookies:hover,
#accept-selected-cookies:hover {
  background-color: var(--accent-hover);
}

#accept-only-essential /* "Nur Notwendige" */ {
  background-color: var(--card-bg);
  color: var(--foreground);
  border: 1px solid var(--border-color);
}

#accept-only-essential:hover {
  background-color: var(--border-color);
}

/* Links für Impressum & Datenschutz */
.cookie-banner .legal-links {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-top: 16px;
}

.cookie-banner .legal-links a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.cookie-banner .legal-links a:hover {
  color: var(--accent);
}