/* Kalender-Ansichten: Month, Week, List, Map */

.view {
  display: none;
}

.view.is-active {
  display: block;
}

/* =====================
   Month-View
===================== */
.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: var(--sp-1);
}

.cal-header span {
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-2) 0;
}

.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cal-day {
  background: var(--surface-0);
  min-height: 104px;
  padding: var(--sp-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-std);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-day:hover {
  background: var(--surface-1);
}

.cal-day--other-month {
  background: var(--surface-2);
}

.cal-day--other-month:hover {
  background: var(--surface-3);
}

.cal-day--other-month .cal-num {
  color: var(--text-soft);
}

.cal-day--today {
  background: rgba(245, 197, 24, 0.04);
}

.cal-day--today .cal-num {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.cal-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  margin-bottom: var(--sp-1);
}

.cal-event {
  display: block;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: calc(0.68rem * var(--fs-scale));
  font-weight: var(--fw-semi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--dur-fast);
}

/* Beendete Termine (heute, Endzeit vorbei) - ausgegraut, aber klickbar */
.cal-event.is-finished {
  opacity: 0.4;
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  text-decoration: line-through;
}

.cal-event.is-finished:hover {
  opacity: 0.6;
}

.cal-event:hover {
  opacity: 0.78;
}

.cal-more {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: var(--fw-semi);
  cursor: pointer;
  padding: 1px 6px;
  margin-top: auto;
}

.cal-more:hover {
  color: var(--color-primary);
}

/* Kategorie-Farben fuer Events (Tags + Kalender-Badges) */
.cat-kultur       { background: var(--cat-kultur-bg);       color: var(--cat-kultur); }
.cat-gemeinschaft { background: var(--cat-gemeinschaft-bg); color: var(--cat-gemeinschaft); }
.cat-religion     { background: var(--cat-religion-bg);     color: var(--cat-religion); }
.cat-sport        { background: var(--cat-sport-bg);        color: var(--cat-sport); }
.cat-natur        { background: var(--cat-natur-bg);        color: var(--cat-natur); }
.cat-markt        { background: var(--cat-markt-bg);        color: var(--cat-markt); }
.cat-gastro       { background: var(--cat-gastro-bg);       color: var(--cat-gastro); }
.cat-kinder       { background: var(--cat-kinder-bg);       color: var(--cat-kinder); }
.cat-jugend       { background: var(--cat-jugend-bg);       color: var(--cat-jugend); }
.cat-politik      { background: var(--cat-politik-bg);      color: var(--cat-politik); }

/* =====================
   Week-View
===================== */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.week-nav-btn {
  background: var(--surface-0);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-strong);
  transition: all var(--dur-fast) var(--ease-std);
}

.week-nav-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.week-nav-label {
  font-size: var(--fs-md);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  min-width: 220px;
  text-align: center;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.week-col {
  background: var(--surface-0);
  min-height: 200px;
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.week-col--today {
  background: rgba(245, 197, 24, 0.04);
}

.week-col-header {
  text-align: center;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-1);
}

.week-col-weekday {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.week-col-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  margin-top: var(--sp-1);
}

.week-col--today .week-col-date {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.week-event {
  padding: 5px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: opacity var(--dur-fast);
  line-height: 1.35;
  text-align: left;
  width: 100%;
}

.week-event:hover {
  opacity: 0.78;
}

/* Beendete Termine in Wochenansicht - ausgegraut, aber klickbar */
.week-event.is-finished {
  opacity: 0.4;
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  text-decoration: line-through;
  border: 1px dashed var(--border-2);
}

.week-event.is-finished:hover {
  opacity: 0.6;
}

.week-event-time {
  display: block;
  font-size: 0.64rem;
  font-weight: var(--fw-regular);
  opacity: 0.85;
  margin-bottom: 1px;
}

/* =====================
   List-View
===================== */
.list-month-header {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--border-1);
}

/* Aktiver Veranstalter-Filter (Partner-Ansicht) */
.list-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  background: var(--business-bg);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius-md);
}

