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

:root {
  --color-primary: #c0611a;
  --color-primary-dark: #a04f10;
  --color-bg: #f5f1ec;
  --color-text: #2c2c2c;
  --color-text-light: #666;
  --color-white: #fff;
  --color-ar: #2ecc71;
  --color-ar-dark: #27ae60;
  --header-h: 44px;
  --map-h: 22vh;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* === Header === */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--color-primary);
  color: var(--color-white);
}

#header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

#info-btn {
  color: var(--color-white);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  width: 28px;
  text-align: center;
}

#donate-btn {
  color: var(--color-white);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  padding: 3px 8px;
}

#app-header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

#lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.2);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  padding: 4px 24px 4px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* === Map === */
#map-section {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: var(--map-h);
  z-index: 500;
}

#map {
  width: 100%;
  height: 100%;
}

/* === Content === */
#content-section {
  position: fixed;
  top: calc(var(--header-h) + var(--map-h));
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 100px;
  background: var(--color-white);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}

/* Station title */
#station-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

/* === Gallery === */
#gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #ddd;
}

#gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

#gallery-track img,
#gallery-track svg {
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  pointer-events: none;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: var(--color-white);
  font-size: 22px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

#gallery-prev { left: 8px; }
#gallery-next { right: 8px; }

#gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

#gallery-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.2s;
}

#gallery-dots .dot.active {
  background: var(--color-white);
}

/* === Station Text === */
#station-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: 16px;
  white-space: pre-line;
}

/* === Audio === */
#audio-section {
  margin-bottom: 12px;
}

#audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#audio-btn:active {
  background: var(--color-primary-dark);
}

#audio-btn.playing {
  background: var(--color-primary-dark);
}

#audio-btn.playing #audio-icon {
  display: inline-block;
}

/* === AR Button === */
#ar-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  background: var(--color-ar);
  color: var(--color-white);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  margin-bottom: 16px;
  transition: background 0.2s;
}

#ar-btn:active {
  background: var(--color-ar-dark);
}

/* === Station Nav === */
#station-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
  margin-bottom: 12px;
}

#station-nav button {
  background: none;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#station-nav button:active {
  background: var(--color-primary);
  color: var(--color-white);
}

#station-nav button:disabled {
  opacity: 0.3;
  pointer-events: none;
}

#station-indicator {
  font-size: 13px;
  color: var(--color-text-light);
  font-weight: 500;
}

/* === GPS Hint / Button === */
#gps-hint {
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  background: #fef9e7;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  margin-top: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#gps-hint:active {
  background: var(--color-primary);
  color: var(--color-white);
}

#gps-hint.gps-active {
  background: #e8f8f0;
  border-color: var(--color-ar);
  color: var(--color-ar-dark);
  cursor: default;
}

/* === Leaflet overrides === */
.leaflet-container {
  background: #a8c9a5;
}

.station-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--color-white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s, background 0.2s;
}

.station-marker.active {
  background: #e74c3c;
  transform: scale(1.3);
  z-index: 1000 !important;
}

.user-dot {
  width: 14px;
  height: 14px;
  background: #3498db;
  border: 2px solid var(--color-white);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(52,152,219,0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(52,152,219,0.6); }
  50% { box-shadow: 0 0 16px rgba(52,152,219,0.9); }
}

/* Path line */
.tour-path {
  stroke: var(--color-primary);
  stroke-opacity: 0.7;
  stroke-dasharray: 8 6;
}
