html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

#filter-panel {
  position: absolute;
  top: 55px;
  left: 10px;
  background: #fffff0;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 1;
  transition: transform 0.3s ease;
  transform-origin: left;
}

#filter-panel.collapsed {
  transform: translateX(-100%);
}

.filter-toggle {
  position: absolute;
  top: 55px;
  left: 10px;
  z-index: 2;
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#filter-panel.collapsed + .filter-button {
  left: 60px;
}

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

.equipment-header {
  margin-top: 15px;
  margin-bottom: 15px;
}

#equipmentFilter {
  width: 200px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

#equipmentTypeFilter {
  width: 180px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.equipment-header label {
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.equipment-type-header label {
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.date-range {
  margin-bottom: 15px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.date-picker {
  width: 200px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.event-filter {
  margin-bottom: 15px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.event-filter select,
.severity-filter select {
  width: 200px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.severity-filter {
  margin-bottom: 15px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.duration-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  margin-top: 5px;
  font-family: Arial, sans-serif;
}

.selected-range {
  font-weight: bold;
  color: #4CAF50;
}

.range-values {
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
  font-weight: bold;
}

#duration-slider-range {
  width: 200px;
  margin: 10px 0 20px 0;
  height: 6px;
}

.ui-slider .ui-slider-handle {
  width: 12px;
  height: 12px;
  margin-left: -6px;
  top: -4px;
}

.ui-slider-handle {
  outline: none;
  background: #4CAF50 !important;
  border-color: #45a049 !important;
}

.ui-slider-range {
  background: #4CAF50 !important;
}

.filter-button {
  background-color: #4CAF50;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.filter-button:hover {
  background-color: #45a049;
}

.area-filter {
  margin: 15px 0;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.area-select-btn {
  background-color: #4CAF50;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 5px;
}

.area-select-btn:hover {
  background-color: #45a049;
}

#current-filters {
  position: absolute;
  top: 60px;
  right: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px;
  border-radius: 4px;
  z-index: 1;
  color: red;
  font-family: Arial, sans-serif;
  max-width: 300px;
}

#info-tooltip {
  position: absolute;
  top: 120px;
  right: 10px;
  z-index: 1;
}

.info-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: #4CAF50;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-style: normal;
}

.tooltip-content {
  display: none;
  position: absolute;
  right: 30px;
  top: 0;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  width: 300px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.tooltip-content p {
  margin: 0 0 10px 0;
}

.tooltip-content p:last-child {
  margin-bottom: 0;
}

.tooltip-content {
  display: none;
}

.tooltip-content.show {
  display: block;
}

.alert-levels-img {
  width: 460px;
  margin-top: 10px;
  border: 1px solid #ddd;
}

.tooltip-content {
  width: 460px;
}

#map {
  height: 100%;
  width: 100%;
}

#vehicle-summary,
#duration-summary {
  position: absolute;
  left: 10px;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 1;
  max-height: 300px;
  overflow-y: auto;
  transition: all 0.3s ease;
  transform-origin: bottom left;
}

#duration-summary {
  bottom: 60px;
  left: 10px;
}

#duration-summary.collapsed {
  transform: scale(0);
}

#toggle-duration {
  position: fixed;
  bottom: 20px;
  left: 10px;
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1001;
}

#graph-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  width: 600px;
  height: 375px;
  z-index: 1000;
  pointer-events: auto;
  transition: transform 0.3s ease;
  transform-origin: bottom right;
}

#graph-container.collapsed {
  transform: scale(0);
}

#toggle-graph {
  position: fixed;
  bottom: 20px;
  left: 110px;
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 1001;
}

.graph-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.toggle-view-btn {
  padding: 5px 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.toggle-view-btn:hover {
  background: #45a049;
}

#hourlyIncidents {
  width: 100% !important;
  height: 100% !important;
}

#vehicle-summary.collapsed,
#duration-summary.collapsed {
  max-height: 60px;
  overflow: hidden;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.toggle-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.toggle-btn:hover {
  background: #45a049;
}


#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 20px;
  font-size: 18px;
  color: #333;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#vehicle-table,
#duration-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: Arial, sans-serif;
  background: white;
}

#vehicle-table th,
#vehicle-table td,
#duration-table th,
#duration-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#duration-table td:nth-child(5) {
  border-right: 3px solid #aaa;
}

#vehicle-table th,
#duration-table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

#vehicle-table tr:hover,
#duration-table tr:hover {
  background-color: #f9f9f9;
}
.heatmap-cell {
  transition: background-color 0.3s ease;
  color: #333;
  font-weight: 500;
}

#duration-table th:nth-child(2),
#duration-table th:nth-child(3),
#duration-table th:nth-child(4),
#duration-table th:nth-child(5) {
  background-color: #e6f3ff;  /* Light blue for incident columns */
}

#duration-table th:nth-child(6),
#duration-table th:nth-child(7),
#duration-table th:nth-child(8),
#duration-table th:nth-child(9) {
  background-color: #f5e6d3;  /* Light brown for duration columns */
}

#duration-table th:first-child {
  background-color: #f5f5f5;  /* Original color for Equipment column */
}

#duration-table th {
  position: relative;
  cursor: pointer;
}

#duration-table th.asc::after {
  content: ' ▲';
  font-size: 12px;
}

#duration-table th.desc::after {
  content: ' ▼';
  font-size: 12px;
}

#duration-table th:hover {
  background-color: #e0e0e0;
}

/* Tabs Styling */
.summary-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  padding: 0 10px;
}

.tab-links {
  display: flex;
}

.tab-link {
  background-color: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

.tab-link:hover {
  background: #e0e0e0;
}

.tab-link.active {
  background: #4CAF50;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Insights Styling */
#insights-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  padding: 5px;
}

.insights-header {
  border-bottom: 2px solid #4CAF50;
  margin-bottom: 15px;
  padding-bottom: 5px;
}

.insights-title {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  color: #2e7d32;
}

.insights-period {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.metric-card {
  background: #f8f9fa;
  border-left: 4px solid #4CAF50;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.metric-label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-top: 4px;
}

.insights-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #444;
}

.insight-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insight-item {
  background: white;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.insight-item:nth-child(even) {
  background: #fafafa;
}

.item-rank {
  font-weight: bold;
  color: #4CAF50;
  margin-right: 8px;
}

.item-name {
  flex-grow: 1;
}

.item-meta {
  font-family: monospace;
  background: #e8f5e9;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #2e7d32;
}

.item-time {
    font-size: 11px;
    color: #888;
    margin-right: 10px;
}

.loading-insights {
  padding: 40px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Export Button Styles */
.export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #28a745;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.export-btn:hover {
  background: #218838;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.export-btn:active {
  transform: translateY(0);
}

.export-icon {
  width: 16px;
  height: 16px;
}