/* UniLens — Map view */

.map-body {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header override for map layout ───────────── */

.map-body .site-header {
  flex-shrink: 0;
  position: static;
  z-index: 200;
}


/* ── Filter row ────────────────────────────────── */

.map-filters {
  background: var(--bg);
  padding: 10px 22px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  z-index: 500;
}

.map-filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  min-height: 44px;
  padding: 8px 14px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.map-filters select:focus {
  border-color: var(--accent);
}

.map-filters .count {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: auto;
}

/* ── Search combobox ───────────────────────────── */

.search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 8px 14px 8px 32px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow);
  display: none;
}

.search-dropdown.open { display: block; }

.search-result {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  min-height: 44px;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--surface-hover); color: var(--accent); }

.search-result .sr-name {
  color: var(--text);
  font-weight: 600;
}

.search-result .sr-city {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 1px;
}

/* ── Map + panel layout ────────────────────────── */

.map-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 520px;
  min-height: 0;
}

#map {
  background: #e8e8e8;
}

.leaflet-container {
  background: #e8e8e8;
  font-family: inherit;
}

.panel {
  background: var(--bg);
  border-left: 1px solid var(--glass-border);
  overflow-y: auto;
  padding: 18px 18px 30px;
}

.panel h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--text-muted);
  margin: 0 0 6px;
  font-weight: 600;
}

.panel-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Choice cards ──────────────────────────────── */

.slots {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.slot-card {
  background: var(--bg-elevated);
  border: 1px solid var(--surface);
  border-radius: 6px;
  padding: 10px 11px;
  min-height: 78px;
  position: relative;
}

.slot-card.empty {
  border-style: dashed;
  border-color: var(--surface);
}

.slot-card .slot-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-muted);
}

.slot-card .slot-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  margin-top: 4px;
}

.slot-card .slot-city {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.slot-card .slot-clear {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.slot-card .slot-clear:hover { color: var(--text); }

.slot-card .slot-placeholder {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 10px;
}

/* ── Empty state ───────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--bg-elevated);
  border-radius: 6px;
  border: 1px dashed var(--surface);
}

.empty-state strong { color: var(--text); }

/* ── Single uni detail ─────────────────────────── */

.detail-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.detail-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.detail-city {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hero-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--surface);
  border-radius: 6px;
  padding: 12px 11px;
  text-align: center;
}

.hero-card .hc-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.hero-card .hc-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 5px;
  line-height: 1.1;
}

.hero-card .hc-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-section { margin-bottom: 18px; }

.detail-section h3 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin: 0 0 8px;
  font-weight: 600;
}

.detail-section.country-section h3 {
  color: var(--accent);
}

.kv-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 12.5px;
  color: var(--text);
}

.kv-row:last-child { border-bottom: none; }
.kv-row .kv-v { font-weight: 600; }

/* ── Compare grid ──────────────────────────────── */

.compare-grid {
  display: grid;
  grid-template-columns: 130px 1fr 1fr 1fr;
  gap: 0;
  margin-top: 8px;
}

.cg-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--glass-border);
  align-self: center;
}

.cg-cell {
  font-size: 12.5px;
  color: var(--text);
  padding: 9px 8px;
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
  font-weight: 600;
}

.cg-cell.empty {
  color: var(--text-muted);
  font-weight: 400;
}

.cg-cell .airport-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
  display: block;
}

.cg-header {
  background: var(--bg-elevated);
  font-size: 11px;
  color: var(--text-secondary);
  padding: 8px;
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
  font-weight: 600;
}

.cg-header .cg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

/* ── RAG badges ────────────────────────────────── */

.rag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.rag-green { background: rgba(52, 211, 153, 0.18); color: var(--green); }
.rag-amber { background: rgba(251, 191, 36, 0.18); color: var(--amber); }
.rag-red { background: rgba(248, 113, 113, 0.18); color: var(--red); }
.rag-na { background: rgba(100, 116, 139, 0.18); color: var(--text-secondary); }

.direct-tag {
  display: inline-block;
  background: rgba(52, 211, 153, 0.18);
  color: var(--green);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nodirect-tag {
  display: inline-block;
  background: rgba(251, 191, 36, 0.18);
  color: var(--amber);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── Map dots ──────────────────────────────────── */

.leaflet-marker-icon {
  overflow: visible !important;
  background: transparent !important;
  border: none !important;
}

.uni-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0891b2;
  border: 1.5px solid #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  position: relative;
  cursor: pointer;
  transition: width 0.2s, height 0.2s, background 0.2s, box-shadow 0.2s;
}

.uni-dot.idle-pulse::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0891b2;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.4;
  animation: pulse-idle 2.6s ease-out infinite;
  z-index: -1;
}