.list-filter-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.list-filter-label {
  font-size: 0.65rem;
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-filter-value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--business);
  word-break: break-word;
}

.list-filter-clear {
  flex-shrink: 0;
  background: var(--surface-0);
  border: 1px solid rgba(184, 134, 11, 0.35);
  color: var(--business);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-std);
}

.list-filter-clear:hover {
  background: var(--business);
  color: #fff;
  border-color: var(--business);
}

.event-card {
  display: flex;
  gap: var(--sp-4);
  background: var(--surface-0);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-1);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-3);
  transition: all var(--dur-med) var(--ease-out);
  cursor: pointer;
  position: relative;
  text-align: left;
  width: 100%;
  align-items: center;
}

.event-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px) translateX(2px);
  border-color: var(--color-primary);
}

.event-card:hover .event-card-icon {
  transform: scale(1.08);
}

.event-card:hover .event-title {
  color: var(--color-primary);
}

.event-card-icon {
  transition: transform var(--dur-fast) var(--ease-std);
}

.event-title {
  transition: color var(--dur-fast) var(--ease-std);
}

.event-card.is-featured {
  border-color: transparent;
  animation: featuredGlow 5.5s var(--ease-std) infinite;
}

@keyframes featuredGlow {
  0%, 100% {
    box-shadow: 0 0 0 1.5px rgba(232, 170, 10, 0.35), var(--shadow-sm);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(232, 170, 10, 0.55),
                0 0 14px 1px rgba(232, 170, 10, 0.18),
                var(--shadow-sm);
  }
}

/* Stern-Badge bei Featured-Events: dezenter Herzschlag */
.event-card.is-featured .featured-badge {
  animation: starPulse 2.8s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* Highlight-Badge: Stern oben rechts in der Event-Kachel (Desktop + Mobile) */
.event-badges {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-3);
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 1;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: #e8a50a;
  line-height: 1;
  flex-shrink: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  /* feiner Glanz auf der Strichstaerke */
  filter: drop-shadow(0 1px 1px rgba(184, 134, 11, 0.25));
}

/* Titel bekommt Platz rechts, damit der Stern nichts ueberdeckt */
.event-card.is-featured .event-title,
.event-card.is-featured .event-meta {
  padding-right: calc(26px + var(--sp-3));
}

.featured-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Desktop: Partner-Badge aus der Tag-Zeile nach oben rechts verlegen
   (neben dem Highlight-Stern) */
@media (min-width: 769px) {
  .event-tags .partner-badge {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-3);
    z-index: 1;
  }

  /* Wenn auch Featured-Badge da ist: Partner links daneben positionieren */
  .event-card.is-featured .event-tags .partner-badge {
    right: calc(var(--sp-3) + 34px);
  }
}

/* Business-Partner-Kennzeichnung - dezente goldene Toenung */
.event-card.is-business {
  border-left: 3px solid var(--business);
  background: linear-gradient(90deg, rgba(245, 197, 24, 0.05) 0%, transparent 50%);
}

.partner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--business-bg);
  color: var(--business);
  font-size: 0.6rem;
  font-weight: var(--fw-bold);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid rgba(184, 134, 11, 0.25);
}

.partner-badge::before {
  content: '◆';
  font-size: 0.55rem;
}

.event-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.date-box {
  min-width: 52px;
  text-align: center;
  flex-shrink: 0;
}

.date-box-weekday {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.date-box-day {
  font-size: 1.65rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--text-strong);
  margin: 2px 0;
}

