﻿:root {
  --map-bg: #101319;
  --map-surface: rgba(23, 28, 35, 0.94);
  --map-surface-soft: rgba(255, 255, 255, 0.04);
  --map-border: rgba(242, 231, 214, 0.12);
  --map-text: #f5e9d7;
  --map-muted: #b8ad9f;
  --map-shadow: 0 22px 52px rgba(0, 0, 0, 0.3);
}

body.map-page {
  min-height: 100vh;
  color: var(--map-text);
  background:
    radial-gradient(circle at 12% 10%, rgba(47, 158, 163, 0.16), transparent 24rem),
    radial-gradient(circle at 86% 12%, rgba(214, 109, 36, 0.16), transparent 30rem),
    linear-gradient(180deg, #030508 0%, #071014 54%, #05070a 100%);
}

.map-page-shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 104px 0 52px;
  display: grid;
  gap: 18px;
}

.map-page-hero,
.map-toolbar,
.map-panel,
.spots-panel,
.map-modal-card,
.map-stat-card,
.spot-card,
.map-empty-card {
  border: 1px solid var(--map-border);
  background: var(--map-surface);
  box-shadow: var(--map-shadow);
}

.map-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  gap: clamp(18px, 3vw, 34px);
  min-height: clamp(360px, 42svh, 520px);
  align-items: end;
  padding: clamp(24px, 4.4vw, 52px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(3, 5, 8, 0.9), rgba(3, 5, 8, 0.38)),
    url("../assets/images/boardsports-mix.jpg") center/cover;
}

.map-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 76% 24%, rgba(214, 109, 36, 0.24), transparent 24%),
    linear-gradient(180deg, transparent, rgba(3, 5, 8, 0.76));
}

.map-page-kicker,
.map-modal-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(214, 109, 36, 0.16);
  color: #ffe2be;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-page-hero h1 {
  margin: 12px 0 10px;
  font-family: var(--ui-font-display);
  max-width: 12ch;
  font-size: clamp(3rem, 6.5vw, 6.8rem);
  line-height: 0.84;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-page-hero p,
.map-section-head p,
.spot-card p,
.map-modal-copy {
  margin: 0;
  color: var(--map-muted);
  line-height: 1.7;
}

.map-page-stats {
  display: grid;
  gap: 14px;
}

.map-stat-card {
  padding: 18px;
  border-radius: 8px;
  background: rgba(3, 5, 8, 0.48);
  backdrop-filter: blur(14px);
}

.map-stat-card strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 6px;
}

.map-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-radius: 8px;
  backdrop-filter: blur(18px);
}

.map-toolbar-actions,
.map-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-field {
  display: grid;
  gap: 8px;
}

.map-field span {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e4d8c9;
}

.map-field input,
.map-field select,
.map-field textarea {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--map-surface-soft);
  color: var(--map-text);
  padding: 12px 14px;
  font: inherit;
}

.map-field textarea {
  min-height: 112px;
  resize: vertical;
}

.map-primary-button,
.map-secondary-button {
  min-height: 46px;
  padding: 0 15px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.map-primary-button {
  background: linear-gradient(135deg, #f5d7b5 0%, #d66d24 100%);
  color: #141414;
}

.map-secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--map-text);
}

.map-panel,
.map-daily-panel,
.spots-panel {
  padding: clamp(16px, 2.4vw, 22px);
  border-radius: 8px;
}

.map-daily-panel {
  border: 1px solid var(--map-border);
  background: var(--map-surface);
  box-shadow: var(--map-shadow);
}

.daily-achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.daily-achievement-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 180px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.daily-achievement-card.is-claimed {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(5, 150, 105, 0.12);
}

.daily-achievement-card h3 {
  margin: 10px 0 8px;
  font-size: 1.05rem;
}

.daily-achievement-card p,
.daily-achievement-card small {
  color: var(--map-muted);
  line-height: 1.5;
}

.daily-achievement-card p {
  margin: 0 0 8px;
}

.daily-achievement-card button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.daily-achievement-xp,
.spot-difficulty-tag {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(47, 158, 163, 0.14);
  color: #b8f1f2;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  align-items: end;
}

.map-section-head h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

#map {
  height: min(680px, 68svh);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.spot-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.spot-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 215, 181, 0.3);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), 0 0 36px rgba(47, 158, 163, 0.08);
}

.spot-preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.04);
}

.spot-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.spot-preview-overlay {
  position: absolute;
  inset: auto 10px 10px;
  display: flex;
  justify-content: flex-end;
}

.spot-preview-overlay span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(4, 7, 12, 0.78);
  color: #f5e9d7;
  font-size: 0.76rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.spot-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.spot-card-tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(214, 109, 36, 0.12);
  color: #ffd9a6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spot-difficulty-tag {
  margin-top: 8px;
}

.spot-difficulty-tag[data-difficulty="media"] {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
}

.spot-difficulty-tag[data-difficulty="dificil"] {
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.spot-card h3 {
  margin: 0;
  font-family: var(--ui-font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.85rem);
  line-height: 1;
  text-transform: uppercase;
}

.spot-card-meta {
  display: grid;
  gap: 6px;
  color: var(--map-muted);
  font-size: 0.92rem;
}

.spot-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spot-card-actions button,
.spot-card-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}

.spot-card-actions .map-focus-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--map-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.spot-card-actions .map-directions-button {
  background: rgba(47, 158, 163, 0.14);
  color: #b8f1f2;
  border: 1px solid rgba(47, 158, 163, 0.24);
}

.spot-card-actions .map-xp-button {
  background: rgba(47, 158, 163, 0.14);
  color: #b8f1f2;
  border: 1px solid rgba(47, 158, 163, 0.24);
}

