/* ============================================================
 * Urfahraner Markt 2026 – Interaktiver Lageplan
 * Autonomes Stylesheet, keine externen Abhängigkeiten (DSGVO)
 * ============================================================ */

/* ---------- DM Sans (lokal, keine Google Fonts) ---------- */
@font-face {
  font-family: 'DM Sans';
  src: url('DMSans-VariableFont_opsz,wght.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('DMSans-Italic-VariableFont_opsz,wght.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 10px 5px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #333;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards 0.2s;
  margin-bottom: 0.3rem;
}

.subtitle {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards 0.4s;
}

/* ========== MAP CONTAINER ========== */
.map-container {
  position: relative;
  width: 1200px;
  max-width: 95vw;
  aspect-ratio: 2000 / 701;
}

/* ========== IMAGE LAYERS ========== */
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* ===== BACKGROUND ===== */
.layer-umland {
  animation: layerFadeIn 0.6s ease forwards 0.3s;
  z-index: 2;
}

/* ===== THREE MAIN AREAS ===== */
.layer-west {
  animation: layerSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.6s;
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-mitte {
  animation: layerSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.8s;
  z-index: 11;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-ost {
  animation: layerSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.0s;
  z-index: 12;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BUILDINGS & STRUCTURES ===== */
.layer-festzelt {
  animation: layerBuildIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.3s;
  z-index: 20;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-hallen {
  animation: layerBuildIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.5s;
  z-index: 21;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ALWAYS-ON TOP LAYERS (never dimmed) ===== */
.layer-donau {
  animation: layerPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.8s;
  z-index: 60;
}

.layer-wc {
  animation: layerPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.9s;
  z-index: 61;
}

.layer-medialounge {
  animation: layerPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 2.0s;
  z-index: 62;
}

.layer-info {
  animation: layerPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 2.1s;
  z-index: 63;
}

.layer-bankomat {
  animation: layerPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 2.2s;
  z-index: 64;
}

/* Hover effects on interactive layers */
.layer-west:hover,
.layer-mitte:hover,
.layer-ost:hover,
.layer-festzelt:hover,
.layer-hallen:hover {
  filter: brightness(1.06);
}

/* ========== ANIMATIONS ========== */
@keyframes layerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes layerSlideIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes layerBuildIn {
  from { opacity: 0; transform: translateY(15px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes layerPopIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== FERRIS WHEEL ========== */
.ferris-container {
  position: absolute;
  top: 46%;
  left: 31.5%;
  width: 7.5%;
  aspect-ratio: 1;
  z-index: 55;
  opacity: 0;
  animation: ferrisAppear 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 1.8s;
  pointer-events: none;
}

@keyframes ferrisAppear {
  from { opacity: 0; transform: scale(0.2) rotate(-30deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.ferris-wheel {
  position: absolute;
  inset: 0;
  animation: ferrisSpin 25s linear infinite;
}

@keyframes ferrisSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ferris-spoke {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48%;
  height: 1.5px;
  background: rgba(120,110,100,0.7);
  transform-origin: left center;
}

.ferris-gondola {
  position: absolute;
  width: 7px;
  height: 5px;
  border-radius: 1px 1px 2px 2px;
  top: 50%;
  right: -3px;
  transform: translateY(-50%);
  opacity: 0.85;
}

.ferris-rim {
  position: absolute;
  inset: 8%;
  border: 1.8px solid rgba(120,110,100,0.6);
  border-radius: 50%;
}

.ferris-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #908880;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
}

.ferris-support-l,
.ferris-support-r {
  position: absolute;
  width: 2px;
  height: 60%;
  background: rgba(120,110,100,0.5);
  z-index: -1;
  top: 50%;
}

.ferris-support-l {
  left: 38%;
  transform-origin: top right;
  transform: rotate(15deg);
}

.ferris-support-r {
  right: 38%;
  transform-origin: top left;
  transform: rotate(-15deg);
}

/* ========== LEGEND ========== */
.legend {
  display: flex;
  gap: 22px;
  margin-top: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards 2.4s;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 10px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  color: #999;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.legend-item:hover {
  background: rgba(0,0,0,0.04);
}

.legend-item.dimmed {
  opacity: 0.35;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-letter {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid #555;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: #333;
  line-height: 1;
  background: transparent;
}

.hint {
  font-size: 0.78rem;
  color: #bbb;
  margin-top: 0.5rem;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards 2.6s;
}

/* Dimmed state for layers */
.layer.dimmed {
  opacity: 0.12 !important;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Highlighted state */
.layer.highlighted {
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
  transform: translateY(-2px);
  z-index: 45;
  transition: opacity 2.5s cubic-bezier(0.4, 0, 0.2, 1), filter 2.5s cubic-bezier(0.4, 0, 0.2, 1), transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend-item.active-legend {
  background: rgba(0,0,0,0.08);
  font-weight: 600;
}