.uni-dot.chosen {
  width: 18px;
  height: 18px;
  background: var(--dot-col);
  border-color: #fff;
  box-shadow: 0 0 10px var(--dot-col), 0 0 22px var(--dot-col), 0 0 4px rgba(0, 0, 0, 0.5);
}

.uni-dot.chosen .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--dot-col);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pulse-ring 1.8s ease-out infinite;
  z-index: -1;
}

.uni-dot.chosen .ring.delay { animation-delay: 0.9s; }

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

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

/* ── Map tooltips + legend ─────────────────────── */

.leaflet-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  font-size: 12px !important;
  font-family: 'Inter', sans-serif !important;
  padding: 8px 12px !important;
}

.leaflet-tooltip-top::before { border-top-color: rgba(15, 23, 42, 0.92) !important; }

.map-legend {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  color: #f1f5f9;
  line-height: 1.7;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.map-legend strong { color: var(--accent); }

.map-legend .leg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1.5px solid #fff;
}

/* ── Brief button ──────────────────────────────── */

.brief-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  color: var(--bg);
  border: none;
  padding: 13px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 22px;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.brief-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.3);
}

.brief-btn:disabled {
  background: var(--surface);
  color: var(--text-muted);
  cursor: not-allowed;
}

.brief-icon { font-size: 14px; }

.brief-sub {
  font-weight: 500;
  font-size: 11px;
  opacity: 0.75;
  margin-left: 4px;
}

/* ── Link to profile ───────────────────────────── */

.view-profile-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.view-profile-link:hover { color: #22d3ee; }

/* ── Destinations in panel ────────────────────── */

.panel-destinations {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
}

.panel-destinations .destination-strip {
  margin-bottom: 0;
}

.panel-destinations .dest-pills {
  flex-wrap: wrap;
}

/* ── Mobile responsiveness ───────────────────── */

@media (max-width: 768px) {
  .map-body {
    height: auto;
    overflow: auto;
  }

  .map-filters {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 6px;
  }

  .search-box {
    max-width: none;
    flex-basis: 100%;
    order: -1;
  }

  .map-filters select {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    font-size: 12px;
    padding: 7px 10px;
  }

  .map-filters .count {
    flex-basis: 100%;
    text-align: center;
    margin-left: 0;
  }

  .map-layout {
    display: flex;
    flex-direction: column;
  }

  #map {
    height: 45vh;
    min-height: 280px;
    flex-shrink: 0;
  }

  .panel {
    border-left: none;
    border-top: 1px solid var(--glass-border);
    min-height: 0;
    overflow-y: visible;
    padding: 14px 14px 100px;
  }

  .slots {
    gap: 6px;
  }

  .slot-card {
    padding: 8px 9px;
    min-height: 60px;
  }

  .slot-card .slot-name { font-size: 11px; }
  .slot-card .slot-placeholder { font-size: 10px; }

  .hero-cards { gap: 6px; }
  .hero-card { padding: 10px 8px; }
  .hero-card .hc-value { font-size: 17px; }
  .hero-card .hc-label { font-size: 9px; }
  .hero-card .hc-sub { font-size: 9.5px; }

  .compare-grid {
    grid-template-columns: 100px 1fr 1fr 1fr;
  }

  .cg-label { font-size: 9.5px; padding: 7px 6px 7px 0; }
  .cg-cell { font-size: 11.5px; padding: 7px 6px; }
  .cg-header { font-size: 10px; }

  .detail-name { font-size: 16px; }

  .kv-row { font-size: 12px; padding: 6px 0; }

  .brief-btn { font-size: 12px; padding: 11px 12px; }
}

@media (max-width: 420px) {
  .slots { grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .slot-card .slot-name { font-size: 10px; }

  .hero-cards { grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .hero-card .hc-value { font-size: 15px; }

  .compare-grid {
    grid-template-columns: 80px 1fr 1fr 1fr;
  }
  .cg-label { font-size: 9px; }
  .cg-cell { font-size: 11px; padding: 6px 4px; }
}
