/**
 * Frontend-Styling für TB Image Overlay
 */

.tb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tb-overlay-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.tb-overlay-content {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tb-overlay-content img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 40px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
}

.tb-overlay-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.tb-overlay-close:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: #fff;
}

/* Fade-Animationen */
.tb-overlay.fade-in {
  animation: tbFadeIn 0.4s ease forwards;
}

.tb-overlay.fade-out {
  animation: tbFadeOut 0.4s ease forwards;
}

.tb-overlay-content img.fade-in {
  animation: tbImgFadeIn 0.4s ease forwards;
}

.tb-overlay-content img.fade-out {
  animation: tbImgFadeOut 0.4s ease forwards;
}

@keyframes tbFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tbFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes tbImgFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tbImgFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}
