* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #ecf0f1;
  --accent: #C6282D;
  --light: #F6EAE9;
  --dark: #3E3F41;
  --text: #3E3F41;
  --white: #fff;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --primary-dark: #285a94;
  --accent-dark: #a12125;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  line-height: 1.6;
}

/* Navigation */
nav {
  background: var(--primary);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  color: var(--dark);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

nav .logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

nav .logo span { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
}

nav ul li a {
  color: var(--dark);
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
  display: block;
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--accent);
  color: var(--white);
}

.burger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
}

.burger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--dark);
  margin: 5px 0;
  transition: 0.3s;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--dark), #1a1b1d);
  color: var(--white);
  text-align: center;
  padding: 4rem 2rem;
}

.hero-logo {
  height: 120px;
  width: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.hero h1 { font-size: 2.8rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* Timed Banner */
.timed-banner {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  text-align: center;
}

.timed-banner img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.timed-banner .banner-caption {
  margin-top: 0.5rem;
  font-style: italic;
  color: #666;
}

/* Content */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.content h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.content p { margin-bottom: 1rem; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s;
}

.card:hover { transform: translateY(-5px); }

.card-body {
  padding: 1.5rem;
}

.card-body h3 {
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.card-body .date {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Termine Tabelle */
.termine-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.termine-table th,
.termine-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.termine-table th {
  background: var(--dark);
  color: var(--white);
}

.termine-table tr:hover { background: var(--light); }

/* Galerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.gallery-item:hover { transform: scale(1.03); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10;
}

/* Slideshow */
.slideshow-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 3000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.slideshow-overlay.active { display: flex; }

.slideshow-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  color: var(--white);
  z-index: 10;
}

.slideshow-header .slide-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.slideshow-header .slide-counter {
  font-size: 0.95rem;
  opacity: 0.7;
}

.slideshow-close {
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  z-index: 10;
  position: relative;
}

.slideshow-img-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4rem 5rem;
  position: relative;
}

.slideshow-img-container img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  transition: opacity 0.4s ease;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.slideshow-img-container img.fade { opacity: 0; }

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: none;
  font-size: 2.5rem;
  width: 50px;
  height: 70px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.slide-nav:hover { background: rgba(255,255,255,0.3); }
.slide-prev { left: 1rem; }
.slide-next { right: 1rem; }

.slideshow-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
}

.slideshow-footer button {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.3s;
  z-index: 10;
  position: relative;
}

.slideshow-footer button:hover { background: rgba(255,255,255,0.3); }
.slideshow-footer button.active { background: var(--accent); }

.slide-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  border: none;
  padding: 0;
}

.slide-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.btn-slideshow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--dark);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
  margin-left: 1rem;
  vertical-align: middle;
}

.btn-slideshow:hover { background: var(--accent); }

@media (max-width: 768px) {
  .slideshow-img-container { padding: 4rem 1rem; }
  .slide-nav { font-size: 1.8rem; width: 36px; height: 50px; }
  .slide-dots { display: none; }
}

