/*
=====================================================
  Bootstrap "Bratwurst-Grillfest" - Direkte Zuweisung
=====================================================
*/

/* Globale Variablen, die funktioniert haben, können wir behalten */
:root {
  --bs-primary: #ffc107;
  --bs-secondary: #495057;
  --bs-success: #28a745;
  --bs-danger: #dc3545;
  --bs-warning: #fd7e14;
  --bs-info: #17a2b8;
  --bs-light: #fdf8f0;
  --bs-dark: #3a2e28;
  --bs-body-font-family: "Georgia", "Times New Roman", serif;

  /* Geben Sie die exakte Höhe Ihres Headers und Footers an. */
  --header-height: 56px;
  --footer-height: 75px;
}

/* Grundfarben für die Seite */
body {
  background-color: var(--bs-light);
  color: var(--bs-dark);
}

/*
  DIES IST DER NEUE, WICHTIGE TEIL:
  Wir weisen den Komponenten ihre Farben direkt zu.
  Das ist spezifischer und "gewinnt" gegen die Standardwerte.
*/

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: #e0a800; /* Etwas dunkleres Gelb für Hover */
  --bs-btn-hover-border-color: #c69500;
  --bs-btn-color: var(--bs-dark); /* Dunkler Text für Lesbarkeit */
  --bs-btn-hover-color: var(--bs-dark);
  --bs-btn-active-bg: #c69500; /* Noch dunkler für Klick-Effekt */
  --bs-btn-active-border-color: #c69500;
}

.btn-secondary {
  --bs-btn-bg: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
  --bs-btn-hover-bg: #5a6268;
  --bs-btn-hover-border-color: #545b62;
  --bs-btn-color: #fff; /* Heller Text auf dunklem Grund */
  --bs-btn-hover-color: #fff;
}

@media (min-width: 992px) {
  #ajax-offcanvas {
    width: 600px; /* Sie können diesen Wert nach Belieben anpassen */
  }
}

/* Das gleiche Prinzip für Alerts */
.alert-success {
  --bs-alert-bg: #d4edda;
  --bs-alert-border-color: #c3e6cb;
  --bs-alert-color: #155724;
}

/* Map */
/* Container für die Karte, damit sie responsive ist */
/* Der Container, der die Karte hält.
   Wir nehmen ihn aus dem normalen Seitenfluss und spannen ihn über den ganzen Viewport. */
#map-container {
  position: fixed; /* Bleibt fixiert im Fenster */
  top: var(--header-height); /* Startet unterhalb des Headers */
  bottom: var(--footer-height); /* Endet oberhalb des Footers */
  left: 0;
  right: 0; /* left: 0 und right: 0 spannen es über die volle Breite */
  width: 100%; /* Breite bleibt 100% */
  z-index: 1; /* Liegt auf der untersten Ebene */
}

/* Die Leaflet-Karte selbst muss den Container nun vollständig ausfüllen. */
#map {
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------- */
/* Overlay-Elemente (Überschrift, Tooltip)                       */
/* ------------------------------------------------------------- */

/* Wir stylen die h1-Überschrift als schwebendes Overlay-Element. */
.content h1 {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1001; /* Liegt über der Karte und den Leaflet-Controls */

  background-color: rgba(255, 255, 255, 0.85);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-size: 1.5rem;
}

/* Der Tooltip muss ebenfalls über der Karte schweben. */
#tooltip {
  z-index: 1002; /* Höchster z-index, damit er immer sichtbar ist */
}

/* WICHTIG: Stellt sicher, dass die Leaflet-Controls (Zoom, Copyright)
   über der Karte, aber unter unseren eigenen Overlays liegen. */
.leaflet-control-container {
  z-index: 1000;
}

