/* IGD Lightbox – full viewport immersive layout like LightGallery */

.igd-lb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 15, 0.95);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  overflow: hidden;

  &.igd-open {
    opacity: 1;
  }
}

.igd-lb-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;

  &.hide-thumbs {
    .igd-lb-thumbbar {
      display: none;
    }

    .igd-lb-stage {
      bottom: 20px;
    }

  }

}

/* Header Bar */
.igd-lb-header {
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 15;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: auto;
}

.igd-lb-fileinfo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #fff;
  font-weight: 500;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  .item-name {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    font-size: 14px;

    img {
      width: 18px;
      height: 18px;
      object-fit: contain;
    }

    span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

}

.igd-lb-controls {
  display: flex;
  align-items: center;
  gap: 6px;

  .igd-lb-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;

    &:hover {
      background: rgba(255, 255, 255, 0.2);
    }
  }
}

/* Adjust stage to start below header */
.igd-lb-stage {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 77px; /* space for thumbnails */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  img,
  video,
  iframe {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    z-index: 2;
  }

  iframe {
    width: 100%;
    height: 100%;
    border: none;
  }

}

/* Controls */
.igd-lb-controls {
  display: flex;
  gap: 8px;
  z-index: 20;

  .igd-lb-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;

    &:hover {
      background: rgba(255, 255, 255, 0.2);
    }
  }

  .lg-download {
    margin-left: 6px;
  }
}

/* Caption */
.igd-lb-caption {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: #eee;
  font-size: 15px;
  text-align: center;
  line-height: 1.4;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation Arrows */
.igd-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 15;
  transition: background 0.2s ease;
  padding: 0 !important;

  &:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  &.left {
    left: 20px;
  }

  &.right {
    right: 20px;
  }
}

/* Thumbnail bar */
.igd-lb-thumbbar {
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  z-index: 12;
  justify-content: center;

  .igd-lb-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.25s, transform 0.25s;

    &:hover {
      opacity: 1;
      transform: scale(1.05);
    }

    &.active {
      outline: 2px solid #fff;
      opacity: 1;
    }
  }
}

/* Zoom behavior */
.igd-lb-zoom {
  cursor: zoom-in;

  &:active {
    cursor: grabbing;
  }
}

/* Loader Overlay */
.igd-lb-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.6);
  opacity: 1;
  transition: opacity 0.3s ease;

  &.hide {
    opacity: 0;
    pointer-events: none;
  }

  .igd-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: igd-spin 1s linear infinite;
  }
}

@keyframes igd-spin {
  to {
    transform: rotate(360deg);
  }
}


/* Responsive */
@media (max-width: 768px) {
  .igd-lb-thumbbar {
    .igd-lb-thumb {
      width: 60px;
      height: 40px;
    }
  }

  .igd-lb-controls {
    top: 10px;
    right: 10px;

    .igd-lb-btn {
      padding: 6px 8px;
      font-size: 13px;
    }
  }

  .igd-lb-caption {
    bottom: 52px;
    font-size: 13px;
  }
}
