/* -----------------------------------------------------------
   GALERIE.CSS
   Spezifische Styles für die Galerie-Ansicht, Kacheln & Lightbox
   ----------------------------------------------------------- */

/* ========================================= */
/* GRID SYSTEM & KACHELN                     */
/* ========================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 10px 0;
  perspective: 1000px;
}

.gallery-tile {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 6, 26, 0.6);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Tech-Corner Accents */
.gallery-tile::before,
.gallery-tile::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
  z-index: 3;
  opacity: 0.5;
}

.gallery-tile::before {
  top: 0; left: 0;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-radius: 4px 0 0 0;
}
.gallery-tile::after {
  bottom: 0; right: 0;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  border-radius: 0 0 4px 0;
}

.gallery-tile:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(110, 231, 255, 0.15),
    inset 0 0 20px rgba(110, 231, 255, 0.05);
  z-index: 2;
}

.gallery-tile:hover::before,
.gallery-tile:hover::after {
  width: 98%;
  height: 96%;
  opacity: 1;
  border-color: var(--accent);
}

.img-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), filter 0.4s ease;
  filter: contrast(1.1) brightness(0.8) saturate(0.9);
}

.gallery-tile:hover img {
  transform: scale(1.1);
  filter: contrast(1.2) brightness(1.0) saturate(1.1);
}

/* Overlay Info auf der Kachel */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(3, 7, 18, 0.95) 0%, rgba(3, 7, 18, 0.6) 60%, transparent 100%);
  padding: 30px 20px 15px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease 0.1s;
}

.gallery-tile:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(110, 231, 255, 0.6);
}

.gallery-desc {
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.8;
  font-family: monospace;
  text-transform: uppercase;
}

.gallery-icon {
  font-size: 1.5rem;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
  transform: translateX(10px);
  transition: transform 0.3s ease;
}

.gallery-tile:hover .gallery-icon {
  transform: translateX(0);
}

/* ========================================= */
/* LIGHTBOX (MODAL) STYLES                   */
/* ========================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  width: 95%;
  max-width: 1400px;
  height: 95vh;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  align-items: center;
  justify-content: center;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lightbox-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  padding-bottom: 10px;
  position: absolute;
  top: 10px;
  z-index: 100;
}

#lightbox-caption-text {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(110, 231, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

#lightbox-caption-text::before {
  content: '►';
  font-size: 0.8em;
  opacity: 0.7;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  font-family: sans-serif;
  font-size: 1.2rem;
}

.lightbox-close-btn:hover {
  background: rgba(110, 231, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px rgba(110, 231, 255, 0.3);
  transform: rotate(90deg);
}

/* --- ANIMATED BORDER & CONTAINER --- */

.lightbox-content.glowing-border {
  position: relative;
  overflow: hidden; /* Beschneidet das Bild beim Zoomen */
  width: 100%;
  max-width: 1200px;
  height: 80vh;
  border: none;
  background: #020617;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 24px;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  padding: 10px;
}

.lightbox-content.glowing-border::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent, 
    var(--accent), 
    transparent 20%, 
    var(--accent), 
    transparent 50%, 
    var(--accent), 
    transparent
  );
  animation: borderSpin 4s linear infinite;
  z-index: -2;
}

.lightbox-content.glowing-border::after {
  content: '';
  position: absolute;
  inset: 4px; 
  background: #020617; 
  border-radius: 20px; 
  z-index: -1;
}

/* Das Bild - wird jetzt gezoomt */
#lightbox-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain; 
  border-radius: 12px;
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

#lightbox-img.grabbing {
  cursor: grabbing;
}

@keyframes borderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- NAVIGATION ARROWS --- */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 120px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 20;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.nav-arrow::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  transition: all 0.3s ease;
}

.nav-arrow.prev {
  left: 20px;
  justify-content: flex-start;
  padding-left: 15px;
}
.nav-arrow.prev::before {
  left: 0;
  border-radius: 2px 0 0 2px;
}

.nav-arrow.next {
  right: 20px;
  justify-content: flex-end;
  padding-right: 15px;
}
.nav-arrow.next::before {
  right: 0;
  border-radius: 0 2px 2px 0;
}

.nav-arrow:hover {
  opacity: 1;
  text-shadow: 0 0 20px var(--accent), 0 0 40px #fff;
  letter-spacing: 4px;
}

.nav-arrow:hover::before {
  width: 6px;
  background: #fff;
  box-shadow: 0 0 25px var(--accent);
}

.nav-arrow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(110, 231, 255, 0.1), transparent);
  transform: translateY(-100%);
  transition: none;
}

.nav-arrow:hover::after {
  animation: scanline 1.5s linear infinite;
}

/* --- ZOOM CONTROLS --- */
.zoom-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-content:hover .zoom-controls {
  opacity: 1;
  pointer-events: auto;
}

.zoom-btn {
  width: 50px;
  height: 50px;
  background: rgba(6, 6, 26, 0.85);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  user-select: none;
}

.zoom-btn:hover:not(:disabled) {
  background: rgba(110, 231, 255, 0.15);
  box-shadow: 0 0 20px rgba(110, 231, 255, 0.3);
  text-shadow: 0 0 10px var(--accent);
  transform: translateY(-2px);
}

.zoom-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.zoom-btn:disabled {
  opacity: 0.3;
  cursor: default;
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.2);
  box-shadow: none;
  pointer-events: none;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* --- MEDIA QUERIES --- */

@media (max-width: 768px) {
  .nav-arrow {
    width: 50px;
    height: 80px;
    font-size: 1.4rem;
  }
  .lightbox-content.glowing-border {
    height: 60vh;
  }
  .zoom-controls {
    display: none;
  }
}

/* FIX: MOBILE LANDSCAPE MODE (QUERFORMAT) */
/* Dieser Teil wurde aus styles.css extrahiert */
@media (orientation: landscape) and (max-height: 500px) {

  /* Haupt-Container: Volle Größe */
  #lightbox .lightbox-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    background: rgba(2, 6, 23, 0.9) !important;
  }

  /* Header: Fixierte Höhe */
  #lightbox .lightbox-header {
    flex: 0 0 45px !important;
    width: 100% !important;
    background: rgba(2, 6, 23, 0.58) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 100 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
  }

  /* Der Leuchtrahmen */
  #lightbox .lightbox-content.glowing-border {
    flex: 1 1 auto !important; 
    width: 96% !important;
    margin: 8px auto 10px auto !important;
    padding: 3px !important;
    border-radius: 12px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: 0 0 30px rgba(0,0,0,0.5) !important;
  }

  /* Glow-Effekt */
  #lightbox .lightbox-content.glowing-border::before {
    inset: 0 !important;
    border-radius: 12px !important;
    padding: 2px !important;
    z-index: -2 !important;
  }
  
  /* Innere Maske */
  #lightbox .lightbox-content.glowing-border::after {
     inset: 3px !important;
     border-radius: 10px !important;
     background: #020617 !important;
     z-index: -1 !important;
  }

  /* Bild Anpassung */
  #lightbox-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    position: relative !important;
    z-index: 2 !important;
  }

  /* Controls */
  .zoom-controls {
    bottom: 5px !important;
    right: 15px !important;
    left: auto !important;
    transform: scale(0.8) !important;
    transform-origin: bottom right !important;
  }
  
  .nav-arrow {
    width: 40px !important;
    background: rgba(0,0,0,0.4) !important;
    border-radius: 8px !important;
  }
}