

/* =========================================================
   🔷 VIDEO-GRID & ANSICHT
   ========================================================= */
#overview {
  padding: 1rem;
  box-sizing: border-box;
}
#overview h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* Standard Grid (normal) */
.video-grid {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); transition: all 0.4s ease;

}

/* Zoomed-Out Ansicht (kleiner & dichter) */
.video-grid.zoomed-out {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}
.video-grid.zoomed-out .video-thumb video {
  height: 160px;
  transition: height 0.3s ease;
}




/* =========================================================
   🔷 VIDEO-OVERLAY (Vollbild)
   ========================================================= */
#videoOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  z-index: 9999;
  overflow: hidden;
}


/* 🔹 Video Overlay: Dynamische Höhe je nach Bildschirmgröße */
#videoOverlay video {
  max-width:100%;
  max-height:100%;
  transition:transform 0.3s ease, opacity 0.6s ease;
  opacity: 0;
}




#videoOverlay video.visible {
  opacity: 1;
}

/* =========================================================
   🔷 OVERLAY STEUERUNG (Buttons, Info, Pfeile)
   ========================================================= */
#overlayControls {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 18px;
  border-radius: 12px;
}
#overlayControls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}
#overlayControls button:hover {
  transform: scale(1.2);
  color: #00aaff;
}

/* Pfeilnavigation */
.nav-arrow {
  position: absolute;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 36px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
}

/* Infobar unten */
#videoInfoBar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  color: #fff;
  font-family: monospace;
  font-size: 14px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 10px;
  z-index: 10;
}

/* =========================================================
   🔷 ZOOM-BUTTON FÜR GALLERY (oben rechts)
   ========================================================= */
#zoomGalleryBtn {
  position: fixed;
  top: 120px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 20px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: background 0.3s ease;
}
#zoomGalleryBtn:hover {
  background: rgba(0, 0, 0, 0.85);
}

/* Aktive Thumbnail-Markierung */
.video-thumb.active-thumb {
  outline: 3px solid #00aaff;
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.7);
  border-radius: 8px;
}

/* =========================================================
   🔷 VIDEO-THUMBNAILS (Vorschau)
   ========================================================= */
.video-thumb {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.video-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 170, 255, 0.4);
}
.video-thumb video {
  display: block;
  width: 100%;
  height: 250px;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: 6px;
  background-color: #000; /* verhindert weißen Streifen */
  transition: all 0.3s ease;
}
.video-thumb .video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.4);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.9;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.video-thumb:hover .video-overlay {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 1;
}

/* =========================================================
   🔷 RESPONSIVE ANPASSUNGEN
   ========================================================= */

/* Desktop: Pfeile horizontal */
@media (min-width: 769px) {
  #prevBtn { left: 30px; top: 50%; transform: translateY(-50%); }
  #nextBtn { right: 30px; top: 50%; transform: translateY(-50%); }



}

/* Mobile: vertikales Scroll-Layout (TikTok-Stil) */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
  .video-grid.zoomed-out {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  .video-thumb video {
    height: 200px;
  }

  #videoOverlay {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    padding-top: 2rem;
    height: 100vh;
  }

  /* 🎬 Querformat-Videos wie Hochformat anzeigen */
  #videoOverlay video {
    width: 100%;
    height: calc(65vh);
    max-height: 70vh;

    max-width: 100%;

    object-fit: cover;
    object-position: center center;
    background-color: #000;

    scroll-snap-align: start;  /* scroll-snap für einzelne Videos */
    border-radius: 6px;        /* optional: leicht abgerundet */


  }

  /* Mobile Pfeile */
  .nav-arrow {
    left: 10%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    font-size: 30px;
  }
  #prevBtn { top: 20%; left: 15%;  background: linear-gradient(135deg, #ff6ec4, #7873f5); }
  #nextBtn { bottom: 25%;left: 15%; background: linear-gradient(135deg, #ff6ec4, #7873f5);}




  #overlayControls {
    top: 10%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
  }

  #videoInfoBar {
    bottom: auto;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
  }

  #overlayThumbs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start; /* wichtig! */
    gap: 6px;
    padding: 0 6px; /* links und rechts minimal */
    overflow-x: auto;
    background: rgba(0,0,0,0.6);
    z-index: 2220;
    box-sizing: border-box;
  }


  .overlay-thumb {
    flex: 0 0 auto;  /* verhindert, dass es schrumpft */
    width: 60px;
    height: 60px;
    margin: 0;       /* keine extra Verschiebung */
  }

  .overlay-thumb:first-child {
    margin-left: 0; /* falls zuvor margin oder gap die erste position verschiebt */
  }


  #overlayThumbs::-webkit-scrollbar {
    height: 6px;
  }
  #overlayThumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
  }

  /* Thumbnail Bilder kleiner für Mobile */
  .overlay-thumb img {
    height: 60px;
    border-radius: 4px;
  }







}


/* =========================================================
   🔷 THUMBS
   ========================================================= */

#overlayThumbs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding: 6px;
  background: rgba(0,0,0,0.6);
  z-index: 2220;
  box-sizing: border-box;
  scroll-behavior: smooth; /* sanftes Scrollen */
}





.overlay-thumb {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
}

.overlay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.overlay-thumb:hover {
    transform: scale(1.1);
    border-color: #00aaff;
}

.overlay-thumb.active-thumb {
  border: 2px solid #00aaff;
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.6);
  transform: scale(1.15);
  border-radius: 6px;
}


/* =========================================================
   🔷 KORREKTUR: Desktop größere Thumbnails
   ========================================================= */
@media (min-width: 769px) {

   .overlay-thumb {
    flex: 0 0 auto;  /* verhindert, dass es schrumpft */
    width: 120px;
    height: 120px;
    margin: 0;       /* keine extra Verschiebung */
  }

  .overlay-thumb:first-child {
    margin-left: 0; /* falls zuvor margin oder gap die erste position verschiebt */
  }


  #overlayThumbs::-webkit-scrollbar {
    height: 6px;
  }
  #overlayThumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
  }



}

/* =========================================================
   🔷 Mobile Pfeile in die Navigationsleiste
   ========================================================= */


/* 🔹 Standardmäßig: mobile-inline Pfeile ausblenden (Desktop) */
#overlayControls .mobile-inline {
  display: none;
}


/* =========================================================
   🔹 Videodauer auf Thumbnails
   ========================================================= */
.video-thumb .video-duration {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  opacity: 0.9;
  pointer-events: none;
}




