
/* =========================================
   PTIS SCHOOL MAP DASHBOARD
========================================= */

.ptis-map-section {
  padding: 55px 5%;
  position: relative;
  color: #e2e8f0;
}

.ptis-map-section .section-title {
  margin-bottom: 30px;
}

.ptis-map-section .section-title h2 {
  font-size: clamp(25px, 4vw, 36px);
}

/* STATISTICS */

.map-statistics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.map-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(103,232,249,.16);
  border-radius: 16px;
  background: rgba(15,23,42,.78);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.map-stat-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(8,145,178,.16);
  font-size: 23px;
}

.map-stat-card span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.map-stat-card strong {
  display: block;
  margin-top: 5px;
  color: #67e8f9;
  font-size: 29px;
}

/* MAIN LAYOUT */

.school-map-dashboard {
  display: grid;
  grid-template-columns: 320px minmax(0,1fr);
  gap: 18px;
  align-items: stretch;
}

/* DIRECTORY */

.school-directory {
  padding: 18px;
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 16px;
  background: rgba(15,23,42,.88);
  backdrop-filter: blur(15px);
  min-width: 0;
}

.directory-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}

.directory-heading h3 {
  font-size: 17px;
}

.directory-heading p {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 5px;
}

.directory-icon {
  color: #67e8f9;
  font-size: 25px;
}

.school-directory input,
.school-directory select {
  display: block;
  width: 100%;
  padding: 12px 13px;
  margin-bottom: 11px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: #1e293b;
  color: #fff;
  outline: none;
  font-family: inherit;
  font-size: 13px;
}

.school-directory input:focus,
.school-directory select:focus {
  border-color: #06b6d4;
}

/* SCHOOL LIST */

.school-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.school-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px;
  margin-bottom: 8px;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 10px;
  background: rgba(30,41,59,.8);
  color: white;
  cursor: pointer;
  transition: .2s;
  font-family: inherit;
}

.school-item:hover,
.school-item.active {
  border-color: #06b6d4;
  background: rgba(8,145,178,.2);
  transform: translateX(2px);
}

.school-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.5;
}

.school-item small {
  display: block;
  color: #94a3b8;
  margin-top: 4px;
}

.gps-status {
  display: inline-block;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(245,158,11,.15);
  color: #fbbf24;
  font-size: 9px;
  letter-spacing: .5px;
}

.gps-status.verified {
  background: rgba(34,197,94,.15);
  color: #86efac;
}

.map-loading {
  padding: 25px 10px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

/* MAP */

.school-map-wrapper {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(103,232,249,.2);
  border-radius: 16px;
  background: #0f172a;
  box-shadow: 0 15px 40px rgba(0,0,0,.2);
}

.map-topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  background: rgba(15,23,42,.96);
  color: #67e8f9;
  font-size: 11px;
  letter-spacing: 1px;
}

.map-live-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.map-topbar button {
  padding: 8px 12px;
  border: 1px solid #0891b2;
  border-radius: 7px;
  background: #164e63;
  color: white;
  cursor: pointer;
  font-size: 11px;
}

#schoolMap {
  width: 100%;
  height: 570px;
  background: #e2e8f0;
  z-index: 1;
}

.map-legend {
  position: absolute;
  z-index: 500;
  bottom: 15px;
  left: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(255,255,255,.96);
  color: #1e293b;
  font-size: 10px;
  box-shadow: 0 3px 12px #0002;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 50%;
}

