html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

html.ev-modal-open,
body.ev-modal-open {
  overflow: hidden; /* Verhindert Scrollen des Hintergrunds */
}

.ev-sticky-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: #000;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s ease;
  display: flex; /* Sicherstellen, dass es ein Flex-Container ist */
  align-items: center;
  justify-content: center;
}

.ev-sticky-button:hover {
  background-color: #333;
}

.ev-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none; /* Standardmäßig ausgeblendet */
  justify-content: flex-end; /* Für Desktop-Positionierung */
  align-items: flex-end; /* Für Desktop-Positionierung */
}

.ev-modal.active {
  display: flex; /* Beim Aktivieren anzeigen */
}

.ev-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.ev-modal-content {
  position: relative;
  background: white;
  width: 100%;
  max-width: 400px;
  height: 500px; /* Feste Höhe für Desktop */
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(100%); /* Startposition unten außerhalb des Bildschirms */
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Standard-Transition */
  border-top: 3px solid black; /* NEU: Schwarzer Rand oben */
}

.ev-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  flex-shrink: 0;
}

.ev-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
}

.ev-close-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ev-close-button:hover {
  background-color: #f5f5f5;
}

.ev-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 8px;
}

.ev-section-header h3 {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

.ev-entry-button {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 12px 0; /* Abstand für den gesamten Button */
  cursor: pointer;
  text-align: left;
  position: relative;
  border-bottom: 1px solid #e5e7eb; /* Trennlinie */
}

.ev-entry-button:last-child {
  border-bottom: none; /* Keine Trennlinie nach dem letzten Eintrag */
}

.ev-date-box {
  color: white;
  padding: 8px;
  border-radius: 0; /* Eckige Boxen */
  text-align: center;
  min-width: 50px;
  flex-shrink: 0;
}

/* Farben für Dummy-Einträge - Diese werden jetzt durch Inline-Styles überschrieben */
.ev-color-purple {
  background-color: #8b5cf6;
}
.ev-color-blue {
  background-color: #3b82f6;
}
.ev-color-green {
  background-color: #22c55e;
}
.ev-color-orange {
  background-color: #f97316;
}
.ev-color-red {
  background-color: #ef4444;
}

.ev-day {
  font-size: 12px;
  font-weight: 500;
}

.ev-date-num {
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}

.ev-stars {
  font-size: 12px;
}

.ev-entry-content {
  flex: 1;
  min-width: 0;
}

.ev-entry-title {
  font-size: 14px; /* Kirchensonntag-Name: 14px */
  font-weight: bold; /* NEU: Fett */
  margin-bottom: 4px;
}

.ev-entry-text {
  font-size: 18px;
  font-weight: normal; /* Geändert von bold zu normal */
  color: #000;
  line-height: 1.4;
}

.ev-entry-arrow {
  flex-shrink: 0;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.ev-modal-body {
  padding: 0 16px; /* Horizontales Padding für den Inhalt */
  flex: 1; /* Nimmt den restlichen vertikalen Platz ein */
  display: flex;
  flex-direction: column;
  min-height: 0; /* Wichtig für Flex-Elemente, die scrollen sollen */
}

.ev-modal-body h2 {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 4px 0;
  padding-top: 16px; /* Fügt Padding zum Titel hinzu */
}

.ev-date {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px 0;
}

.ev-calendar-entries {
  flex: 1; /* Nimmt den restlichen Platz im Body ein */
  overflow-y: auto; /* Ermöglicht Scrollen */
  padding-right: 4px; /* Platz für Scrollbar */
  padding-bottom: 16px; /* NEU: Abstand unten */
  /* Keine padding-top/bottom hier, da es in .ev-entry-button gehandhabt wird */
  position: relative; /* Für absolute Positionierung des Spinners */
}

/* Anpassung für den ersten und letzten Eintrag innerhalb des scrollbaren Bereichs */
.ev-calendar-entries .ev-entry-button:first-child {
  padding-top: 0;
}

.ev-calendar-entries .ev-entry-button:last-child {
  padding-bottom: 0;
}

.ev-entry-line {
  height: 1px; /* Dünne Linie */
  width: 100%; /* Volle Breite */
  margin-top: 4px; /* Abstand zum Kirchensonntag-Namen */
  margin-bottom: 8px; /* Abstand zum Beitragstitel */
}

/* NEW: Spinner styles */
.ev-loading-spinner {
  border: 4px solid #f3f3f3; /* Light grey */
  border-top: 4px solid #000; /* Updated Blue to Black */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -20px; /* Half of height */
  margin-left: -20px; /* Half of width */
  z-index: 10;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .ev-modal.active {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .ev-modal-content {
    max-width: 100%;
    height: 60vh;
    border-radius: 0;
  }

  .ev-sticky-button {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}
