/* ============================================
   SFV Abtsgmünd - Modern Responsive CSS
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Farben */
  --primary: #1a5f4a;
  --primary-light: #2d8a6e;
  --primary-dark: #0d3d2f;
  --accent: #3498db;
  --accent-light: #5dade2;
  
  /* Hintergründe */
  --bg-light: #f8faf9;
  --bg-section: #ffffff;
  --bg-header: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  
  /* Text */
  --text-dark: #2c3e50;
  --text-muted: #6c757d;
  --text-light: #ffffff;
  
  /* Schatten */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
  
  /* Abstände */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 80px;
  --nav-height: 60px;
  
  /* Übergänge */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-light);
}

/* ---------- Header mit Slideshow ---------- */
.header {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: var(--bg-header);
}

.header-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  color: var(--text-light);
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.header-content h1 {
  color: var(--text-light);
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xs);
}

.header-content .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Slideshow */
.slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slideshow img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: slideshow 110s infinite;
}

/* Animation für 22 Bilder: je 5s anzeigen */
.slideshow img:nth-child(1) { animation-delay: 0s; }
.slideshow img:nth-child(2) { animation-delay: 5s; }
.slideshow img:nth-child(3) { animation-delay: 10s; }
.slideshow img:nth-child(4) { animation-delay: 15s; }
.slideshow img:nth-child(5) { animation-delay: 20s; }
.slideshow img:nth-child(6) { animation-delay: 25s; }
.slideshow img:nth-child(7) { animation-delay: 30s; }
.slideshow img:nth-child(8) { animation-delay: 35s; }
.slideshow img:nth-child(9) { animation-delay: 40s; }
.slideshow img:nth-child(10) { animation-delay: 45s; }
.slideshow img:nth-child(11) { animation-delay: 50s; }
.slideshow img:nth-child(12) { animation-delay: 55s; }
.slideshow img:nth-child(13) { animation-delay: 60s; }
.slideshow img:nth-child(14) { animation-delay: 65s; }
.slideshow img:nth-child(15) { animation-delay: 70s; }
.slideshow img:nth-child(16) { animation-delay: 75s; }
.slideshow img:nth-child(17) { animation-delay: 80s; }
.slideshow img:nth-child(18) { animation-delay: 85s; }
.slideshow img:nth-child(19) { animation-delay: 90s; }
.slideshow img:nth-child(20) { animation-delay: 95s; }
.slideshow img:nth-child(21) { animation-delay: 100s; }
.slideshow img:nth-child(22) { animation-delay: 105s; }

@keyframes slideshow {
  0% { opacity: 0; }
  1% { opacity: 1; }
  4.5% { opacity: 1; }
  5% { opacity: 0; }
  100% { opacity: 0; }
}

.slideshow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(26, 95, 74, 0.45) 0%,
    rgba(26, 95, 74, 0.25) 50%,
    rgba(26, 95, 74, 0.45) 100%
  );
  z-index: 5;
}

/* ---------- Navigation ---------- */
.nav {
  background: var(--bg-section);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-md);
}

.nav-logo {
  height: 100px;
  padding: var(--spacing-xs) 0;
}

.nav-logo img {
  height: 100%;
  width: auto;
}

/* Desktop Navigation */
.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-xs);
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-dark);
  font-weight: 500;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.nav-menu a:hover {
  background: var(--bg-light);
  color: var(--primary);
}

/* Dropdown */
.nav-menu .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-section);
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
}

.nav-menu li:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown li {
  width: 100%;
}

.dropdown a {
  padding: var(--spacing-sm);
  border-radius: 0;
}

.dropdown a:hover {
  background: var(--primary);
  color: var(--text-light);
}

/* Hamburger Menü (Mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--spacing-sm);
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

#nav-checkbox {
  display: none;
}

/* ---------- Main Content ---------- */
.main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg);
  width: 100%;
}

.content-section {
  background: var(--bg-section);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.content-section h3 {
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

/* Tabellen */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
}

table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

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

.date-cell {
  white-space: nowrap;
  font-weight: 500;
  color: var(--primary);
  width: 120px;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--primary-dark);
  color: var(--text-light);
  padding: var(--spacing-md) 0;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.footer a {
  color: var(--text-light);
  opacity: 0.8;
}

.footer a:hover {
  opacity: 1;
}

.footer-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }

/* Download-Liste */
.download-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--spacing-md);
  list-style: none;
}

.download-list li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-light);
  border-radius: 8px;
  text-align: center;
  color: var(--text-dark);
  transition: all var(--transition-fast);
}

.download-list li a:hover {
  background: var(--primary);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Platzhalter-Box */
.placeholder-box {
  text-align: center;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 2px dashed var(--primary-light);
}

.placeholder-box p {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0;
}

/* Bildergalerie */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--spacing-sm);
}

.gallery a {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--transition-fast);
}

.gallery a:hover {
  transform: scale(1.05);
}

.gallery img {
  width: 100%;
  height: auto;
  display: block;
}

/* Vorstand/Board */
.board-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.board-group h4 {
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.member-list {
  list-style: none;
}

.member-list li {
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid #eee;
}

.member-list li:last-child {
  border-bottom: none;
}

/* Links-Seite */
.links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  list-style: none;
}

.links-list li {
  text-align: center;
}

.links-list img {
  max-width: 100px;
  margin-bottom: var(--spacing-xs);
}

/* Gewaesserordnung Tabelle */
.rules-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
}

.rules-table th,
.rules-table td {
  padding: var(--spacing-sm);
  border: 1px solid #ddd;
  text-align: left;
}

.rules-table th {
  background: var(--primary);
  color: var(--text-light);
}

.rules-table tr:nth-child(even) {
  background: var(--bg-light);
}

/* ---------- Responsive (Mobile First) ---------- */
@media (max-width: 768px) {
  /* Header */
  .header {
    height: 200px;
  }
  
  .header-content h1 {
    font-size: 1.8rem;
  }
  
  /* Navigation */
  .nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-section);
    flex-direction: column;
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }
  
  #nav-checkbox:checked ~ .nav-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  #nav-checkbox:checked ~ .nav-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  #nav-checkbox:checked ~ .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  
  #nav-checkbox:checked ~ .nav-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .nav-menu .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: var(--spacing-md);
  }
  
  /* Main */
  .main {
    padding: var(--spacing-sm);
  }
  
  .content-section {
    padding: var(--spacing-md);
  }
  
  /* Table */
  table td {
    display: block;
    padding: var(--spacing-xs);
  }
  
  .date-cell {
    width: 100%;
    padding-bottom: 0;
  }
  
  /* Footer */
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  .header {
    height: 150px;
  }
  
  .header-content h1 {
    font-size: 1.5rem;
  }
}
