* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls label {
  font-weight: 500;
}

.controls select,
.controls input {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.controls button {
  padding: 10px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.controls button:hover {
  background: #2980b9;
}

#latest-btn {
  background: #27ae60;
}

#latest-btn:hover {
  background: #219a52;
}

.camera-view {
  text-align: center;
}

.image-container {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-image {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

.loading,
.no-image {
  color: #7f8c8d;
  font-size: 18px;
}

#image-info {
  margin-top: 15px;
  color: #7f8c8d;
  font-size: 14px;
}

/* Timeline slider */
.timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 15px 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timeline-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #3498db;
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.timeline-btn:hover {
  background: #2980b9;
}

.timeline-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#timeline-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #3498db;
  border-radius: 50%;
  cursor: grab;
  transition: transform 0.1s;
}

#timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#timeline-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
}

#timeline-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #3498db;
  border: none;
  border-radius: 50%;
  cursor: grab;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #7f8c8d;
  padding: 0 10px;
}

@media (max-width: 600px) {
  .controls {
    flex-direction: column;
  }
  
  .controls select,
  .controls input,
  .controls button {
    width: 100%;
  }
  
  .timeline-labels span:nth-child(2),
  .timeline-labels span:nth-child(4) {
    display: none;
  }
}

/* Thumbnails */
.thumbnails {
  margin-top: 30px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.thumbnails h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 16px;
}

.thumb-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thumb {
  cursor: pointer;
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.thumb.active {
  box-shadow: 0 0 0 3px #3498db;
}

.thumb img {
  width: 160px;
  height: 90px;
  object-fit: cover;
  display: block;
}

.thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 11px;
  padding: 3px 5px;
  text-align: center;
}