/* Stellt sicher, dass ein Element aus dem sichtbaren Bereich verschwindet,
   aber für Screenreader und den Browser-Fokus erreichbar bleibt. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fab {
  /* Positionierung */
  position: fixed; /* Fixiert den Button am Browserfenster */
  left: 50%; /* Zentriert den linken Rand des Buttons horizontal */
  transform: translateX(
    -50%
  ); /* Zieht den Button um seine halbe Breite zurück, um ihn perfekt zu zentrieren */
  bottom: calc(
    var(--footer-height) + 30px
  ); /* Positioniert ihn 20px über Ihrem Sticky Footer */
  z-index: 1001; /* Stellt sicher, dass er über der Karte, aber unter dem Tooltip liegt */

  /* Aussehen */
  width: 60px;
  height: 60px;
  border-radius: 50%; /* Macht den Button perfekt rund */
  background-color: var(
    --bs-primary
  ); /* Verwendet Ihre primäre Theme-Farbe (Senf-Gelb) */
  color: var(--bs-dark); /* Verwendet Ihre dunkle Theme-Farbe für das Icon */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Schöner Schatten für den "schwebenden" Effekt */

  /* Inhalt zentrieren (das Plus-Icon) */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Übergang für sanfte Hover-Effekte */
  transition: all 0.2s ease-in-out;
}

.fab:hover {
  color: var(--bs-dark);
  transform: translateX(-50%) scale(1.1); /* Vergrößert den Button leicht beim Darüberfahren */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* Anpassung der Größe des SVG-Icons im Button */
.fab svg {
  width: 32px;
  height: 32px;
}

/*
=====================================================
  Benutzerdefiniertes Styling für Marker-Cluster
=====================================================
*/

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-clip: padding-box;
  border-radius: 50%; /* Macht die Cluster rund */
}

#map .marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 50%;
  font-size: 12px;
  color: #fff; /* Schriftfarbe für die Zahl */
}

#map .marker-cluster span {
  line-height: 30px; /* Zentriert die Zahl vertikal */
}

/* Cluster-Farbe für kleine Gruppen (z.B. < 10 Marker) */
#map .marker-cluster-small div {
  background-color: rgba(
    58,
    46,
    40,
    0.6
  ); /* Holztisch-Braun, leicht transparent */
}

/* Cluster-Farbe für mittlere Gruppen (z.B. < 100 Marker) */
#map .marker-cluster-medium div {
  background-color: rgba(
    253,
    126,
    20,
    0.7
  ); /* Glut-Orange, leicht transparent */
}

/* Cluster-Farbe für große Gruppen */
#map .marker-cluster-large div {
  background-color: rgba(
    220,
    53,
    69,
    0.8
  ); /* Ketchup-Rot, leicht transparent */
}

/* ============================================= */
/* Wurstify Image Uploader Styling               */
/* ============================================= */

.image-upload-wrap {
  width: 100%;
  aspect-ratio: 1 / 1; /* Sorgt für ein quadratisches Format */
  border: 3px dashed #ffc107; /* Senf-Gelb-gestrichelter Rahmen */
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
}

.image-upload-wrap:hover {
  background-color: #e9ecef;
  border-color: #e0ac00;
}

/* .file-upload-input {
  position: absolute;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
} */

.drag-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.upload-icon {
  font-size: 5rem;
  color: #ffc107;
  font-weight: 100;
  line-height: 1;
}

.file-upload-content {
  display: none;
  text-align: center;
  position: relative;
  width: 100%;
  height: 100%;
}

.file-upload-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Stellt sicher, dass das Bild den Rahmen füllt */
}

.image-title-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
}

.remove-image {
  background: #cd4535; /* Ketchup-Rot */
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.remove-image:hover {
  background: #b23a2d;
}

/*
=====================================================
  Finaler, hoch-spezifischer Fix für den Fortschrittsbalken
=====================================================
*/

/* Wir sprechen den Container über seine ID an */
#progress-wrap {
  /* display: flex !important; */
  height: 8px !important;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: #e9ecef;
  border-radius: 0.25rem;
}

/* Und den inneren Balken ebenfalls über seine ID */
#progress-bar {
  display: flex !important;
  height: 100% !important;
  background-color: #198754 !important; /* Grüner Erfolgs-Farbton */
  transition: width 0.2s ease !important; /* Sanfte Animation erzwingen */
}

.rating-images img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  background-color: #f0f0f0;
}

.image-upload-wrap.image-shown .file-upload-input {
  pointer-events: none;
}

