/* styles.css */

body { 
  margin: 0; 
  padding: 0; 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

#map { 
  position: absolute; 
  top: 0; 
  bottom: 0; 
  width: 100%; 
}

/* Controls Panel */
#controls {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  min-width: 260px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

h3 {
  margin: 0 0 15px 0;
  font-size: 17px;
  color: #333;
  border-bottom: 2px solid #ddd;
  padding-bottom: 8px;
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

select {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  font-size: 14px;
}

.sub-controls {
  margin-left: 24px;
  padding-left: 12px;
  border-left: 2px solid #ddd;
  margin-top: 8px;
}

.sub-controls .control-group {
  margin-bottom: 12px;
}

input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

input[type="range"] {
  width: 100%;
  cursor: pointer;
}

.slider-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.radio-group {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
}

input[type="radio"] {
  margin-right: 8px;
  cursor: pointer;
}

/* Reset Button */
#resetButton {
  width: 100%;
  padding: 10px;
  margin-bottom: 5px;
  margin-top: 20px;
  background: #E67E22;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: none;
  transition: background 0.2s;
}

#resetButton:hover {
  background: #D35400;
}

#resetButton:active {
  transform: scale(0.98);
}

/* Speed Legend */
.legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: none;
}

.legend h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #333;
}

.speed-legend-item {
  display: flex;
  align-items: center;
  margin: 5px 0;
  font-size: 12px;
}

.speed-color-box {
  width: 30px;
  height: 4px;
  margin-right: 8px;
  border-radius: 2px;
}

/* Stats Panel */
#stats {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255,255,255,0.95);
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  font-size: 13px;
}

#stats h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #333;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  min-width: 200px;
}

.stat-label { 
  color: #666; 
}

.stat-value { 
  font-weight: 700; 
  color: #E67E22; 
}

#selectedTripRow {
  display: none;
}

/* Fullscreen Button */
#fullscreenBtn {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 4px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.2s;
}

#fullscreenBtn:hover {
  background: rgba(255,255,255,1);
}

#fullscreenBtn:active {
  transform: scale(0.95);
}

/* When in fullscreen, adjust the button position */
#mapContainer:fullscreen #fullscreenBtn {
  top: 10px;
  right: 10px;
}

#mapContainer:-webkit-full-screen #fullscreenBtn {
  top: 10px;
  right: 10px;
}

#mapContainer:-moz-full-screen #fullscreenBtn {
  top: 10px;
  right: 10px;
}

#mapContainer:-ms-fullscreen #fullscreenBtn {
  top: 10px;
  right: 10px;
}

/* Fullscreen container */
#mapContainer {
  position: relative;
  width: 100%;
  height: 100vh;
}

#mapContainer:fullscreen {
  width: 100vw;
  height: 100vh;
}

#mapContainer:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

#mapContainer:-moz-full-screen {
  width: 100vw;
  height: 100vh;
}

#mapContainer:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
}

/* Road Quality Legend */
#roadQualityLegend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: none;
}