/* themes/default/final-map.css */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #172033;
}

#layout {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 430px;
  max-width: 100%;
  overflow: auto;
  padding: 16px;
  border-right: 1px solid #dce3ed;
  background: #f7f8fb;
}

#map {
  flex: 1;
  min-height: 100vh;
}

.top-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

h1 {
  font-size: 22px;
  margin: 0 0 6px;
}

.intro {
  font-size: 13px;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 12px;
}

.account-link {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  color: #243244;
  font-size: 13px;
}

.search-label {
  display: block;
  font-weight: bold;
  font-size: 13px;
  margin: 12px 0 5px;
}

input[type="search"],
input[type="text"],
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

input[type="range"] {
  width: 100%;
}

.filter-card {
  background: #fff;
  border: 1px solid #dce3ed;
  border-radius: 14px;
  margin-top: 12px;
  overflow: hidden;
}

.filter-header {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 12px;
  text-align: left;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.filter-header:hover {
  background: #f2f6fb;
}

.filter-body {
  padding: 0 12px 12px;
}

.filter-group {
  margin-top: 12px;
}

.filter-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
}

.check-pill:hover {
  background: #eef4fb;
}

.selected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.active-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  background: #eaf1f9;
  border: 1px solid #c8d3e1;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
}

.active-pill button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.secondary-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #243244;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #f2f6fb;
}

#count {
  font-weight: bold;
  margin: 14px 0 8px;
}

.school {
  border-top: 1px solid #dce3ed;
  padding: 12px 0;
  font-size: 13px;
  cursor: pointer;
}

.school:hover {
  background: #eef5ff;
}

.school strong {
  font-size: 15px;
}

.school-meta {
  color: #64748b;
  margin-top: 3px;
}

.tag {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9eef5;
  color: #334155;
  margin: 5px 3px 0 0;
  font-size: 11px;
}

.tuition-line {
  margin-top: 5px;
  font-weight: bold;
  color: #23456b;
}

@media (max-width: 850px) {
  #layout { display: block; height: auto; }
  #sidebar { width: 100%; border-right: 0; border-bottom: 1px solid #dce3ed; max-height: 52vh; }
  #map { height: 48vh; min-height: 48vh; }
}

/* =========================================
   TOP ACCOUNT NAV
========================================= */

.map-user-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;

    margin-bottom: 16px;
    padding-bottom: 12px;

    border-bottom: 1px solid #e5e7eb;
}

.map-user-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 7px 9px;

    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 999px;

    color: #1e293b;
    text-decoration: none;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    white-space: nowrap;

    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.map-user-nav a:hover {
    background: #f1f5f9;
    border-color: #b8c6d8;
}

.map-user-nav a#logout-link {
    color: #9f1239;
    border-color: #ffd4d4;
    background: #fff7f7;
}

.map-user-nav a#logout-link:hover {
    background: #ffecec;
    border-color: #ffb7b7;
}

@media (max-width: 640px) {
    .map-user-nav {
        gap: 5px;
    }

    .map-user-nav a {
        padding: 7px 8px;
        font-size: 11px;
    }
}

.save-search-btn {
  width: 100%;
  margin-top: 10px;
}


.map-legend {
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  font-size: 12px;
  line-height: 1.3;
}

.map-legend strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0;
  white-space: nowrap;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.2);
}

@media (max-width: 800px) {
  #map {
    height: 55vh;
    min-height: 360px;
  }
}

#mobile-view-toggle {
  display: none;
}

@media (max-width: 800px) {
  #sidebar {
    position: sticky;
    top: 0;
    z-index: 5000;
    background: #fff;
  }

  .map-user-nav,
  .top-row,
  #mobile-view-toggle {
    background: #fff;
  }

  #mobile-view-toggle {
    display: flex;
    gap: 6px;
    padding: 8px 0 12px;
    border-bottom: 1px solid #dbe4ef;
    margin-bottom: 10px;
  }

  .mobile-view-btn {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 9px 10px;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-view-btn.active {
    background: #334155;
    color: #ffffff;
    border-color: #334155;
  }

  body.mobile-view-list #sidebar {
    height: 100vh;
    max-height: none;
    overflow: auto;
  }

  body.mobile-view-list #map {
    display: none;
  }

  body.mobile-view-map #sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.mobile-view-map #sidebar > *:not(.map-user-nav):not(.top-row):not(#mobile-view-toggle) {
    display: none;
  }

  body.mobile-view-map #map {
    height: calc(100vh - 150px);
    min-height: calc(100vh - 150px);
  }

  body.mobile-view-split #sidebar {
    height: 50vh;
    overflow: auto;
  }

  body.mobile-view-split #map {
    height: 50vh;
    min-height: 360px;
  }
}

.college-checklist-prompt {
  padding: 14px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #f8fafc;
  margin: 14px 0;
}

.college-checklist-prompt .college-muted {
  margin-top: 6px;
  font-size: 12px;
}

.division-info-btn {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
}

.division-info-btn:hover {
  background: #eef2f7;
}

.division-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.division-modal-backdrop.active {
  display: flex;
}

.division-modal {
  background: #fff;
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0,0,0,.25);
}

.division-modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.division-modal-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.division-modal-subtitle {
  color: #64748b;
  font-size: 14px;
  margin-top: 4px;
}

.division-modal-close {
  border: 0;
  background: #f1f5f9;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 22px;
}

.division-modal-body {
  padding: 20px;
}

.division-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.division-table th,
.division-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.division-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.division-stars {
  white-space: nowrap;
}

.division-more-btn {
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
}

.division-detail {
  display: none;
  background: #f8fafc;
  border-left: 4px solid #cbd5e1;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 10px;
  color: #334155;
  line-height: 1.45;
}

