/* Timeline Controls CSS - Bottom play bar with histogram and slider */

/* Timeline controls container - positioned like search container */
.timeline-controls-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10003;
  width: 600px; /* Match search box width */
  max-width: 90vw; /* Match search box max-width */
}

/* Timeline controls overlay at bottom center - aligned with search box */
#timelineControls { 
  position: relative; 
  background: linear-gradient(135deg, #0b1220 0%, #1e293b 100%);
  border: 1px solid #374151; 
  border-radius: 12px; 
  padding: 6px 12px; 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  width: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .timeline-controls-container {
    bottom: 12px;
    width: 90vw; /* Match search box responsive width */
  }
  
  #timelineControls { 
    padding: 6px 10px; 
    gap: 6px; 
    /* Add subtle background for better visibility */
    background: linear-gradient(135deg, #0b1220 0%, #1e293b 100%);
    border-radius: 12px;
    backdrop-filter: blur(10px);
  }
}

#timelineControls .timeline-status { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
}

#timelineControls .status-indicator { 
  background: #374151; 
  color: #9ca3af; 
  padding: 2px 8px; 
  border-radius: 12px; 
  font-size: 10px; 
  font-weight: 500; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

#timelineControls .status-indicator.enabled { 
  background: #059669; 
  color: #ffffff; 
}

#timelineControls .status-indicator.playing { 
  background: #dc2626; 
  color: #ffffff; 
}

#timelineControls .play-button { 
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  border: none; 
  border-radius: 50%; 
  width: 36px; 
  height: 36px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  color: white; 
  font-size: 14px;
  transition: all 0.3s ease;
  touch-action: manipulation; /* Prevent double-tap zoom on mobile */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  user-select: none; /* Prevent text selection on mobile */
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

#timelineControls .play-button:hover { 
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  box-shadow: 0 6px 16px rgba(96, 165, 250, 0.4);
  transform: translateY(-1px);
}

#timelineControls .play-button:active { 
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  transform: translateY(0);
}

#timelineControls .timeline-slider { 
  flex: 1; 
  height: 30px; 
  background: transparent; 
  border-radius: 3px; 
  outline: none; 
  -webkit-appearance: none;
  cursor: pointer;
  touch-action: manipulation; /* Prevent double-tap zoom on mobile */
}

#timelineControls .timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 2px;
  height: 30px;
  background: #60a5fa;
  border-radius: 0;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.8);
  z-index: 3;
}

#timelineControls .timeline-slider::-moz-range-thumb {
  width: 2px;
  height: 30px;
  background: #60a5fa;
  border-radius: 0;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.8);
  z-index: 3;
}

#timelineControls .date-display { 
  color: #ffffff; 
  font-size: 13px; 
  min-width: 80px; 
  text-align: center; 
  font-weight: 600;
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#timelineControls .speed-control { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  color: #9ca3af; 
  font-size: 11px;
}

#timelineControls .speed-slider { 
  width: 60px; 
  height: 4px; 
  background: #374151; 
  border-radius: 2px; 
  outline: none; 
  -webkit-appearance: none;
  cursor: pointer;
}

#timelineControls .speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #9ca3af;
  border-radius: 50%;
  cursor: pointer;
}

#timelineControls .speed-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #9ca3af;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Responsive design for timeline controls */
@media (max-width: 768px) {
  .timeline-controls-container {
    width: 90vw; /* Match search box responsive width */
  }
  
  #timelineControls {
    padding: 8px 10px;
    gap: 6px;
  }
  #timelineControls .play-button {
    width: 40px;
    height: 40px;
    font-size: 14px;
    min-width: 44px; /* Apple's recommended minimum touch target */
    min-height: 44px;
  }
  #timelineControls .date-display {
    min-width: 70px;
    font-size: 11px;
  }
  #timelineControls .speed-control {
    font-size: 10px;
  }
  #timelineControls .speed-slider {
    width: 50px;
  }
}

@media (max-width: 480px) {
  .timeline-controls-container {
    width: 90vw; /* Match search box responsive width */
    bottom: 10px;
  }
  
  #timelineControls {
    padding: 6px 8px;
    gap: 4px;
  }
  #timelineControls .play-button {
    width: 36px;
    height: 36px;
    font-size: 12px;
    min-width: 44px; /* Apple's recommended minimum touch target */
    min-height: 44px;
  }
  #timelineControls .date-display {
    min-width: 60px;
    font-size: 10px;
  }
  #timelineControls .speed-control span {
    display: none;
  }
  #timelineControls .speed-slider {
    width: 40px;
  }
}

/* Timeline slider with distribution background */
.timeline-slider-container {
  position: relative;
  flex: 1;
  margin: 0 8px;
  height: 30px;
  margin-bottom: 10px;
}

.timeline-distribution-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  border-radius: 3px;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  background: rgba(55, 65, 81, 0.2);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.timeline-distribution {
  width: 100%;
  height: 100%;
}

.timeline-slider {
  position: relative;
  z-index: 3;
  background: transparent;
  height: 30px;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 2px;
  height: 30px;
  background: #60a5fa;
  border-radius: 0;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.8);
  z-index: 3;
}

.timeline-slider::-moz-range-thumb {
  width: 2px;
  height: 30px;
  background: #60a5fa;
  border-radius: 0;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.8);
  z-index: 3;
}

.timeline-labels {
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9ca3af;
  pointer-events: none;
}

.timeline-year {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 500;
}
