/* Traffic Cameras */
.traffic-cams-container {
  margin-top: 40px;
  width: 100%;
  max-width: 900px;
  text-align: center;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .traffic-cams-container {
    padding: 0;
  }
}

.traffic-cams-container h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.cams-grid {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.cam-item {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 640px) {
  .cam-item {
    flex: 1 1 auto;
    min-width: 250px;
    max-width: 280px;
  }
}

.cam-item h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #555;
}

.cam-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.cam-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.cam-link img {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cam-link:hover img {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  filter: brightness(1.05);
}

.cam-link:focus {
  outline: 2px solid #E28B4B;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Video Modal Overlay */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-modal[hidden] {
  display: none;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: -1;
}

.video-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.video-modal-title {
  margin: 0;
  font-size: 16px;
  color: #333;
  font-weight: bold;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.video-container {
  padding: 20px;
}

.video-player {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
}

.video-stream-info {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: #666;
  text-align: center;
}

.video-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.2s ease;
  padding: 0;
}

.video-modal-close:hover {
  background: #fff;
  border-color: #999;
}

.video-modal-close:focus-visible {
  outline: 2px solid #E28B4B;
  outline-offset: 2px;
}

.video-modal-close span {
  width: 16px;
  height: 2px;
  background: #333;
  position: absolute;
  top: 50%;
  left: 50%;
}

.video-modal-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.video-modal-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 640px) {
  .video-modal-content {
    max-height: 100vh;
    border-radius: 8px;
  }
  .video-container {
    padding: 15px;
  }
}

/* Tippy.js Tooltip Styling */
.tippy-box[data-theme~='camera'] {
  background-color: #fff;
  color: #333;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.tippy-box[data-theme~='camera'] .tippy-content {
  padding: 0;
}

.tippy-box[data-theme~='camera'] .tippy-arrow {
  color: #fff;
}

.tooltip-video-container {
  width: 400px;
  max-width: 90vw;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.tooltip-video-player {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
}

@media (max-width: 640px) {
  .tooltip-video-container {
    width: 300px;
  }
}