.division-detail.active {
  display: block;
}

.division-detail ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

@media (max-width: 700px) {
  .division-table,
  .division-table thead,
  .division-table tbody,
  .division-table tr,
  .division-table th,
  .division-table td {
    display: block;
  }

  .division-table thead {
    display: none;
  }

  .division-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 10px;
  }

  .division-table td {
    border: 0;
    padding: 6px 0;
  }

  .division-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #64748b;
    display: block;
    font-size: 12px;
  }
}


.program-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.program-pill {
  background: #f8fafc;
}

.program-action-block {
  margin-top: 10px;
}

.program-action-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.program-action-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  margin-top: 8px;
  background: #f8fafc;
}

.program-action-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.program-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.program-level,
.program-conference {
  font-size: 12px;
  color: #64748b;
}

.school-details-row {
  margin: 8px 0 10px;
}

.school-details-body {
  display: grid;
  gap: 14px;
}

.school-profile-summary {
  font-size: 15px;
  line-height: 1.5;
  color: #334155;
  margin: 0;
}

.school-detail-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.school-detail-section h3 {
  font-size: 14px;
  margin: 0 0 6px;
  color: #0f172a;
}

.school-detail-section p,
.school-detail-stat {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}

.map-legend .legend-header {
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.map-legend.collapsed .legend-content {
    display: none;
}

@media (max-width:768px) {

    .map-legend {
        max-height: 45vh;
        overflow-y: auto;
    }

    .map-legend.collapsed {
        max-height: none;
        overflow: visible;
    }
}

.division-best-for-cell {
  max-width: 260px;
  line-height: 1.35;
  color: #334155;
}

@media (max-width: 768px) {
  .division-best-for-cell {
    max-width: none;
  }
}
/* =========================================================
   MOBILE MAP HEIGHT HARD FIX
   Added after all previous rules so it wins the cascade.

   Problem fixed:
   - old mobile rules mixed 48vh / 55vh / 50vh / 360px min-height
   - min-height:360px can force the map below the screen on phones
   - sticky sidebar + normal document scrolling can push Leaflet controls offscreen
   ========================================================= */

@media (max-width: 850px) {

  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
  }

  body {
    position: fixed;
    inset: 0;
  }

  #layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    overflow: hidden !important;
  }

  #sidebar {
    position: relative !important;
    top: auto !important;
    z-index: 5000;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid #dce3ed;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #map {
    display: block;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* LIST VIEW: list fills the screen, map is hidden */
  body.mobile-view-list #layout {
    display: block !important;
    overflow: hidden !important;
  }

  body.mobile-view-list #sidebar {
    height: 100vh !important;
    height: 100svh !important;
    height: 100dvh !important;
    overflow-y: auto !important;
  }

  body.mobile-view-list #map {
    display: none !important;
  }

  /* SPLIT VIEW: exact 50/50 screen split; no 360px minimum */
  body.mobile-view-split #layout {
    display: flex !important;
    flex-direction: column !important;
  }

  body.mobile-view-split #sidebar {
    flex: 0 0 50% !important;
    height: 50% !important;
    max-height: 50% !important;
    overflow-y: auto !important;
  }

  body.mobile-view-split #map {
    display: block !important;
    flex: 1 1 50% !important;
    height: 50% !important;
    min-height: 0 !important;
  }

  /* MAP VIEW: only the small header/toggle remains above map */
  body.mobile-view-map #layout {
    display: flex !important;
    flex-direction: column !important;
  }

  body.mobile-view-map #sidebar {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 8px;
  }

  body.mobile-view-map #sidebar > *:not(.map-user-nav):not(.top-row):not(#mobile-view-toggle) {
    display: none !important;
  }

  body.mobile-view-map #map {
    display: block !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Keep Leaflet controls/legend safely inside the visible map area */
  .leaflet-container {
    width: 100% !important;
    height: 100% !important;
  }

  .leaflet-control-container .leaflet-bottom {
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  .leaflet-control-container .leaflet-right {
    right: 12px !important;
  }

  .map-legend {
    max-width: calc(100vw - 28px);
    max-height: 38vh;
    overflow-y: auto;
  }

  .map-legend.collapsed {
    max-height: none;
    overflow: visible;
  }
}


.welcome-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}

.welcome-modal-backdrop.active {
  display: flex;
}

.welcome-modal {
  position: relative;

  width: min(520px, 96vw);
  padding: 26px;

  background: #ffffff;
  border-radius: 22px;
  border: 1px solid #dbeafe;

  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);

  transform: translateY(14px) scale(0.92);
  opacity: 0;

  animation: welcomePop .28s cubic-bezier(.2, .8, .2, 1) forwards;
}

@keyframes welcomePop {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.welcome-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;

  width: 32px;
  height: 32px;

  border: 0;
  border-radius: 999px;

  background: #f1f5f9;
  color: #334155;

  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.welcome-modal-close:hover {
  background: #e2e8f0;
}

.welcome-modal-kicker {
  margin-bottom: 8px;

  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.welcome-modal h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
  color: #0f172a;
}

.welcome-modal p {
  margin: 0 0 16px;
  color: #475569;
  line-height: 1.45;
}

.welcome-steps {
  margin: 0 0 20px;
  padding-left: 20px;
}

.welcome-steps li {
  margin-bottom: 10px;
  color: #334155;
  line-height: 1.4;
}

.welcome-steps strong {
  color: #0f172a;
}

.welcome-start-btn {
  width: 100%;

  padding: 12px 16px;

  border: 0;
  border-radius: 14px;

  background: #1f6feb;
  color: #ffffff;

  font-size: 15px;
  font-weight: 700;

  cursor: pointer;
}

.welcome-start-btn:hover {
  background: #185bc4;
}