/* Base layout */
.body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

/* Hero section */
.seatbelt-hero {
  height: 40vh;
  min-height: 300px;
  background: url('../images/seatbelt.jpg') center/cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.seatbelt-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8));
}

.seatbelt-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  padding: 0 20px;
  color: white;
}

.seatbelt-hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-top: 120px;
  margin-bottom: 20px;
  font-family: 'Poppins', sans-serif;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  color: white;
  text-align: center;
}

.hero-tagline {
  font-size: 1.5rem;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 0;
}

/* Main container */
.seatbelt-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  height: 100%; /* Viewport height minus hero and footer */
  min-height: 600px;
}

/* Dashboard panel layout */
.dashboard-panel {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Filters sidebar */
.filters-sidebar {
  width: 200px;
  background: #ffffff;
  box-shadow: 2px 0 10px rgba(0,0,0,0.05);
  padding: 20px;
  overflow-y: auto;
  height: 100%;
  border-right: 1px solid #eaeaea;
}

.filters-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0047AB;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0047AB;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group {
  margin-bottom: 15px;
}

.filter-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #555;
}

.modern-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg width='16' height='16' fill='none' stroke='%230047AB' stroke-width='2' viewBox='0 0 24 24'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}

.modern-select:hover {
  border-color: #0047AB;
}

.modern-select:focus {
  border-color: #0047AB;
  box-shadow: 0 0 0 3px rgba(0,71,171,0.2);
}

.reset-btn {
  width: 100%;
  background: #0047AB;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(0,71,171,0.2);
}

.reset-btn:hover {
  background: #003380;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,71,171,0.3);
}

/* Stats overview */
.stats-overview {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-card {
  background: linear-gradient(135deg, #0047AB, #002c67);
  color: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Charts main area */
.charts-main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  height: 100%;
  width: 1500px;
}

.chart-wrapper {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  padding: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-wrapper:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.chart-wrapper:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.chart-wrapper:nth-child(3) {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.chart-header {
  margin-bottom: 10px;
}

.chart-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 5px 0;
  color: #0047AB;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-description {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  background: #f1f7ff;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #b3d1ff;
  box-shadow: 0 2px 8px rgba(0,71,171,0.07);
  margin: 0;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.chart-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: rgba(0, 10, 30, 0.85);
  color: white;
  padding: 10px;
  border-radius: 5px;
  pointer-events: none;
  font-size: 12px;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 300px;
  transition: opacity 0.2s ease;
}

/* Footer */
.footer {
  background-color: #0047AB;
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 1rem;
  font-family: "Montserrat", sans-serif;
  position: relative;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -5px 10px rgba(0,0,0,0.2);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .charts-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .chart-wrapper:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  
  .chart-wrapper:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  
  .chart-wrapper:nth-child(3) {
    grid-column: 1 / span 2;
    grid-row: 2;
  }
}

@media (max-width: 991px) {
  .dashboard-panel {
    flex-direction: column;
    height: auto;
  }
  
  .filters-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #eaeaea;
  }
  
  .stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .charts-main {
    height: auto;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 300px);
  }
  
  .chart-wrapper:nth-child(1),
  .chart-wrapper:nth-child(2),
  .chart-wrapper:nth-child(3) {
    grid-column: 1;
  }
  
  .chart-wrapper:nth-child(1) {
    grid-row: 1;
  }
  
  .chart-wrapper:nth-child(2) {
    grid-row: 2;
  }
  
  .chart-wrapper:nth-child(3) {
    grid-row: 3;
  }
  
  .seatbelt-container {
    height: auto;
  }
}

@media (max-width: 768px) {
  .seatbelt-hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-tagline {
    font-size: 1.2rem;
  }
  
  .stats-overview {
    grid-template-columns: 1fr;
  }
}

/* Override any existing styles to make sure charts fit in one view */
.chart-container svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}


/* Styling for legend items */
.chart-legend .legend-item {
    display: flex;
    align-items: center;
    margin: 6px 0;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chart-legend .legend-item:hover {
    background-color: rgba(0,0,0,0.05);
}

.chart-legend .legend-item.selected {
    background-color: rgba(0,0,0,0.1);
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-legend .legend-item.inactive {
    opacity: 0.4;
}

.chart-legend .legend-color {
    width: 15px;
    height: 15px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 3px;
}

.chart-legend .legend-item.selected .legend-color {
    width: 18px;
    height: 18px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Enhanced tooltip */
#seatbelt-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    max-width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    transition: opacity 0.2s ease;
    opacity: 0;
}

/* Enhanced styling for chart lines */
.line {
    transition: opacity 0.3s ease, stroke-width 0.2s ease;
}

.line:hover {
    cursor: pointer;
}

/* Enhanced styling for dots */
.dot {
    transition: r 0.2s ease, opacity 0.3s ease, stroke-width 0.2s ease;
}
