/* ── Reset & Variables ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --magenta:       #e20074;
  --magenta-bg:    #fce4f1;
  --magenta-dark:  #b5005c;
  --white:         #ffffff;
  --bg:            #f4f4f6;
  --surface:       #ffffff;
  --border:        #e5e5ea;
  --text-1:        #ffffff;
  --text-2:        rgba(255,255,255,.7);
  --text-3:        rgba(255,255,255,.4);
  --bubble-size:   52px;
  --bubble-radius: 12px;
  --card-radius:   14px;
  --badge-radius:  6px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --t:             .18s ease;
}

html { font-size: 16px; }

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -60px) scale(1.1); }
  66%       { transform: translate(-30px, 30px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-50px, 40px) scale(0.9); }
  66%       { transform: translate(35px, -45px) scale(1.08); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(25px, 55px) scale(1.05); }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #1a0010;
  color: var(--text-1);
  line-height: 1.5;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(226, 0, 116, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 80% 70%, rgba(180, 0, 200, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 55% 10%, rgba(255, 0, 150, 0.25) 0%, transparent 50%),
    linear-gradient(135deg, #1a0010 0%, #2d0030 40%, #1a0020 70%, #0d0018 100%);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle 300px at 15% 25%, rgba(226, 0, 116, 0.18) 0%, transparent 70%),
    radial-gradient(circle 250px at 85% 60%, rgba(180, 0, 220, 0.15) 0%, transparent 70%),
    radial-gradient(circle 200px at 50% 85%, rgba(255, 50, 150, 0.12) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: gradientShift 18s ease infinite reverse;
}

.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  background: rgba(20, 0, 15, 0.55);
  border-bottom: 1px solid rgba(226, 0, 116, 0.2);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: .9375rem;
  color: #fff;
  letter-spacing: -.01em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 3px var(--magenta-bg);
}

.header-subtitle {
  font-size: .8rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ── Main Spacing ─────────────────────────────────────────────── */
main { padding: 24px 0 48px; }

/* ── Loading ──────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 72px 0;
  color: var(--text-2);
  font-size: .875rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--magenta);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ────────────────────────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 72px 0;
  color: var(--text-2);
  font-size: .875rem;
}

.error-icon svg {
  width: 40px;
  height: 40px;
  color: var(--text-3);
}

.hidden { display: none !important; }

/* ── Section Accordion ────────────────────────────────────────── */
.section {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(226, 0, 116, 0.18);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.04) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: background var(--t);
  -webkit-tap-highlight-color: transparent;
}

.section-header:hover  { background: rgba(0,0,0,.025); }
.section-header:active { background: rgba(0,0,0,.04);  }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .9375rem;
  color: rgba(255,255,255,.9);
}

.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.section-dot.upcoming { background: var(--magenta); }
.section-dot.finished { background: var(--text-3); }

.section-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  background: var(--magenta-bg);
  color: var(--magenta-dark);
  font-size: .72rem;
  font-weight: 800;
  border-radius: 11px;
  letter-spacing: .02em;
}

.badge-count.muted {
  background: var(--bg);
  color: var(--text-2);
}

.chevron {
  width: 17px;
  height: 17px;
  color: var(--text-3);
  transition: transform var(--t);
  flex-shrink: 0;
}

.section-header[aria-expanded="false"] .chevron {
  transform: rotate(-90deg);
}

.section-body {
  border-top: 1px solid var(--border);
  padding: 20px 18px 10px;
}

.section-body.collapsed { display: none; }

/* ── Timeline Container ───────────────────────────────────────── */
.timeline {
  position: relative;
}

/* The continuous vertical line */
.timeline::before {
  content: '';
  position: absolute;
  /* center of bubble: left edge (0) + half of bubble width (26px) - half line width (1px) = 25px */
  left: 25px;
  top: calc(var(--bubble-size) / 2);  /* start at center of first bubble */
  bottom: calc(var(--bubble-size) / 2 + 18px); /* end near center of last bubble */
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--magenta)            0%,
    var(--magenta)            75%,
    rgba(226, 0, 116, 0.08)  100%
  );
  border-radius: 1px;
  pointer-events: none;
}

/* ── Timeline Item ────────────────────────────────────────────── */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.timeline-item:last-child { margin-bottom: 4px; }

/* ── Date Bubble ──────────────────────────────────────────────── */
.date-bubble {
  flex-shrink: 0;
  width: var(--bubble-size);
  height: var(--bubble-size);
  background: var(--magenta);
  border-radius: var(--bubble-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  gap: 1px;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(226, 0, 116, .32);
  user-select: none;
}

.bubble-month {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .82;
  line-height: 1;
}

.bubble-day {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.bubble-weekday {
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
  line-height: 1;
}

.timeline-item.is-finished .date-bubble {
  background: var(--text-3);
  box-shadow: none;
}

/* ── Day Cards Container ──────────────────────────────────────── */
.day-cards {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Event Card ───────────────────────────────────────────────── */
.event-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--card-radius);
  padding: 13px 15px 13px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow var(--t), background var(--t);
}

.event-card:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(226, 0, 116, 0.2), 0 2px 8px rgba(0,0,0,.3);
}

/* Left accent bar */
.event-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--magenta);
  border-radius: 3px 0 0 3px;
}

.timeline-item.is-finished .event-card::before {
  background: var(--border);
}

/* Card Top Row: time + id */
.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-time {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
}

.card-id {
  font-size: .68rem;
  color: var(--text-3);
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  letter-spacing: .06em;
  flex-shrink: 0;
}

/* Card Title */
.card-title {
  display: none;
}

.timeline-item.is-finished .card-title {
  color: var(--text-2);
  font-weight: 600;
}

/* Card Bottom Row: badge + location */
.card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Status Badges */
.card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--badge-radius);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.badge-heute {
  background: var(--magenta-bg);
  color: var(--magenta);
}

.badge-morgen {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-geplant {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-abgeschlossen {
  background: var(--bg);
  color: var(--text-3);
}

/* Location */
.card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--text-2);
  min-width: 0;
  max-width: 100%;
}

.card-location svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: var(--text-3);
}

.card-location span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 28px 0 20px;
  color: var(--text-3);
  font-size: .85rem;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid rgba(226, 0, 116, 0.2);
  padding: 12px 0;
  background: rgba(20, 0, 15, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-footer .container {
  font-size: .73rem;
  color: var(--text-3);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root { --bubble-size: 48px; }

  .section-header { padding: 13px 14px; }
  .section-body   { padding: 16px 12px 8px; }

  .timeline-item  { gap: 14px; }

  .event-card {
    padding: 11px 13px 11px 16px;
  }

  .card-title { font-size: .875rem; }
}
