/* ========================================
   Global Typography & Base
   ======================================== */
* {
  font-family: 'Poppins', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}
body {
  background-color: #f4f5f7 !important;
  font-size: 14px;
  line-height: 1.5;
}
.container-fluid {
  margin-left: auto;
  margin-right: auto;
}
.container {
  max-width: 1260px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Home / Intro Sections
   ======================================== */
.channels {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.intro {
  padding-top: 3rem;
  padding-bottom: 3rem;
  margin-bottom: 1.5rem;
  margin-left: auto;
  margin-right: auto;
}
.intro h1 {
  font-style: initial;
  text-align: center;
}
.intro p {
  font-style: initial;
  text-align: center;
  padding: 0px;
}
.border-bottom {
  border-bottom: 2px solid #000000 !important;
}
.profile {
  margin-bottom: 1.5rem;
}
.profile h1 {
  padding-bottom: 25px;
}

/* ========================================
   Image Hover Effects
   ======================================== */
.image {
  transition: .5s ease;
}
.image-middle {
  transition: .5s ease;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
}
.image-text {
  color: white;
  font-size: 20px;
}
.image-hover:hover img {
  opacity: 0.75;
  height: 300px;
}
.image-hover:hover .image-middle {
  opacity: 1;
}
.image-text:hover {
  font-size: 20px;
  color: black;
}

/* ========================================
   Footer
   ======================================== */
footer {
  display: block;
  background-color: white !important;
  color: black;
  min-height: 50px;
  padding: 20px 0;
}
footer a {
  color: black;
  font-size: 18px;
  font-weight: 100;
}
footer a:hover {
  color: #6b6b6b;
}

/* ========================================
   Home Info Links
   ======================================== */
.home_info li {
  display: block;
  padding: 10px 0px;
}
.home_info a {
  color: black;
}
.home_info a:hover {
  color: #6b6b6b;
  text-decoration: underline;
}

/* ========================================
   Navbar
   ======================================== */
.custom-toggler .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0,0,0, 0.7)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.navbar-expand-lg {
  background-color: white !important;
}
.navbar-expand-lg .container {
  color: black;
  max-width: 1260px;
  margin-left: auto;
  margin-right: auto;
}
.navbar-expand-lg li {
  padding: 0px 0.3rem;
}
.navbar-expand-lg a {
  color: black;
  font-size: 1rem;
  font-weight: 100;
  padding: 0.5rem 0.5rem;
}
.navbar-expand-lg a:hover {
  color: #6b6b6b;
  text-decoration: underline;
}

/* ========================================
   Tables
   ======================================== */
.table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  background-color: #f8f9fa;
  font-weight: 600;
  padding: 0.5rem 0.75rem !important;
}
.table td {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.85rem;
}
.table td:first-child {
  font-weight: 500;
  color: #495057;
}
.table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* ========================================
   Font Awesome Icons
   ======================================== */
.fa {
  font-size: 100px;
  text-align: center;
  text-decoration: none;
  color: rgb(0, 0, 0);
}
.fa:hover {
  opacity: 0.7;
  color: rgb(100, 100, 100);
}

/* ========================================
   Cards
   ======================================== */
.card {
  margin-bottom: 20px;
  border: none;
}
.card-body {
  text-align: left;
  line-height: 1.5em;
  margin: auto;
}
.card img {
  display: block;
  border: none;
  width: 100%;
  height: auto;
}
.card iframe {
  display: block;
  border: none;
  width: 100%;
  height: 500px;
}

/* ========================================
   Platform Layout (two-column)
   ======================================== */
.platform-layout {
  padding: 0;
}
.platform-layout > .row {
  min-height: calc(100vh - 56px);
}

/* ========================================
   Left Panel (tabs)
   ======================================== */
.panel-left {
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  background: #ffffff;
}

/* ========================================
   Map Column Wrapper (right)
   ======================================== */
.map-column {
  position: relative;
  overflow: hidden;
}

/* ========================================
   Map Container
   ======================================== */
#map {
  width: 100%;
  height: calc(100vh - 56px);
}

/* ========================================
   Legend
   ======================================== */
.legend {
  background-color: rgba(255, 255, 255, 0.92);
  color: #333;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  padding: 10px 12px;
  position: absolute;
  bottom: 30px;
  right: 10px;
  z-index: 1;
  font-size: 0.8rem;
}
.legend h5 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.legend div {
  margin-bottom: 2px;
}
.legend div span {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.legend-residential { background: hsla(65, 82%, 85%, 0.8); }
.legend-commercial { background: hsla(360, 70%, 85%, 0.8); }
.legend-fixed { background: hsla(29, 85%, 65%, 0.3); }
.legend-openspace { background: hsla(118, 100%, 80%, 0.8); }
.legend-vacant { background: hsla(180, 100%, 54%, 0.8); }
.legend-others { background: hsla(239, 82%, 81%, 0.8); }

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  height: calc(100vh - 56px);
  width: 0;
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: 0.2s;
  padding: 0;
}
.sidebar .list-group {
  padding: 48px 16px 16px 16px;
  min-width: 300px;
}
.sidebar a {
  padding: 4px 4px 4px 16px;
  text-decoration: none;
  font-size: 14px;
  color: #000000;
  display: block;
  transition: 0.2s;
}
.sidebar a:hover {
  color: #6b6b6b;
}
.sidebar .closebtn {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9ecef;
  border: none;
  font-size: 14px;
  color: #495057;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.sidebar .closebtn:hover {
  background: #dee2e6;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  margin-top: 16px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e9ecef;
}

