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

html {
  height: 100%;
}

body {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Lora", Roboto, sans-serif;
  font-size: 16px;
}

h1 {
  flex-shrink: 0;
  padding: 16px 24px;
  font-size: 32px;
  font-weight: 700;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  z-index: 500;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

#download-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #144734;
  border: 2px solid #144734;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

#download-btn:hover {
  background: #144734;
  color: #fff;
}

#info-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: none;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

#info-btn:hover,
#info-btn[aria-expanded="true"] {
  color: #144734;
}

#info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#info-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 600;
}

#info-tooltip[hidden] {
  display: none;
}

#map {
  flex: 1;
  z-index: 0;
}

/* ── Map markers ── */
.map-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.map-marker--green  { background: #4caf50; }
.map-marker--yellow { background: #ffc107; }

/* ── Stat cards ── */
#stat-cards {
  position: absolute;
  top: 16px;
  right: 12px;
  z-index: 500;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.stat-card {
  background: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  text-align: center;
  min-width: 200px;
}

.stat-pct {
  font-size: 36px;
  font-weight: 700;
  color: #eab310;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
}

@media (max-width: 600px) {
  #stat-cards {
    top: auto;
    right: auto;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    justify-content: center;
    width: max-content;
    max-width: calc(100vw - 24px);
  }

  .stat-card {
    min-width: 0;
    flex: 1;
  }

  h1 {
    font-size: 20px;
    padding-right: 24px;
  }

  #download-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    justify-content: center;
    padding: 14px;
    border: none;
    border-top: 1px solid #e8e8e8;
    border-radius: 0;
    font-size: 15px;
    background: #f9f9f9;
    z-index: 1100;
  }

  #download-btn:hover {
    background: #144734;
  }
}

/* ── Legend ── */
#legend {
  position: absolute;
  top: 12px;
  left: 62px;
  z-index: 500;
  background: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-item + .legend-item {
  margin-top: 6px;
}

.legend-dot {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.legend-dot--green  { background: #144734; }
.legend-dot--yellow { background: #ffc107; }

/* ── Sidebar ── */
#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 360px;
  max-width: 90vw;
  background: #fff;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar.open {
  transform: translateX(0);
}

#sidebar-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#sidebar-close:hover {
  background: #f0f0f0;
  color: #111;
}

#sidebar-content {
  overflow-y: auto;
  padding: 20px 20px 32px;
  flex: 1;
}

/* ── University header ── */
.sidebar-university {
  font-size: 21px;
  font-weight: 700;
  color: #111;
  padding-right: 36px;       /* clear the close button */
  margin-bottom: 20px;
  line-height: 1.3;
}

/* ── Program cards ── */
.program-count {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 14px;
}

.program-card {
  border: 1px solid #e8e8e8;
  border-radius: 0px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.program-card:last-child {
  margin-bottom: 0;
}

.program-name {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
  line-height: 1.3;
}

.program-meta {
  font-size: 16px;
  color: #555;
  margin-bottom: 4px;
  line-height: 1.4;
}

.program-meta:last-child {
  margin-bottom: 0;
}

/* ── NAP status pill ── */
.nap-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nap-pill--green {
  background: #e6f4ea;
  color: #2e7d32;
}

.nap-pill--yellow {
  background: #fff8e1;
  color: #b45309;
}

.program-meta span {
  font-weight: 500;
  color: #333;
}

.program-structure {
  font-size: 14px;
  color: #3f3f3f;
  line-height: 1.5;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}
