/* Jodlerfest Basel - Energische, chaotische Website */

:root {
  /* Jodlerfest Farbpalette - Traditionell & Elegant */
  --primary: #C41E3A;      /* Klassisches Jodlerfest-Rot */
  --secondary: #8B1538;    /* Burgunder/Dunkelrot */
  --accent: #F5F5F5;       /* Weiß/Hell */
  --dark: #1a1a1a;         /* Schwarz */
  --dark-blue: #0d0d0d;    /* Sehr dunkel */
  --light: #f5f5f5;        /* Hell */
  --text: #ffffff;
  
  --glow: #C41E3A;
  --glow-secondary: #8B1538;
  --header-clearance: 96px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0a0a0a 100%);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  overflow: hidden;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.95) 0%, rgba(10, 10, 10, 0.7) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 4px 20px rgba(196, 30, 58, 0.4);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 2rem;
  font-weight: bold;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 5px;
  font-style: italic;
}

/* Navigation */
nav {
  display: flex;
  gap: 15px;
  align-items: center;
}

nav a, nav button {
  background: rgba(196, 30, 58, 0.1);
  border: 1px solid var(--primary);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

nav a:hover, nav button:hover {
  background: var(--primary);
  box-shadow: 0 0 20px rgba(196, 30, 58, 0.6);
  transform: translateY(-2px);
}

.menu-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.1rem;
  background: rgba(196, 30, 58, 0.15);
  border: 1px solid rgba(196, 30, 58, 0.5);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 180px;
  background: rgba(12, 12, 12, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 110;
}

.menu-panel.open {
  display: block;
}

.menu-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
}

.menu-panel .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
}

.about-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 20px;
}

.about-panel.open {
  display: flex;
}

.about-panel-inner {
  max-width: 520px;
  width: 100%;
  background: rgba(18, 18, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 28px;
  position: relative;
}

.about-panel-inner h2 {
  margin-bottom: 14px;
  color: var(--accent);
}

.about-panel-inner p {
  line-height: 1.7;
  color: rgba(245, 245, 245, 0.92);
}

/* Main Container */
main {
  position: relative;
  width: 100%;
  height: 100vh;
  padding-top: 80px;
}

#universe-container {
  position: absolute;
  top: var(--header-clearance);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.universe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Hintergrund-Layer hinter der Bilderwolke */
#universe-container {
  overflow: hidden;
}

#universe-container::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Direktes Laden des Hintergrundbilds aus dem Root */
  background-image: url('../DSCF1107_V2.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.35;
  filter: grayscale(1) contrast(1.1);
  z-index: 0;
  pointer-events: none;
}

/* Subtile Vignette/Overlay über dem Hintergrund, aber unter der Canvas */
#universe-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.25) 100%);
  mix-blend-mode: multiply;
  opacity: 0.3;
  z-index: 1;
  pointer-events: none;
}

.universe-canvas {
  position: relative;
  z-index: 2;
}