/* ========================================
   Map Open Buttons
   ======================================== */
.openbtn {
  font-size: 13px;
  cursor: pointer;
  background-color: #ffffff;
  color: #495057;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}
.openbtn:hover {
  background-color: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Map Style Menu (unused but preserved)
   ======================================== */
#menu {
  background: #fff;
  position: absolute;
  z-index: 1;
  top: 50px;
  left: 170px;
  border-radius: 3px;
  width: 120px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  font-family: 'Open Sans', sans-serif;
}
#menu a {
  font-size: 13px;
  color: #404040;
  display: block;
  margin: 0;
  padding: 10px;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  text-align: center;
}
#menu a:last-child {
  border: none;
}
#menu a:hover {
  background-color: #f8f8f8;
  color: #404040;
}
#menu a.active {
  background-color: #3887be;
  color: #ffffff;
}
#menu a.active:hover {
  background: #3074a4;
}

/* ========================================
   Sliders
   ======================================== */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 3px;
  background: #d3d3d3;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4bd863;
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
}

/* ========================================
   Toggle Switches
   ======================================== */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.toggle-group label {
  font-size: 0.85rem;
  color: #495057;
  font-weight: 400;
  margin-bottom: 0;
}

.toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 20px;
  border-radius: 50px;
  background-color: #ddd;
  overflow: hidden;
  box-shadow: inset 0 0 2px 1px rgba(0, 0, 0, .05);
}
.check {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 6;
}
.check:checked ~ .track {
  box-shadow: inset 0 0 0 20px #4bd863;
}
.check:checked ~ .switch {
  right: 2px;
  left: 22px;
  transition: .35s cubic-bezier(0.785, 0.135, 0.150, 0.860);
  transition-property: left, right;
  transition-delay: .05s, 0s;
}
.switch {
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  right: 22px;
  background-color: #fff;
  border-radius: 36px;
  z-index: 1;
  transition: .35s cubic-bezier(0.785, 0.135, 0.150, 0.860);
  transition-property: left, right;
  transition-delay: 0s, .05s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.track {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  transition: .35s cubic-bezier(0.785, 0.135, 0.150, 0.860);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .05);
  border-radius: 40px;
}

/* ========================================
   Filter Box
   ======================================== */
.filter-box {
  margin: 10px 0px;
  border-radius: 5px;
}
.filter-content {
  padding: 10px 10px;
}

/* ========================================
   Tabs
   ======================================== */
.nav-tabs {
  border-bottom: 1px solid #dee2e6;
}
.nav-tabs .nav-link {
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-tabs .nav-link:hover {
  color: #212529;
  border-bottom-color: #dee2e6;
  background-color: transparent;
}
.nav-tabs .nav-link.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
  background-color: transparent;
  font-weight: 600;
}

/* ========================================
   Tab Content / Info Panel
   ======================================== */
#TimelineData, #DOBData {
  width: 100%;
  overflow: auto;
}
.tab-content {
  background: #ffffff;
  border-radius: 0 0 6px 6px;
  padding: 1rem;
}
.tab-pane .content {
  padding: 0;
}
.tab-pane h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.tab-pane h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e9ecef;
}
.tab-pane p {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

/* ========================================
   KPI Cards
   ======================================== */
.kpi-row {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}
.kpi-card {
  flex: 1;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
}
.kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.2;
}
.kpi-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ========================================
   Loading / Empty / Error States
   ======================================== */
.tab-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #adb5bd;
  font-size: 0.9rem;
}
.tab-placeholder .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.spinner-loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e9ecef;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.data-error {
  color: #dc3545;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ========================================
   Progress Bar (Development Envelope)
   ======================================== */
.progress-bar {
  height: 36px;
  font-size: 12px;
}

/* ========================================
   Responsive: Tablet and below (768px)
   Columns stack: map on top, tabs below
   ======================================== */
@media only screen and (max-width: 767px) {
  .platform-layout > .row {
    min-height: auto;
  }
  .panel-left {
    max-height: none;
    overflow-y: visible;
    order: 2;
  }
  .map-column {
    order: 1;
  }
  #map {
    height: 50vh;
  }
  .sidebar {
    height: 50vh;
  }
  .nav-tabs .nav-link {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }
  .openbtn {
    font-size: 11px;
    padding: 6px 10px;
  }
  .kpi-row {
    flex-wrap: wrap;
  }
  .kpi-card {
    flex: 1 1 calc(50% - 5px);
  }
}

/* ========================================
   Responsive: Mobile (425px)
   ======================================== */
@media only screen and (max-width: 425px) {
  #map {
    height: 40vh;
  }
  .sidebar {
    height: 40vh;
  }
  body {
    font-size: 0.8rem !important;
  }
  .nav-tabs .nav-link {
    font-size: 0.7rem;
    padding: 0.4rem 0.5rem;
  }
}
