/* Aidonia — Interactive Map Styles */

:root {
  --color-bg: #282923;
  --color-text: #ECDEB4;
  --color-accent: #D85A2B;
  --color-neutral: #8B9299;
  --color-taupe: #A09589;
  --color-taupe-dark: #787270;
  --color-silver: #C4BFB9;

  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --header-height: 48px;
  --panel-width: 400px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--color-bg);
  z-index: 1000;
  border-bottom: 1px solid rgba(232, 221, 181, 0.1);
}

.header-logo-btn {
  background: none;
  border: none;
  padding: 0;
  margin-right: 12px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
}

.header-logo-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.header-logo {
  height: 28px;
  width: auto;
  color: var(--color-text);
  transition: color 0.15s ease;
}

.header-logo-btn:hover .header-logo {
  color: var(--color-accent);
}

.header-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
}

/* Map */
#map {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
}

/* Custom markers */
.marker-icon {
  background: none !important;
  border: none !important;
  color: var(--color-text);
  transition: transform 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.marker-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.marker-icon:hover {
  color: var(--color-accent);
  transform: scale(1.4);
}

.marker-venue {
  color: #3A8DB0;
}

.marker-venue:hover {
  color: #4DA8CC;
}

.marker-icon.active {
  color: var(--color-accent);
  filter: drop-shadow(0 0 6px rgba(217, 91, 43, 0.5));
}

/* Cluster icons */
/* Cluster icons */
.cluster-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
}

.marker-cluster {
  background: transparent !important;
}

.marker-cluster div {
  background: var(--color-bg) !important;
  border: 2px solid var(--color-accent);
  color: var(--color-text) !important;
}

.marker-cluster span {
  color: var(--color-text) !important;
  font-family: var(--font-main);
  font-weight: 700;
}

/* Panel (side panel on desktop, bottom sheet on mobile) */
.panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--panel-width);
  background: var(--color-bg);
  border-left: 1px solid rgba(232, 221, 181, 0.1);
  z-index: 900;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px 8px 4px;
}

.panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(232, 221, 181, 0.2);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.panel-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.panel-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.panel-photo {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  background: rgba(139, 146, 153, 0.15);
}

.panel-content {
  padding: 20px;
}

.panel-artist {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.panel-location {
  font-size: 13px;
  color: var(--color-neutral);
  margin-bottom: 16px;
}

.panel-bio {
  font-size: 14px;
  color: var(--color-silver);
  margin-bottom: 16px;
  font-style: italic;
}

.panel-context {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(236, 222, 180, 0.1);
}

.panel-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-taupe);
  text-decoration: none;
  border: 1px solid rgba(236, 222, 180, 0.15);
  border-radius: 4px;
  padding: 6px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.panel-links a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.panel-links a svg {
  width: 16px;
  height: 16px;
}

.panel-gallery {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-taupe);
  text-decoration: none;
  transition: color 0.15s ease;
}

.panel-gallery:hover {
  color: var(--color-accent);
}

/* Audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-top: 1px solid rgba(232, 221, 181, 0.1);
  border-bottom: 1px solid rgba(232, 221, 181, 0.1);
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-text);
  border-radius: 50%;
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.audio-play-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.audio-play-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.audio-progress-wrap {
  flex: 1;
  height: 4px;
  background: var(--color-neutral);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.audio-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.audio-time {
  font-size: 12px;
  color: var(--color-neutral);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

/* Loading indicator */
@keyframes map-pulse {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 0.4; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-text);
  animation: map-pulse 1.6s ease-in-out infinite;
  z-index: 500;
  pointer-events: none;
}

.map-loading.hidden {
  display: none;
}

/* Map background — sea color from poster */
#map {
  background: #282923;
}

/* Leaflet overrides */
.leaflet-control-zoom {
  border: none !important;
}

.leaflet-control-zoom a {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
  border: 1px solid rgba(236, 222, 180, 0.3) !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 16px !important;
}

.leaflet-control-zoom a:hover {
  background: var(--color-bg) !important;
  color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
}

.leaflet-control-zoom a:focus-visible {
  outline: 2px solid var(--color-accent) !important;
  outline-offset: 2px !important;
}

.leaflet-control-attribution {
  background: rgba(40, 41, 35, 0.8) !important;
  color: var(--color-taupe-dark) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: var(--color-taupe) !important;
}

/* Fly button */
.fly-btn {
  margin-left: auto;
  height: 28px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(236, 222, 180, 0.3);
  border-radius: 14px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.fly-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.fly-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.fly-btn.active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

.fly-btn.active:hover {
  background: #e8632f;
  border-color: #e8632f;
  color: var(--color-bg);
}

/* Info button */
.info-btn {
  margin-left: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(236, 222, 180, 0.3);
  border-radius: 50%;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.info-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.info-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Info overlay */
.info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  background: rgba(40, 41, 35, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.info-overlay.hidden {
  display: none;
}

.info-panel {
  position: relative;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--color-bg);
  border: 1px solid rgba(236, 222, 180, 0.1);
  border-radius: 8px;
  padding: 32px;
}

.info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(232, 221, 181, 0.2);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.info-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.info-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.info-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.info-subtitle {
  font-size: 13px;
  color: var(--color-neutral);
  margin-bottom: 24px;
}

.info-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 12px;
}

.info-link {
  display: block;
  margin-top: 24px;
  padding: 12px 20px;
  background: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  transition: background 0.15s ease;
}

.info-link:hover {
  background: #e8632f;
}

.info-credit {
  font-size: 12px;
  color: var(--color-taupe);
  margin-top: 16px;
}

.info-credit a {
  color: var(--color-taupe);
  text-decoration: underline;
}

.info-credit a:hover {
  color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
  .marker-icon,
  .panel,
  .audio-play-btn,
  .panel-close,
  .fly-btn,
  .info-btn,
  .info-close,
  .info-link {
    transition: none !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    border-left: none;
    border-top: 1px solid rgba(232, 221, 181, 0.1);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }

  .panel.open {
    transform: translateY(0);
  }

  .panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(236, 222, 180, 0.3);
    border-radius: 2px;
    margin: 8px auto;
  }

  .leaflet-control-zoom {
    display: none !important;
  }
}