.site-credit {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 130;
  font-size: 0.74rem;
  color: rgba(245, 245, 245, 0.82);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Responsive Design für Mobile */
@media (max-width: 768px) {
  header {
    padding: 15px;
    border-bottom: 2px solid var(--primary);
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
  }

  h1 {
    font-size: 1.3rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  nav {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  nav a, nav button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  main {
    padding-top: 120px;
  }

  /* Filter Panel für Mobile */
  .filter-panel {
    position: fixed;
    right: 0;
    top: 100px;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 50vh;
    border-radius: 0;
    border: none;
    border-top: 2px solid var(--primary);
    z-index: 40;
    transition: transform 0.3s ease;
    transform: translateY(100%);
  }

  .filter-panel.open {
    transform: translateY(0);
  }

  .filter-panel h3 {
    font-size: 0.95rem;
  }

  .tag-button {
    padding: 6px 10px;
    margin: 4px;
    font-size: 0.75rem;
  }

  #clear-filters {
    padding: 8px;
    font-size: 0.85rem;
  }

  /* Modal für Mobile */
  .modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
    gap: 10px;
  }

  #modal-image {
    width: 100%;
    height: 50%;
    object-fit: cover;
  }

  .modal-info {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
  }

  .modal-info h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .modal-info p {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-download {
    font-size: 0.76rem;
    padding: 7px 11px;
  }

  .modal-consent-panel {
    padding: 10px;
  }

  .modal-consent-label,
  .modal-consent-checks label,
  .modal-consent-input {
    font-size: 0.78rem;
  }

  .modal-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .modal-back, .modal-close, .modal-nav {
    font-size: 1.2rem;
    padding: 12px;
    width: 50px;
    height: 50px;
  }

  .modal-back {
    top: 10px;
    left: 10px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }

  .modal-prev {
    bottom: 20px;
    left: 20px;
  }

  .modal-next {
    bottom: 20px;
    right: 20px;
  }

  .universe-hint {
    bottom: 15px;
    font-size: 0.8rem;
  }

  .site-credit {
    left: 12px;
    bottom: 8px;
    font-size: 0.66rem;
    max-width: calc(100vw - 24px);
    line-height: 1.3;
  }

  /* Universe Settings für Mobile */
  :root {
    --cloud-distance: 240px;
    --cloud-scale: 0.85;
    --particle-size: 80px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.1rem;
  }

  .subtitle {
    display: none;
  }

  main {
    padding-top: 100px;
  }

  .filter-panel {
    top: 80px;
  }

  .modal-content {
    gap: 5px;
  }

  #modal-image {
    height: 40%;
  }

  .modal-back, .modal-close, .modal-nav {
    font-size: 1rem;
    padding: 10px;
    width: 44px;
    height: 44px;
  }

  .tag-button {
    padding: 5px 8px;
    font-size: 0.7rem;
  }

  .universe-hint {
    font-size: 0.7rem;
    bottom: 10px;
  }
}

.filter-panel h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

.filter-btn {
  position: fixed;
  top: 96px;
  right: 18px;
  z-index: 105;
  background: rgba(196, 30, 58, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f5f5f5;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(196, 30, 58, 0.2);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.filter-btn:hover {
  transform: translateY(-1px);
  background: rgba(196, 30, 58, 1);
}

.filter-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  width: min(360px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  padding: 18px;
  border-radius: 24px;
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  transform: translateY(-120%);
  opacity: 0;
  visibility: hidden;
  z-index: 45;
  transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.filter-panel.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
}

.close-filter {
  background: transparent;
  border: none;
  color: #f5f5f5;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.close-filter:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  padding-right: 4px;
}

.universe-hint {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.universe-hint.hide {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.tag-button {
  display: inline-block;
  background: rgba(196, 30, 58, 0.15);
  border: 1px solid rgba(196, 30, 58, 0.5);
  color: var(--text);
  padding: 8px 12px;
  margin: 0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.tag-button:hover {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(196, 30, 58, 0.6);
  transform: scale(1.05);
}

.tag-button.active {
  background: var(--primary);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(245, 245, 245, 0.6);
  font-weight: bold;
}

#clear-filters {
  width: 100%;
  background: rgba(196, 30, 58, 0.2);
  border: 1px solid var(--primary);
  color: var(--text);
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

#clear-filters:hover {
  background: var(--primary);
  box-shadow: 0 0 15px rgba(196, 30, 58, 0.6);
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 30px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 0 50px rgba(196, 30, 58, 0.4);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
  text-shadow: 0 0 20px rgba(196, 30, 58, 0.6);
}

#modal-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 0 30px rgba(196, 30, 58, 0.3);
}

.modal-info {
  color: var(--text);
}

.modal-info h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--accent);
}

.modal-info p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

#modal-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.modal-download {
  border: 1px solid rgba(245, 245, 245, 0.28);
  background: rgba(196, 30, 58, 0.2);
  color: #f5f5f5;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.modal-download:hover {
  transform: translateY(-1px);
  background: rgba(196, 30, 58, 0.9);
}

