body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  color: #333;
}

.controls {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.chart-container {
  position: relative;
  height: 500px;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #eee;
  background: #fff;
}

input[type="datetime-local"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  position: relative;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

button.loading {
  padding-right: 40px;
}

button.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: button-loading-spinner 0.8s linear infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

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

#resetZoomBtn {
  background-color: #f44336;
}

#resetZoomBtn:hover {
  background-color: #d32f2f;
}

.zoom-info {
  text-align: center;
  color: #666;
  font-size: 0.9em;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(0,0,0,0.03);
}

.checkbox-control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-control label {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #555;
}

#rapid-events-legend {
  background-color: rgba(255, 240, 240, 0.9);
  border: 1px solid #ffcccc;
  border-radius: 4px;
  padding: 8px;
  margin-top: 10px;
  display: none;
}

/* Real-time monitoring specific styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
}

.mode-btn {
  background-color: #4CAF50;
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background-color 0.3s;
}

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

.realtime-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background-color: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.8);
  border-radius: 20px;
  border: 1px solid #eaeaea;
}

.realtime-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
}

.realtime-dot.active {
  background-color: #4CAF50;
  box-shadow: 0 0 8px #4CAF50;
  animation: pulse-green 2s infinite;
}

.realtime-dot.inactive {
  background-color: #FF5722;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 87, 34, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 87, 34, 0);
  }
}

.status-text {
  font-weight: 500;
  color: #555;
}

.sensor-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.sensor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8f8f8;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #eee;
}

.sensor-status .label {
  font-weight: 600;
  color: #333;
}

.sensor-status .value {
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.status-high {
  background-color: #4CAF50;
  color: white;
  box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
}

.status-low {
  background-color: #F44336;
  color: white;
  box-shadow: 0 2px 5px rgba(244, 67, 54, 0.3);
}

.realtime-info {
  text-align: center;
  margin-top: 20px;
  padding: 16px;
  background-color: #E3F2FD;
  border-radius: 8px;
  border: 1px solid #BBDEFB;
}

.info-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.info-content p {
  margin: 0;
  color: #1565C0;
  font-size: 0.9em;
}

.display-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.control-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

.control-btn:active:not(:disabled) {
  transform: translateY(0);
}

#pauseBtn {
  background-color: #FF5722;
}

#pauseBtn:hover:not(:disabled) {
  background-color: #E64A19;
}

#resumeBtn {
  background-color: #4CAF50;
}

#resumeBtn:hover:not(:disabled) {
  background-color: #388E3C;
}

.back-to-live-btn {
  display: none;
  position: absolute;
  right: 20px;
  bottom: 20px;
  background-color: rgba(33, 150, 243, 0.9);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  z-index: 10;
}

.back-to-live-btn:hover {
  background-color: rgba(33, 150, 243, 1);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.back-to-live-btn:active {
  transform: translateY(0);
}

.material-symbols-rounded {
  font-size: 20px;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  gap: 10px;
}

/* Styles for photo tooltip */
#image-tooltip {
  transition: opacity 0.2s ease-in-out;
  opacity: 1;
  user-select: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 10000;
}

#image-tooltip img {
  max-height: 350px;
  object-fit: contain;
  border: 1px solid #eee;
  background: #f5f5f5;
  display: block;
}

.tooltip-info {
  margin-top: 5px;
  font-size: 12px;
  color: #333;
  text-align: center;
  word-break: break-all;
}

#photo-data-legend {
  background-color: rgba(240, 255, 240, 0.9);
  border: 1px solid #ccffcc;
  border-radius: 4px;
  padding: 8px;
  margin-top: 10px;
  display: none;
}

@media (max-width: 768px) {
  .realtime-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .display-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .sensor-info {
    flex-direction: column;
    align-items: center;
  }
}