/* Kontakt */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.contact-form input,
.contact-form textarea,
.contact-form select {
  padding: 0.8rem 1rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea { resize: vertical; min-height: 150px; }

.btn {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
  font-weight: 600;
}

.btn:hover { background: var(--accent-dark); }

.contact-info h3 { color: var(--dark); margin-bottom: 1rem; }
.contact-info p { margin-bottom: 0.8rem; }
.contact-info i { color: var(--accent); margin-right: 0.5rem; }

/* Admin */
.admin-login {
  max-width: 400px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-login h2 { display: block; width: 100%; }

.admin-panel {
  display: none;
  margin-top: 2rem;
}

.admin-panel.visible { display: block; }

.admin-section {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.admin-section h3 {
  color: var(--dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--light);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  color: var(--dark);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.banner-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--light);
  border-radius: 6px;
}

.banner-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
}

.banner-list {
  margin-top: 1.5rem;
}

.banner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--light);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.banner-item .info { flex: 1; }
.banner-item .info strong { color: var(--dark); }
.banner-item .info small { display: block; color: #666; margin-top: 0.3rem; }

.btn-delete {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-delete:hover { background: var(--accent-dark); }

.status-active { color: #27ae60; font-weight: 600; }
.status-expired { color: #e74c3c; font-weight: 600; }
.status-scheduled { color: #f39c12; font-weight: 600; }

.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: none;
}

.alert-success { background: #d4edda; color: #155724; display: block; }
.alert-error { background: #f8d7da; color: #721c24; display: block; }

/* Footer */
footer {
  background: var(--dark);
  color: var(--light);
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

footer img {
  height: 40px;
  width: auto;
  margin-bottom: 0.8rem;
  opacity: 0.85;
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 0.8rem 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: transform 0.3s, opacity 0.3s;
  text-decoration: none;
}

.social-links a:hover {
  transform: scale(1.15);
  opacity: 0.85;
  text-decoration: none;
}

.social-links svg {
  width: 28px;
  height: 28px;
}

/* Responsive */
@media (max-width: 768px) {
  .burger { display: block; }

  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 1rem;
    border-top: 2px solid #ddd;
    box-shadow: var(--shadow);
  }

  nav ul.open { display: flex; }

  .hero h1 { font-size: 2rem; }
  .contact-wrapper { grid-template-columns: 1fr; }

  .termine-table { font-size: 0.85rem; }
  .termine-table th, .termine-table td { padding: 0.6rem; }
}

/* Legal Pages */
.legal-content h2 {
  margin-top: 2.5rem;
}

.legal-content h3 {
  color: var(--dark);
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

.legal-content ul {
  margin: 0.5rem 0 1rem 1.5rem;
}

.legal-content ul li {
  margin-bottom: 0.4rem;
}

.legal-content a {
  color: var(--accent);
}

/* Datenschutz-Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0.3rem;
  width: auto;
  accent-color: var(--accent);
}

.checkbox-group label {
  font-size: 0.9rem;
  color: #555;
  font-weight: normal;
}

.checkbox-group a {
  color: var(--accent);
}

/* Cookie Banner */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  color: var(--white);
  padding: 1.5rem 2rem;
  z-index: 5000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.cookie-banner.visible { display: block; }

.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-inner p {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-inner a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 0.8rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.3s;
}

.cookie-btn-accept {
  background: var(--accent);
  color: var(--white);
}

.cookie-btn-accept:hover { background: var(--accent-dark); }

.cookie-btn-decline {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

.cookie-btn-decline:hover { background: rgba(255,255,255,0.3); }

@media (max-width: 768px) {
  .cookie-inner { flex-direction: column; text-align: center; }
  .cookie-buttons { width: 100%; justify-content: center; }
}

/* Countdown */
.countdown-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.countdown-box {
  background: linear-gradient(135deg, var(--dark), #1a1b1d);
  color: var(--white);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.countdown-box h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.countdown-box .event-name { color: var(--accent); font-size: 1.1rem; margin-bottom: 1rem; }

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.countdown-unit {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  min-width: 80px;
}

.countdown-unit .number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.countdown-unit .label {
  font-size: 0.8rem;
  opacity: 0.7;
  text-transform: uppercase;
}

/* Wetter Widget */
.weather-widget {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
}

.weather-widget .weather-icon { font-size: 2.5rem; }
.weather-widget .weather-info .temp { font-size: 1.8rem; font-weight: 700; color: var(--dark); }
.weather-widget .weather-info .desc { color: #666; font-size: 0.9rem; }
.weather-widget .weather-info .location { color: var(--accent); font-weight: 600; font-size: 0.85rem; }

/* Besucherzähler */
.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--light);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Dark Mode Toggle */
.darkmode-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.2);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 4000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.darkmode-toggle:hover { transform: scale(1.1); }

/* Dark Mode */
body.dark-mode {
  --primary: #1a1b1d;
  --light: #2a2b2d;
  --dark: #e0e0e0;
  --text: #d0d0d0;
  --white: #242526;
  --shadow: 0 2px 10px rgba(0,0,0,0.4);
  background: #121314;
}

body.dark-mode nav { background: #1a1b1d; border-bottom: 1px solid #333; }
body.dark-mode nav .logo { color: #e0e0e0; }
body.dark-mode nav ul li a { color: #ccc; }
body.dark-mode .burger span { background: #e0e0e0; }
body.dark-mode .card { background: #242526; }
body.dark-mode .card-body h3 { color: #e0e0e0; }
body.dark-mode .content h2 { color: #e0e0e0; }
body.dark-mode .termine-table th { background: #333; }
body.dark-mode .termine-table td { border-color: #444; }
body.dark-mode .termine-table tr:hover { background: #2a2b2d; }
body.dark-mode .admin-section { background: #242526; }
body.dark-mode .banner-item { background: #2a2b2d; }
body.dark-mode .banner-item .info strong { color: #e0e0e0; }
body.dark-mode .form-group input, body.dark-mode .form-group textarea { background: #333; color: #e0e0e0; border-color: #555; }
body.dark-mode .contact-form input, body.dark-mode .contact-form textarea { background: #333; color: #e0e0e0; border-color: #555; }
body.dark-mode footer { background: #0a0a0b; }
body.dark-mode .weather-widget { background: #242526; }
body.dark-mode .weather-widget .weather-info .temp { color: #e0e0e0; }
body.dark-mode .darkmode-toggle { background: #e0e0e0; color: #1a1b1d; }
body.dark-mode .legal-content h3 { color: #e0e0e0; }
body.dark-mode .contact-info h3 { color: #e0e0e0; }

@media (max-width: 768px) {
  .countdown-unit { min-width: 60px; padding: 0.7rem 1rem; }
  .countdown-unit .number { font-size: 1.6rem; }
}

/* Zurück-nach-oben Button */
.scroll-top {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 3999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: scale(1.1); background: var(--accent-dark); }

/* Ladeanimation */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}

.page-loader.hidden { opacity: 0; pointer-events: none; }

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Breadcrumbs */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 2rem;
  font-size: 0.85rem;
  color: #888;
}

.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

/* Event-Teilen */
.share-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.3s;
}

.share-btn:hover { opacity: 0.8; text-decoration: none; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.kalender { background: #3E3F41; }

/* Druckversion */
@media print {
  nav, footer, .cookie-banner, .darkmode-toggle, .scroll-top,
  .btn-slideshow, .kategorie-filter, .share-buttons,
  .page-loader, #cookie-banner, .breadcrumb { display: none !important; }

  body { color: #000; background: #fff; font-size: 12pt; }
  .hero { background: #fff !important; color: #000 !important; padding: 1rem 0; }
  .hero h1 { font-size: 18pt; color: #000; }
  .hero p { color: #333; }
  .content { padding: 1rem 0; }
  .content h2 { color: #000; border-color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .termine-table th { background: #ddd !important; color: #000 !important; }
  a { color: #000; text-decoration: underline; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
  nav a::after, footer a::after, .share-btn::after { content: none; }
  img { max-width: 100% !important; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery-item { break-inside: avoid; }
}
