html,
body {
  height: 100%;
  overflow: hidden;
  background-color: #1780c2;
}
.full-height {
  height: 100vh;
}
.map-container {
  position: relative;
  height: 50%;
}
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.top-content {
  height: 50%;
  display: flex;
}
.video-container,
.transcript-container {
  height: 100%;
  padding-top: 5px;
  overflow: hidden;
}
.video-placeholder {
  background-color: black;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(100% - 120px);
  position: relative;
  min-height: 180px;
  object-fit: contain;
  margin-bottom: 5px;
  /* Performance optimizations for smooth playback */
  will-change: transform;
  backface-visibility: hidden;
  /* Enable hardware acceleration */
  transform: translateZ(0);
  /* Smooth video scaling and rendering */
  image-rendering: optimizeQuality;
}
.video-select-container,
.location-select-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  position: sticky;
  top: 0;
  background-color: #1780c2;
  z-index: 15;
  padding: 5px 0;
  min-height: 100px;
  height: auto;
}
.transcript-content {
  height: calc(100% - 120px);
  overflow-y: auto;
  background-color: rgba(240, 240, 240, 0.8);
  padding: 10px;
  scroll-behavior: smooth;
  contain: layout style;
  min-height: 180px;
}

.location-thumbnail {
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 4px !important;
  word-wrap: break-word;
  overflow: hidden;
}

.video-thumbnails,
.location-thumbnails {
  justify-content: center;
  align-items: center;
  width: 100%;
}

.location-thumbnails #locations {
  min-height: 91px; /* Space for 2 rows of buttons (~38px each + 8px gap) to prevent layout shift */
  align-content: flex-start; /* Align buttons to top of container */
}

.video-thumbnails .btn,
.location-thumbnails .btn {
  color: white;
}

.marker {
  cursor: pointer;
  transition: all 0.3s ease;
}

.marker:hover {
  transform: scale(1.2);
}

video {
  object-fit: contain;
  margin-bottom: 5px;
}

video::-webkit-media-controls {
  bottom: 0;
}

video::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.8);
}

.image-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 300px;
  height: 250px;
  z-index: 10; /* Above map but below UI controls */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease-in-out;
  pointer-events: none; /* Allow map interaction underneath */
  background: white;
  padding: 4px;
  overflow: hidden; /* Prevent content from overflowing */
}

.image-overlay.show {
  opacity: 1;
  transform: translateY(0);
}

.image-overlay img {
  width: calc(100% - 8px); /* Account for padding */
  height: calc(100% - 8px); /* Account for padding */
  max-width: 292px; /* 300px - 8px padding */
  max-height: 242px; /* 250px - 8px padding */
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.image-overlay .image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 8px;
  font-size: 12px;
  border-radius: 0 0 4px 4px;
  text-align: center;
}

@media (max-width: 768px) {
  .image-overlay {
    width: 200px;
    height: 150px;
    top: 10px;
    left: 10px;
  }

  .image-overlay img {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    max-width: 192px; /* 200px - 8px padding */
    max-height: 142px; /* 150px - 8px padding */
  }

  .image-overlay .image-caption {
    font-size: 10px;
    padding: 4px;
  }

  .video-mobile-select,
  .location-mobile-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 32px 12px;
    padding-right: 2rem !important;
    background-color: #f0f0f0;
    border-left: 15px solid;
  }

  .video-thumbnails,
  .location-thumbnails {
    display: flex;
    margin: 0 auto;
    width: 98%;
  }

  /* Compact top section */
  .top-content {
    height: auto;
    padding: 0 !important;
    flex-direction: column;
  }

  .top-content .row {
    margin: 0 !important;
    padding: 0 !important;
  }

  .video-container {
    height: auto;
    padding: 5px 0 !important;
  }

  .transcript-container {
    height: auto;
    padding: 0px;
    padding-bottom: 5px;
    padding-top: 0px;
  }

  .transcript-content {
    border-radius: 4px;
    border: 1px solid #dee2e6;
    height: 90px; /* Compact height - about 3-4 lines */
    min-height: unset;;
    overflow-y: auto;
  }

  .transcript-content::-webkit-scrollbar {
    display: none;
  }

  /* Map container adjustments */
  .map-container {
    height: 40vh;
  }

  /* Video container adjustments */
  .video-placeholder {
    height: auto !important;
    max-height: 30vh;
    /* Ensure minimum height for controls visibility */
    min-height: 150px;
    /* Optimize video rendering performance */
    will-change: transform;
    backface-visibility: hidden;
    /* Smooth video scaling */
    object-fit: contain;
  }

  /* Full height adjustments */
  .full-height {
    height: auto;
    overflow-y: auto;
  }

  .video-select-container,
  .location-select-container {
    min-height: unset;
  }
}