.legend-dot.ppd { background: #2563eb; }
.legend-dot.school { background: #16a34a; }
.legend-dot.pending { background: #f59e0b; }

/* DETAILS */

.school-details {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid rgba(103,232,249,.16);
  border-radius: 16px;
  background: rgba(15,23,42,.88);
  backdrop-filter: blur(15px);
}

.empty-details {
  padding: 15px;
  text-align: center;
  color: #94a3b8;
}

.empty-map-icon {
  margin-bottom: 10px;
  font-size: 32px;
}

.empty-details h3 {
  color: #e2e8f0;
  margin-bottom: 8px;
}

.empty-details p {
  font-size: 13px;
  line-height: 1.7;
}

.school-details h3 {
  font-size: 21px;
  margin-bottom: 5px;
}

.school-details .school-code {
  color: #67e8f9;
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 11px;
  margin: 20px 0;
}

.detail-box {
  padding: 15px;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 10px;
  background: rgba(30,41,59,.8);
}

.detail-box small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 8px;
}

.detail-box strong {
  color: #67e8f9;
  font-size: 17px;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.route-actions a,
.route-actions button {
  display: inline-block;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  background: #0891b2;
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.route-actions a:hover,
.route-actions button:hover {
  background: #0e7490;
}

.route-warning {
  margin-top: 15px;
  color: #fbbf24;
  font-size: 12px;
  line-height: 1.6;
}

/* LEAFLET */

#schoolMap .leaflet-popup-content-wrapper {
  border-radius: 10px;
}

#schoolMap .leaflet-popup-content {
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 1.6;
}

/* RESPONSIVE */

@media(max-width: 900px) {

  .school-map-dashboard {
    grid-template-columns: 1fr;
  }

  .school-list {
    max-height: 300px;
  }

  #schoolMap {
    height: 480px;
  }

  .detail-grid {
    grid-template-columns: repeat(3, 1fr);
  }

}

@media(max-width: 600px) {

  .ptis-map-section {
    padding: 35px 4%;
  }

  .map-statistics {
    gap: 8px;
  }

  .map-stat-card {
    padding: 12px 9px;
    gap: 7px;
    flex-direction: column;
    align-items: flex-start;
  }

  .map-stat-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .map-stat-card span {
    font-size: 10px;
  }

  .map-stat-card strong {
    font-size: 23px;
  }

  #schoolMap {
    height: 420px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-legend {
    left: 8px;
    bottom: 8px;
    gap: 7px;
    font-size: 9px;
  }

}



/* =====================================
   SCHOOL DIRECTORY
===================================== */

.school-directory {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* DIRECTORY HEADER */

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.directory-header h3 {
  color: #f8fafc;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.directory-header p {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 5px;
}

#schoolCount {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* SEARCH */

.school-search-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.school-search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #67e8f9;
  font-size: 23px;
  pointer-events: none;
}

#schoolSearch {
  width: 100%;
  height: 45px;
  padding: 0 15px 0 43px;
  border: 1px solid rgba(103,232,249,.15);
  border-radius: 12px;
  outline: none;
  background: rgba(15,23,42,.75);
  color: #f8fafc;
  font-family: inherit;
  font-size: 13px;
}

#schoolSearch:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8,145,178,.12);
}

#schoolSearch::placeholder {
  color: #64748b;
}

/* SCHOOL LIST */

.school-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 550px;
  overflow-y: auto;
  padding-right: 5px;
}

/* SCHOOL ITEM */

.school-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 76px;
  padding: 11px 13px;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 13px;
  background: rgba(30,41,59,.55);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: .25s ease;
}

.school-item:hover {
  background: rgba(8,145,178,.12);
  border-color: rgba(103,232,249,.4);
  transform: translateX(3px);
}

.school-item.active {
  background: rgba(8,145,178,.17);
  border-color: #0891b2;
  box-shadow: inset 3px 0 #22d3ee;
}

/* SCHOOL LOGO */

.school-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 11px;
  background: #ffffff;
  overflow: hidden;
}

.school-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* SCHOOL INFORMATION */

.school-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.school-item-info strong {
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.school-item-info small {
  color: #94a3b8;
  font-size: 10px;
  letter-spacing: .6px;
}

/* ARROW */

.school-item-arrow {
  color: #67e8f9;
  font-size: 23px;
  opacity: .65;
}

/* SCROLLBAR */

.school-list::-webkit-scrollbar {
  width: 5px;
}

.school-list::-webkit-scrollbar-track {
  background: rgba(15,23,42,.3);
}

.school-list::-webkit-scrollbar-thumb {
  background: #0891b2;
  border-radius: 10px;
}

/* MOBILE */

@media(max-width:768px) {

  .school-list {
    max-height: 400px;
  }

  .school-item {
    min-height: 70px;
  }

  .school-logo {
    width: 44px;
    height: 44px;
  }

}