/* ============================================= */
/* Benutzerdefiniertes Styling für Marker-Cluster */
/* ============================================= */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-clip: padding-box;
  border-radius: 50%; /* Macht die Cluster rund */
}

.marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  color: #fff; /* Schriftfarbe für die Zahl */
}

.marker-cluster span {
  line-height: 30px; /* Zentriert die Zahl vertikal */
}

/* Wurstify-Farbschema für die Cluster */

/* Cluster-Farbe für kleine Gruppen (< 10) */
.marker-cluster-small div {
  background-color: rgba(58, 46, 40, 0.7); /* Holztisch-Braun */
}

/* Cluster-Farbe für mittlere Gruppen (< 100) */
.marker-cluster-medium div {
  background-color: rgba(255, 193, 7, 0.8); /* Senf-Gelb (aus Ihrem Theme) */
}

/* Cluster-Farbe für große Gruppen (100+) */
.marker-cluster-large div {
  background-color: rgba(220, 53, 69, 0.8); /* Ketchup-Rot */
}

/* ======================================================== */
/* FINALES, KONSOLIDIERTES STYLING FÜR DEN RATING-UPLOADER  */
/* ======================================================== */

/* Der Haupt-Container für eine einzelne Upload-Box */
.rating-image-upload-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px dashed #ced4da;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease-in-out;
}
.rating-image-upload-wrap:hover {
  border-color: var(--wurstify-primary);
  background-color: #e9ecef;
}

/* Der unsichtbare Datei-Input, der über allem liegt */
.rating-file-upload-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

/* Der Plus-Icon-Container */
.rating-drag-text {
  text-align: center;
  color: #ced4da;
  font-size: 4rem;
  font-weight: 100;
}

/* Der Container für die Vorschau und den Entfernen-Button. Standardmäßig versteckt. */
.rating-file-upload-content {
  display: none;
  position: relative;
  width: 100%;
  height: 100%;
}

/* Das Vorschaubild selbst */
.rating-file-upload-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.375rem;
}

/* Der "Entfernen"-Button und sein Container */
.rating-image-title-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-bottom-left-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}
.rating-file-upload-content:hover .rating-image-title-wrap {
  opacity: 1; /* Erscheint beim Hovern */
}
.rating-remove-image {
  color: white;
  background: #dc3545;
  border: none;
  padding: 3px 10px;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Container für den Fortschrittsbalken, der über dem Bild schwebt */
.rating-progress-bar-wrap {
  position: absolute;
  bottom: 5px;
  left: 5%;
  width: 90%;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  display: none; /* Wird per JS gesteuert */
}

/* Der eigentliche Fortschrittsbalken */
.rating-progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--wurstify-primary); /* Ihre Markenfarbe */
  border-radius: 5px;
  transition: width 0.3s ease;
}

/* Die Steuerungs-Klasse, die unser JavaScript setzt */
.rating-image-upload-wrap.image-shown .rating-drag-text {
  display: none;
}
.rating-image-upload-wrap.image-shown .rating-file-upload-content {
  display: block;
}
.rating-image-upload-wrap.image-shown .rating-file-upload-input {
  pointer-events: none;
}

/* ======================================= */
/* Styling für Avatar-Bilder bei Bewertungen */
/* ======================================= */

/* Kleines Avatar-Bild für die Feed-Übersicht */
.avatar-image-sm {
  width: 40px;
  height: 40px;
  object-fit: cover; /* Verhindert, dass das Bild verzerrt wird */
  border: 1px solid #eee;
}

/* Mittleres Avatar-Bild für die Modal-Detailansicht */
.avatar-image-md {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border: 2px solid #eee;
}

/* ============================================= */
/* Wurstify Auth Page Styling                    */
/* ============================================= */

/* Definition Ihrer Markenfarben als CSS-Variablen */
:root {
  --wurstify-primary: #a65e2e; /* Bratwurst-Braun */
  --wurstify-secondary: #ffc107; /* Senf-Gelb */
  --wurstify-dark: #3d2b1f; /* Holzkohle-Braun */
  --wurstify-light: #f5e0c3; /* Brötchen-Beige */
  --wurstify-charcoal: #3a2e28; /* Holzkohle-Braun */
}

