/* Main Structure */
body,
html {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.container-fluid {
  height: 100vh;
}

/* Map Container */
#map {
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 1;
}

.mapboxgl-canvas {
  position: relative !important;
  z-index: 0 !important;
}

.mapboxgl-canvas-container {
  pointer-events: auto !important;
}

/* Results Container */
.results-container {
  height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 10px;
}

/* Restaurant Cards */
.card {
  border-left: 3px solid #0d6efd;
  transition: transform 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Grade Styling */
.grade-A {
  color: #0d6efd;
  font-weight: bold;
}

.grade-B {
  color: #198754;
  font-weight: bold;
}

.grade-C {
  color: #fd7e14;
  font-weight: bold;
}

/* Pagination */
.pagination {
  margin: 15px 0;
  justify-content: center;
}

.page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

.page-link {
  color: #0d6efd;
  border: 1px solid #dee2e6;
}

.page-item.disabled .page-link {
  color: #6c757d;
}

.pagination-info {
  font-size: 0.9rem;
  color: #6c757d;
  text-align: center;
  margin-top: 5px;
}

/* Map Popups */
.mapboxgl-popup {
  max-width: 300px;
  z-index: 100;
}

.mapboxgl-popup-content {
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.map-popup {
  max-width: 250px;
}

.map-popup h6 {
  color: #0d6efd;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.map-popup p {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.map-popup .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

/* Modal Styles */
.modal {
  z-index: 1060 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal-backdrop.fade.show {
  z-index: 1040 !important;
}

body > .modal-backdrop {
  display: none !important;
}

.modal-dialog {
  z-index: 1061 !important;
  max-width: 800px;
}

.modal-content {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.modal-header {
  border-bottom: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
}

.modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
}

.btn-close {
  position: absolute;
  right: 1.5rem;
  top: 1.25rem;
  background-size: 0.75rem;
}

/* Table Styles */
.table {
  width: 100%;
  margin-bottom: 1rem;
}

.table th {
  font-weight: 600;
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.table td,
.table th {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Body overflow handling */
body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .container-fluid {
    flex-direction: column;
  }

  #map {
    height: 50vh;
  }

  .results-container {
    height: auto;
    max-height: 40vh;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: 0;
  }

  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: #6c757d !important;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

/* Alert Styles */
.alert {
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

/* Data Analsyis */
.statistics {
  background-color: #2563eb;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.about_container {
  background-color: #2563eb;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.rounded-custom {
  border-radius: 10px;
}

.chart-row-single {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.chart-box {
  width: 100%;
  max-width: 1200px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.chart-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
}

.chart-container-two {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.responsive-plotly {
  flex: 1 1 48%;
}

.responsive-plotly > div {
  width: auto;
  height: auto;
}

/* Card Styles */
.card-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px;
}

.card-analysis {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  padding: 20px;
  width: 280px;
  text-align: center;
  transition: transform 0.2s;
}

.card-analysis:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  font-size: 1.5rem;
}

.icon.red {
  background-color: #fee2e2;
  color: #ef4444;
}

.icon.yellow {
  background-color: #fef9c3;
  color: #eab308;
}

.icon.blue {
  background-color: #dbeafe;
  color: #3b82f6;
}

.label {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 6px;
}

.value {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}

.underline {
  width: 60px;
  height: 4px;
  background-color: #2f80ed;
}

/* Map Select Dropdown */

.dropdown {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  margin: 36px;
  height: 64px;
}

/* Heatmap Popup */
#heatmap-main-popup {
  text-align: center;
}

#heatmap-zipcode {
  font-size: 2.2em;
  margin-top: 12px;
  font-weight: bold;
}

#heatmap-average {
  font-size: 2em;
  line-height: 1.3;
  margin-bottom: 0px;
}

/* Legend */
#map-legend {
  height: 86px;
  width: 220px;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 99999;
  margin-top: 10px;
  margin-right: 59px;
  padding: 0px;
  background: white;
  border-radius: 5px;
  padding: 5px 10px;
  box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);
}

#legend-gradient {
  height: 24px;
  width: 200px;
  background: #0000ff;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 255, 1) 0%,
    rgba(0, 255, 0, 1) 75%,
    rgba(255, 255, 0, 1) 100%
  );
}

.legend-key {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  align-items: center;
  margin: 3px 0px 3px 0px;
}

.legend-key h6 {
  margin: 0;
  padding: 0;
}