.spot-card-actions .map-video-button,
.spot-card-actions .map-edit-button {
  background: linear-gradient(135deg, #f5d7b5 0%, #d66d24 100%);
  color: #141414;
}

.spot-card-actions .map-delete-button {
  background: linear-gradient(135deg, #fca5a5 0%, #dc2626 100%);
  color: #fff7f7;
}

.spot-video-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.spot-video-list > strong {
  font-size: 0.86rem;
  color: #f5e9d7;
}

.spot-video-list > small {
  color: var(--map-muted);
}

.spot-video-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.spot-video-item span,
.spot-video-item small {
  display: block;
}

.spot-video-item span {
  color: #f5e9d7;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.spot-video-item small {
  margin-top: 4px;
  color: var(--map-muted);
}

.spot-video-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.spot-video-actions a,
.spot-video-actions button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--map-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.spot-video-actions button {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(127, 29, 29, 0.26);
  color: #fecaca;
}

.map-empty-card {
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  grid-column: 1 / -1;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.map-modal[hidden] {
  display: none;
}

.map-modal-card {
  width: min(560px, 100%);
  padding: 24px;
  border-radius: 8px;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  overscroll-behavior: contain;
}

.map-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 18px;
}

.map-modal-head h2 {
  margin: 8px 0 0;
}

.map-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--map-text);
  font-size: 1.4rem;
  cursor: pointer;
}

.map-form {
  display: grid;
  gap: 14px;
}

.map-form-section {
  min-width: 0;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.map-form-section legend {
  padding: 0 8px;
  color: #ffe2be;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.video-analysis-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 158, 163, 0.24);
  border-radius: 8px;
  background: rgba(47, 158, 163, 0.08);
}

.xp-preview-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 215, 181, 0.22);
  border-radius: 8px;
  background: rgba(214, 109, 36, 0.1);
}

.spot-season-panel,
.spot-season-readout {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 158, 163, 0.22);
  border-radius: 8px;
  background: rgba(47, 158, 163, 0.08);
}

.spot-season-panel[hidden] {
  display: none;
}

.spot-season-panel strong,
.spot-season-readout strong {
  color: #f5e9d7;
}

.spot-season-panel p {
  margin: 4px 0 0;
  color: var(--map-muted);
  line-height: 1.5;
}

.spot-season-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.spot-season-months label {
  position: relative;
  min-height: 38px;
  cursor: pointer;
}

.spot-season-months input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.spot-season-months span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--map-text);
  font-size: 0.78rem;
  font-weight: 800;
}

.spot-season-months input:checked + span {
  border-color: rgba(245, 215, 181, 0.44);
  background: rgba(214, 109, 36, 0.28);
  color: #ffe2be;
}

.spot-season-readout span {
  color: var(--map-muted);
  line-height: 1.45;
}

.map-panel .leaflet-container {
  background: #071014;
}

.map-panel .leaflet-tile {
  filter: saturate(0.85) contrast(1.1) brightness(0.72);
}

.map-panel .leaflet-popup-content-wrapper,
.map-panel .leaflet-popup-tip {
  background: rgba(6, 10, 13, 0.92);
  border: 1px solid rgba(245, 215, 181, 0.18);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
}

.map-spot-marker div {
  box-shadow: 0 0 0 12px rgba(214, 109, 36, 0.18), 0 12px 26px rgba(0, 0, 0, 0.38);
}

.video-analysis-card strong {
  color: #f5e9d7;
}

.xp-preview-card strong {
  color: #f5e9d7;
}

.video-analysis-card p,
.video-analysis-card li,
.xp-preview-card p {
  margin: 0;
  color: var(--map-muted);
  line-height: 1.5;
}

.video-analysis-card ul {
  margin: 0;
  padding-left: 18px;
}

.video-analysis-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.video-analysis-meta span {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd9a6;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: capitalize;
}

.map-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.map-location-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.map-location-search .map-secondary-button {
  min-height: 48px;
  white-space: nowrap;
}

.map-location-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: #ffd9a6;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .map-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-toolbar-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .map-page-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .map-page-shell {
    width: min(100% - 18px, 560px);
    padding-top: 88px;
    padding-bottom: calc(128px + env(safe-area-inset-bottom));
    gap: 14px;
  }

  .map-page-hero {
    min-height: 360px;
    padding: 22px;
  }

  .map-page-hero h1 {
    max-width: 11ch;
    font-size: clamp(2.25rem, 11vw, 3.8rem);
    line-height: 0.9;
    letter-spacing: 0;
  }

  .map-form-grid {
    grid-template-columns: 1fr;
  }

  .map-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .map-toolbar-actions {
    width: 100%;
  }

  .map-toolbar-actions button,
  .map-field,
  .map-field input,
  .map-field select {
    width: 100%;
  }

  #map {
    height: min(520px, 64svh);
  }

  .spot-video-item {
    grid-template-columns: 1fr;
  }

  .spot-video-actions {
    justify-content: flex-start;
  }

  .map-location-search {
    grid-template-columns: 1fr;
  }

  .map-location-search .map-secondary-button {
    width: 100%;
  }

  .spot-season-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .map-page-shell {
    width: min(100% - 12px, 380px);
    padding-top: 76px;
    gap: 14px;
  }

  .map-page-hero,
  .map-toolbar,
  .map-panel,
  .map-daily-panel,
  .spots-panel {
    padding: 15px;
  }

  .map-page-hero h1 {
    font-size: 1.82rem;
  }

  .map-page-hero p,
  .map-section-head p {
    font-size: 0.94rem;
  }
}