/* Wir geben den Auth-Seiten einen eigenen Body-Stil */
.auth-page {
  /* background-color: var(--wurstify-dark); */
  background: linear-gradient(
    160deg,
    var(--wurstify-dark) 0%,
    var(--wurstify-primary) 100%
  );
  min-height: 100vh;
}

/* Die zentrierte Karte, die das Formular enthält */
.auth-card {
  max-width: 540px; /* Breite erhöht */
  margin: 1rem auto;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  background-color: #fff; /* Hintergrundfarbe explizit setzen */
}

/* Das Logo über der Karte */
.auth-logo {
  width: 128px;
  height: 128px;
  margin-bottom: 1rem;
}

/* Das Styling für die Formular-Buttons */
.auth-card .btn-primary {
  background-color: var(--wurstify-secondary);
  border-color: var(--wurstify-dark);
  color: var(--wurstify-dark);
}

.auth-card .btn-primary:hover {
  background-color: var(--wurstify-primary);
  color: var(--wurstify-secondary);
}

/* Der präsente Link am unteren Rand der Karte */
.auth-switch-link {
  background-color: #f8f9fa;
  padding: 1.25rem; /* Eigener Innenabstand statt negativer Margin */
  border-top: 1px solid #dee2e6;
  text-align: center;
  border-bottom-left-radius: 0.5rem; /* Runde Ecken unten anpassen */
  border-bottom-right-radius: 0.5rem;
}

.auth-promo-link {
  /* Passt die Breite an die der Login-Karte an */
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;

  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
}

/* Wir verwenden die Wurstify-Farbe für den Button */
.auth-promo-link .btn-secondary {
  background-color: var(--wurstify-secondary);
  border-color: var(--wurstify-dark);
  color: var(--wurstify-dark);
}

.auth-promo-link .btn-secondary:hover {
  background-color: var(--wurstify-primary);
  color: var(--wurstify-secondary);
}

/* Styling für den schwebenden Hilfe-Button (verbesserte Version) */
.fab-help {
  /* Positionierung */
  position: fixed;
  top: calc(var(--header-height) + 15px);
  right: 15px;
  z-index: 1001;

  /* Feste Größe für einen perfekten Kreis */
  width: 50px;
  height: 50px;

  /* Wichtig: Flexbox zum Zentrieren des Icons */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Basis-Styling */
  border-radius: 50%;
  background-color: #fff;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
}

/* Styling für das Icon selbst */
.fab-help i {
  font-size: 24px; /* Größe des Fragezeichens */
  color: var(--wurstify-dark); /* Ihre dunkle Markenfarbe */
}

/* Styling für das Klick-Feedback auf Navigations-Elementen */
.nav-link.is-active-feedback {
  /* Ein leichter, dunklerer Hintergrund, der kurz aufleuchtet */
  background-color: rgba(0, 0, 0, 0.1) !important;
  border-radius: 0.5rem;
  /* Optional: eine subtile Animation */
  animation: pulse-feedback 0.3s ease-out;
}

@keyframes pulse-feedback {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

/* VENDOR CARD*/
/* Styling für die Vendor-Detailseite */
.vendor-header {
  position: relative;
  width: 100%;
  height: 200px;
  background-color: #3a2e28;
  background-size: cover;
  background-position: center;
}
.vendor-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vendor-header-overlay {
  position: absolute;
  bottom: -50px; /* Lässt das Logo zur Hälfte herausragen */
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  padding: 5px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.vendor-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
}
.opening-hours-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.opening-hours-list li:last-child {
  border-bottom: none;
}

/* Vendor-Area */

.image-uploader-box {
  border: 2px dashed #ced4da;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  cursor: pointer;
  background-color: #f8f9fa;
  transition: all 0.2s ease-in-out;
  min-height: 170px; /* Stellt eine Mindesthöhe sicher */
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-uploader-box:hover {
  border-color: var(--wurstify-primary);
  background-color: #e9ecef;
}

.image-uploader-box img {
  max-height: 150px;
  width: auto;
  max-width: 100%;
}