.date-box-month {
  font-size: var(--fs-xs);
  color: var(--color-primary);
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-info {
  flex: 1;
  min-width: 0;
}

.event-title {
  font-weight: var(--fw-semi);
  font-size: var(--fs-lg);
  color: var(--text-strong);
  margin-bottom: var(--sp-1);
  line-height: 1.3;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.event-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.event-tags {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
  row-gap: 6px;
}

.event-tags .partner-badge,
.event-tags .featured-badge {
  flex-shrink: 0;
}

.event-tags .featured-badge {
  width: 22px;
  height: 22px;
}

.tag {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: var(--fw-semi);
  letter-spacing: 0.01em;
}

.gemeinde-badge {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: var(--fw-medium);
}

.no-results {
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-md);
  background: var(--surface-0);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-1);
}

.no-results strong {
  display: block;
  font-size: var(--fs-lg);
  color: var(--text-strong);
  margin-bottom: var(--sp-2);
}

/* =====================
   Map-View
===================== */
.map-container {
  height: 560px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-1);
  /* Stacking-Context isolieren - Leaflet-Panes nutzen z-index bis 1000
     und wuerden sonst ueber Header/Toolbar liegen */
  position: relative;
  z-index: 0;
  isolation: isolate;
}

#map {
  width: 100%;
  height: 100%;
}

.map-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid white;
}

.map-pin span {
  transform: rotate(45deg);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  color: white;
}

.map-pin.cat-kultur       { background: var(--cat-kultur); }
.map-pin.cat-gemeinschaft { background: var(--cat-gemeinschaft); }
.map-pin.cat-religion     { background: var(--cat-religion); }
.map-pin.cat-sport        { background: var(--cat-sport); }
.map-pin.cat-natur        { background: var(--cat-natur); }
.map-pin.cat-markt        { background: var(--cat-markt); }
.map-pin.cat-gastro       { background: var(--cat-gastro); }
.map-pin.cat-kinder       { background: var(--cat-kinder); }
.map-pin.cat-jugend       { background: var(--cat-jugend); }
.map-pin.cat-politik      { background: var(--cat-politik); }

/* Approximate-Pin: gestrichelt + leicht transparent, signalisiert "ungefähre Lage" */
.map-pin.is-approximate {
  border-style: dashed;
  border-width: 2.5px;
  opacity: 0.75;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.map-pin.is-approximate span {
  opacity: 0.85;
}

/* Animationen */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 170, 10, 0), var(--shadow-sm); }
  50%      { box-shadow: 0 0 18px 2px rgba(232, 170, 10, 0.22), var(--shadow-sm); }
}

.animate-in {
  animation: fadeInUp var(--dur-slow) var(--ease-out) both;
}

/* Hero-Einblendung gestaffelt beim Seitenaufruf */
.hero-eyebrow,
.hero h1,
.hero-sub,
.hero-actions,
.hero-stats {
  animation: fadeInUp 680ms var(--ease-out) both;
}
.hero-eyebrow         { animation-delay: 0ms; }
.hero h1              { animation-delay: 80ms; }
.hero-sub             { animation-delay: 180ms; }
.hero-actions         { animation-delay: 260ms; }
.hero-stats           { animation-delay: 340ms; }

/* Partner-Items im Hero einzeln einblenden */
.hero-partner {
  animation: fadeInRight 500ms var(--ease-out) both;
  animation-delay: calc(520ms + var(--partner-index, 0) * 90ms);
}

/* Event-Spotlight (Sidebar): sanfter Gold-Glow-Puls - nur Desktop */
@media (min-width: 769px) {
  .card--spotlight {
    animation: spotlightPulse 4.5s var(--ease-std) infinite;
  }
}

/* Chip-Hover leichter Lift */
.chip {
  transition:
    background var(--dur-fast) var(--ease-std),
    border-color var(--dur-fast) var(--ease-std),
    color var(--dur-fast) var(--ease-std),
    transform var(--dur-fast) var(--ease-std),
    box-shadow var(--dur-fast) var(--ease-std);
}
.chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

/* Barrierefreiheit: Animationen deaktivieren wenn System Reduced-Motion signalisiert */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
