/* disco infiltrator - dark mode diy punk aesthetic */

/* ocr-a alternative: share tech mono (free, similar vibe) */
@font-face {
  font-family: 'OCR-A';
  src: local('OCR A Extended'), local('OCR-A');
}

:root {
  --bg: #0a0a0a;
  --fg: #e8e4e0;
  --border: #e8e4e0;
  --accent: #e8e4e0;
  --dim: #666;
  --font: 'Share Tech Mono', 'OCR-A', 'Courier New', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* grain texture overlay */
#grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* main container */
.container {
  position: relative;
  width: 100%;
  height: 100vh;
}

/* header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: transparent;
  z-index: 50;
}

.logo {
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  transform: translateY(4px);
}

.nav {
  display: flex;
  gap: 24px;
  transform: translateY(4px);
}

.nav-link {
  cursor: pointer;
}

.nav-link:hover {
  opacity: 0.7;
}

/* filters */
.filters {
  position: fixed;
  top: 80px;
  left: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  z-index: 50;
}

.filter-options {
  display: flex;
  border: 2px solid var(--border);
  background: var(--bg);
}

.filter-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  text-transform: lowercase;
  background: transparent;
  color: var(--fg);
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: all 0.15s ease;
}

.filter-btn:last-child {
  border-right: none;
}

.filter-row {
  display: flex;
  gap: 12px;
}

.filter-btn:hover {
  background: rgba(232, 228, 224, 0.1);
}

.filter-btn.active {
  background: var(--fg);
  color: var(--bg);
}

/* map wrapper */
.map-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

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

#mapOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 2;
}

#mapOverlay.fade-out {
  opacity: 0;
}

/* mapbox overrides */
.mapboxgl-ctrl-attrib {
  display: none !important;
}

.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-ctrl-top-right {
  top: 80px !important;
  right: 24px !important;
}

.mapboxgl-ctrl-top-right .mapboxgl-ctrl {
  margin: 0 !important;
}

.mapboxgl-ctrl-group {
  background: var(--bg) !important;
  border: 2px solid var(--border) !important;
  border-radius: 0 !important;
}

.mapboxgl-ctrl-group button {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  position: relative !important;
}

.mapboxgl-ctrl-group button:last-child {
  border-bottom: none !important;
}

.mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
  opacity: 0 !important;
}

/* custom angular zoom icons */
.mapboxgl-ctrl-group button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 2px;
  background: var(--fg);
  pointer-events: none;
}

.mapboxgl-ctrl-group button:first-child::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 10px;
  background: var(--fg);
  pointer-events: none;
}

/* custom marker */
.marker {
  width: 16px;
  height: 16px;
  background: var(--fg);
  border: 2px solid var(--bg);
  cursor: pointer;
  transition: transform 0.15s ease;
  transform-style: flat;
}

.marker:hover {
  background: var(--bg);
  border: 2px solid var(--fg);
  box-shadow: 0 0 0 2px var(--fg);
}

.marker.active {
  background: var(--bg);
  border: 2px solid var(--fg);
  box-shadow: 0 0 0 2px var(--fg);
  z-index: 100 !important;
}

/* venue label */
.marker-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 4px 8px;
  background: var(--bg);
  border: 2px solid var(--fg);
  font-family: var(--font);
  font-size: 0.7rem;
  text-transform: lowercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* show labels when zoomed in and within radius */
.show-venue-labels .marker-label.visible {
  opacity: 1;
}

/* always show label on selected marker */
.marker.active .marker-label {
  opacity: 1;
  z-index: 100;
}

/* show label on hover */
.marker:hover .marker-label {
  opacity: 1;
}

/* venue pulse animation */
.marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  box-shadow: 0 0 0 0.5px var(--fg);
  animation: pulse 2s ease-out infinite;
  pointer-events: none;
  will-change: transform, opacity;
  transform-style: flat;
  backface-visibility: hidden;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* event popup */
.event-popup {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 60px));
  background: var(--bg);
  border: 2px solid var(--border);
  padding: 20px 24px;
  min-width: 320px;
  max-width: 90vw;
  z-index: 100;
  transition: transform 0.3s ease;
}

.event-popup.visible {
  transform: translateX(-50%) translateY(0);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
  font-family: var(--font);
  line-height: 1;
}

.popup-close:hover {
  opacity: 0.6;
}

.popup-title {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 8px;
  padding-right: 24px;
}

.popup-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 12px;
}

.popup-details {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.popup-details span {
  padding: 4px 8px;
  border: 1px solid var(--border);
}

.popup-link {
  display: inline-block;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.85rem;
  padding-bottom: 2px;
  border-bottom: 1px dotted var(--fg);
}

.popup-link:hover {
  opacity: 0.7;
}

/* about panel */
.about-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  background: var(--bg);
  border: 2px solid var(--border);
  padding: 24px;
  max-width: 400px;
  z-index: 100;
  transform: translateX(calc(100% + 50px));
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.about-panel.visible {
  transform: translateX(0);
  opacity: 1;
}

.panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
  font-family: var(--font);
  line-height: 1;
}

.panel-close:hover {
  opacity: 0.6;
}

.panel-content p {
  margin-bottom: 16px;
  line-height: 1.5;
}

.panel-content p:last-child {
  margin-bottom: 0;
}

.panel-author {
  text-align: right;
}

/* event count */
.event-count {
  position: fixed;
  bottom: 24px;
  right: 24px;
  font-size: 0.85rem;
  opacity: 0.6;
  z-index: 50;
}

/* credit */
.credit {
  position: fixed;
  bottom: 24px;
  left: 24px;
  font-size: 0.85rem;
  opacity: 0.6;
  z-index: 50;
  color: var(--fg);
  text-decoration: none;
}

.credit:hover {
  opacity: 1;
}

/* responsive */
@media (max-width: 768px) {
  .header {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .filters {
    top: 110px;
    left: 16px;
    gap: 6px;
  }

  .filter-options {
    flex-wrap: wrap;
  }

  .filter-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .event-popup {
    bottom: 20px;
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(120%);
    min-width: auto;
  }

  .event-popup.visible {
    transform: translateX(0) translateY(0);
  }

  .event-count {
    bottom: 16px;
    right: 16px;
  }
}