.modal-download-status {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 0.78rem;
  color: rgba(245, 245, 245, 0.8);
}

.modal-consent-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 245, 245, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.modal-consent-title {
  margin: 0 0 6px 0;
  font-weight: 700;
  color: var(--accent);
}

.modal-consent-filename {
  margin: 0 0 10px 0;
  font-size: 0.78rem;
  color: rgba(245, 245, 245, 0.8);
}

.modal-consent-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: rgba(245, 245, 245, 0.9);
}

.modal-consent-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid rgba(245, 245, 245, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #f5f5f5;
  font-size: 0.9rem;
}

.modal-consent-checks {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.modal-consent-checks label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(245, 245, 245, 0.9);
}

.modal-consent-checks input[type='checkbox'] {
  margin-top: 1px;
}

.modal-verify-wrap {
  margin-top: 10px;
  border-top: 1px dashed rgba(245, 245, 245, 0.25);
  padding-top: 10px;
}

.modal-tag {
  background: rgba(196, 30, 58, 0.2);
  border: 1px solid var(--primary);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
}
/* Modal navigation buttons */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 210;
}

.modal-prev { left: 10px; }
.modal-next { right: 10px; }

/* Optional background image (dezent) */
body.has-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center center;
  opacity: 0.12;
  filter: blur(1px) saturate(0.85);
  z-index: -1;
}

/* Back button in modal (top-left) */
.modal-back {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  background: rgba(196, 30, 58, 0.92);
  border: 2px solid rgba(255,255,255,0.9);
  color: var(--accent);
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 0.6px currentColor, 0 0 0.6px currentColor;
  z-index: 9999;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(196, 30, 58, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.modal-back:hover {
  background: #d42a49;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.52), 0 0 0 3px rgba(255, 255, 255, 0.22);
}

.modal-back:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

/* Show back button only when modal active */
.image-modal.active .modal-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    text-shadow: 0 0 30px rgba(196, 30, 58, 0.5);
  }
  50% {
    text-shadow: 0 0 60px rgba(196, 30, 58, 0.8);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.6);
  }
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }
  
  .filter-panel {
    right: 10px;
    top: 80px;
    max-width: 220px;
    max-height: 400px;
  }
  
  .filter-btn {
    top: 90px;
    right: 12px;
    padding: 7px 12px;
    font-size: 0.78rem;
  }
  
  header {
    padding: 15px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 10px;
  }
  
  nav {
    width: 100%;
    justify-content: center;
  }
  
  .modal-content {
    max-width: 95%;
    padding: 20px;
  }
}

/* Loading State */
.loading {
  animation: pulse 1s ease-in-out infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 10, 10, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #C41E3A, #8B1538);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8B1538, #C41E3A);
}

.universe-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.9);
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 12px 20px;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  z-index: 40;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.universe-hint p {
  margin: 0;
}

/* Final layout overrides: keep menu right in header and filter in top-right background area */
.header-content {
  position: relative;
  padding-right: 56px;
}

nav {
  position: fixed;
  right: 12px;
  top: 18px;
  transform: none;
  width: auto;
  justify-content: flex-end;
  z-index: 130;
}

.filter-btn {
  top: calc(var(--header-clearance) + 8px);
  right: 14px;
  z-index: 60;
}

.filter-panel {
  top: calc(var(--header-clearance) + 8px);
  max-height: calc(100vh - var(--header-clearance) - 24px);
}

@media (max-width: 768px) {
  .header-content {
    padding-right: 48px;
  }

  nav {
    right: 10px;
    top: 14px;
  }

  .filter-btn {
    top: calc(var(--header-clearance) + 6px);
    right: 10px;
  }

  .filter-panel {
    top: calc(var(--header-clearance) + 6px);
  }
}

@media (max-width: 480px) {
  .header-content {
    padding-right: 44px;
  }

  nav {
    right: 8px;
    top: 10px;
  }

  .filter-btn {
    top: calc(var(--header-clearance) + 4px);
    right: 8px;
    padding: 6px 10px;
    font-size: 0.74rem;
  }
}
