/* ==========================================================================
   TAGEBIS - STYLE.CSS (GLOBALE BASIS-STYLESHEET)
   Inhaltsverzeichnis:
   - ABSCHNITT 1: THEME-VARIABLEN (LIGHT & DARK MODE)
   - ABSCHNITT 2: CSS-RESET & GRUNDLAYOUT
   - ABSCHNITT 3: KOPFZEILE (HEADER & NAVIGATION)
   - ABSCHNITT 4: MOBILER BURGER-BUTTON & AUSKLAPP-MENÜ
   - ABSCHNITT 5: GLOBALE BUTTONS & HILFSKLASSEN
   - ABSCHNITT 6: AUTH-MODAL (ANMELDE- & REGISTRIER-POPUP)
   - ABSCHNITT 7: AUTH-TABS (UMSCHALTER ANMELDEN / REGISTRIEREN)
   - ABSCHNITT 8: DSGVO COOKIE-BANNER
   - ABSCHNITT 9: FUSSZEILE (FOOTER)
   - ABSCHNITT 10: RESPONSIVE ANPASSUNGEN (SMARTPHONE & TABLET)
   ========================================================================== */


/* ==========================================================================
   ABSCHNITT 1: THEME-VARIABLEN (LIGHT & DARK MODE)
   ========================================================================== */

/* 1.1 Standard Theme (Heller Modus - Clean & Freundlich) */
:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* TageBis-Königsblau als Hauptfarbe */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.25);
  --primary-subtle: #eff6ff;
  
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --header-bg: rgba(255, 255, 255, 0.94);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 1.2 Optionaler Dark Mode (Wird über HTML & BODY aktiviert) */
:root.dark-theme,
html.dark-theme,
body.dark-theme {
  --bg-page: #0b1120;
  --bg-surface: #131d33;
  --bg-subtle: #1e293b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --border-color: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --primary-subtle: rgba(59, 130, 246, 0.12);
  
  --card-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(11, 17, 32, 0.94);
}


/* ==========================================================================
   ABSCHNITT 2: CSS-RESET & GRUNDLAYOUT
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden; /* Verhindert seitliches Scrollen und Wackeln */
  width: 100%;
  max-width: 100vw;
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { 
  color: inherit; 
  text-decoration: none; 
}

button { 
  font-family: inherit; 
}


/* ==========================================================================
   ABSCHNITT 3: KOPFZEILE (HEADER & NAVIGATION)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text .text-blue { 
  color: var(--primary); 
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover { 
  color: var(--primary); 
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* Theme Umschalter (Sonne / Mond) */
.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  transform: scale(1.05);
}

/* Regions-Auswahl (DACH) */
.region-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

/* Kleiner Anmelde-Button im Header */
.btn-primary-sm {
  background: var(--primary);
  color: #ffffff !important;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-primary-sm:hover { 
  background: var(--primary-hover); 
}


/* ==========================================================================
   ABSCHNITT 4: MOBILER BURGER-BUTTON & AUSKLAPP-MENÜ
   ========================================================================== */

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  touch-action: manipulation;
}

/* Verhindert, dass die Querstriche den Klick am Smartphone abfangen */
.mobile-toggle .bar {
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1.2rem 1.5rem;
  width: 100%;
}

.mobile-menu.open {
  display: block !important;
  animation: tbMenuSlide 0.2s ease-out;
}

@keyframes tbMenuSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.2rem 0;
}

.mobile-nav a:hover {
  color: var(--primary);
}


/* ==========================================================================
   ABSCHNITT 5: GLOBALE BUTTONS & HILFSKLASSEN
   ========================================================================== */

.w-full { 
  width: 100%; 
}

.mt-2 { 
  margin-top: 0.5rem; 
}

.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-align: center;
  display: inline-block;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main) !important;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-align: center;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-secondary:hover { 
  background: var(--border-color); 
}

/* Versteckt Buttons kugelsicher, egal welche Bildschirmgröße */
.auth-hidden {
  display: none !important;
}

/* ==========================================================================
   ABSCHNITT 6: AUTH-MODAL (ANMELDE- & REGISTRIER-POPUP)
   ========================================================================== */

.tb-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  animation: tbModalFadeIn 0.2s ease-out;
}

@keyframes tbModalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.tb-modal-card {
  background: var(--bg-surface);
  color: var(--text-main);
  width: 100%;
  max-width: 420px;
  padding: 2.2rem 2rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.tb-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.tb-modal-close:hover {
  color: var(--text-main);
}

.tb-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.tb-modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.tb-modal-header p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-google-auth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-google-auth:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

.tb-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
}

.tb-auth-divider::before, 
.tb-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.tb-auth-divider span {
  padding: 0 10px;
}

.tb-form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.tb-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.tb-form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.tb-form-group input:focus {
  border-color: var(--primary);
}

.tb-auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 0.6rem;
  border-radius: 10px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  text-align: center;
}

.tb-modal-footer {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  font-size: inherit;
  text-decoration: underline;
}


/* ==========================================================================
   ABSCHNITT 7: AUTH-TABS (UMSCHALTER ANMELDEN / REGISTRIEREN)
   ========================================================================== */

.tb-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 1.4rem;
  gap: 4px;
}

.tb-auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tb-auth-tab:hover {
  color: var(--text-main);
}

.tb-auth-tab.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}


/* ==========================================================================
   ABSCHNITT 8: DSGVO COOKIE-BANNER
   ========================================================================== */

.tb-cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 800px;
  z-index: 9999;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
}

.tb-cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.tb-cookie-content p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
  min-width: 250px;
}

.tb-cookie-content a {
  color: var(--primary);
  text-decoration: underline;
}


/* ==========================================================================
   ABSCHNITT 9: FUSSZEILE (FOOTER)
   ========================================================================== */
/* ==========================================================================
   GLOBALER SITE-FOOTER (4-SPALTEN-RASTER & KOMPAKTER ZEILENABSTAND)
   ========================================================================== */
.site-footer {
  background: var(--bg-surface, #ffffff);
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding: 36px 0 20px !important;
  margin-top: auto;
  width: 100%;
}

.site-footer .footer-container {
  max-width: 1040px !important;
  margin: 0 auto !important;
  padding: 0 1.25rem !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.footer-links-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 24px !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

@media (min-width: 600px) {
  .footer-links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }
}

@media (min-width: 960px) {
  .footer-links-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.15fr !important;
    gap: 30px !important;
  }
}

.footer-col {
  display: flex !important;
  flex-direction: column !important;
}

.footer-col h5 {
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  color: var(--text-main, #0f172a) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
}

.footer-brand-text {
  font-size: 0.82rem !important;
  color: var(--text-muted, #64748b) !important;
  line-height: 1.5 !important;
  margin: 4px 0 0 0 !important;
  max-width: 290px !important;
}

/* Links: Kompakter Zeilenabstand ohne Margins */
.footer-col a {
  color: var(--text-muted, #64748b) !important;
  font-size: 0.82rem !important;
  line-height: 1.55 !important;
  text-decoration: none !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: color 0.15s ease !important;
}

.footer-col a:hover {
  color: var(--primary, #2563eb) !important;
}

/* Vollflächige Disclaimer-Box unter den 4 Spalten */
.footer-disclaimer-box {
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 18px 0 14px 0 !important;
  padding: 10px 14px !important;
  background: var(--bg-subtle, #f8fafc) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 10px !important;
  font-size: 0.76rem !important;
  color: var(--text-muted, #64748b) !important;
  line-height: 1.45 !important;
  text-align: center !important;
  display: block !important;
}

.footer-bottom {
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  padding-top: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  font-size: 0.76rem !important;
  color: var(--text-muted, #64748b) !important;
  text-align: center !important;
  width: 100% !important;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row !important;
    text-align: left !important;
  }
}

.footer-trust-tags {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}


/* ==========================================================================
   ABSCHNITT 10: RESPONSIVE ANPASSUNGEN (SMARTPHONE & TABLET)
   ========================================================================== */

@media (max-width: 850px) {
  /* Menü-Links im Desktop-Header ausblenden */
  .main-nav { 
    display: none; 
  }
  
  .header-container { 
    padding: 0.65rem 1rem; 
    gap: 0.5rem;
  }
  
  /* Region-Auswahl auf dem Handy ausblenden */
  .region-picker { 
    display: none; 
  }
  
/* 1-Klick-Buttons am Smartphone kompakt halten */
  #headerAuthBtn,
  #dashboardShortcutBtn {
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
    font-weight: 700;
    border-radius: 999px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 0.45rem;
  }
  
  /* Burger-Icon einblenden */
  .mobile-toggle { 
    display: flex; 
  }
  
  .footer-container { 
    grid-template-columns: 1fr; 
  }
}

@media (max-width: 500px) {
  .brand-logo { 
    font-size: 1.15rem; 
  }
  
  .footer-links-grid { 
    grid-template-columns: 1fr; 
  }
}