/* E-Dhop Gallery — Tüm temalar ortak görsel galeri / lightbox kütüphanesi (window.EDhopGallery)
   Aesthetic Refinement: Minimalist Squircle Controls, Dark Glassmorphism, Micro-interactions */

.edhop-gallery-root {
  position: fixed;
  inset: 0;
  z-index: 1000030;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  box-sizing: border-box;
}

.edhop-gallery-root *,
.edhop-gallery-root *::before,
.edhop-gallery-root *::after {
  box-sizing: border-box;
}

.edhop-gallery-root.is-open {
  opacity: 1;
  visibility: visible;
}

.edhop-gallery-root.is-closing {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.18s ease !important;
}

.edhop-gallery-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

/* Header */
.edhop-gallery-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  pointer-events: none;
}

.edhop-gallery-counter {
  pointer-events: auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  background: rgba(22, 22, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.edhop-gallery-tools {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edhop-gallery-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(22, 22, 28, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #e2e8f0;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.edhop-gallery-tool-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.edhop-gallery-tool-btn:hover {
  background: rgba(36, 36, 46, 0.95);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  transform: translateY(-1px);
}

.edhop-gallery-tool-btn:active {
  transform: translateY(1px);
}

.edhop-gallery-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.edhop-gallery-zoom-btn .edhop-gallery-icon-zoom-out {
  display: none;
}

.edhop-gallery-root.is-zoomed .edhop-gallery-zoom-btn .edhop-gallery-icon-zoom-in {
  display: none;
}

.edhop-gallery-root.is-zoomed .edhop-gallery-zoom-btn .edhop-gallery-icon-zoom-out {
  display: block;
}

/* Stage */
.edhop-gallery-stage {
  position: relative;
  z-index: 5;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 20px;
}

.edhop-gallery-viewwrap {
  position: relative;
  max-width: 90vw;
  max-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.edhop-gallery-root.is-zoomed .edhop-gallery-stage {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 40px;
}

.edhop-gallery-root.is-zoomed .edhop-gallery-viewwrap {
  max-width: none;
  max-height: none;
  margin: auto;
}

.edhop-gallery-img {
  display: block;
  max-width: 88vw;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: zoom-in;
}

.edhop-gallery-img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.edhop-gallery-root.is-zoomed .edhop-gallery-img {
  max-width: none;
  max-height: none;
  border-radius: 4px;
  cursor: zoom-out;
  transform: none;
}

/* Loading Spinner */
.edhop-gallery-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.edhop-gallery-loading[hidden] {
  display: none !important;
}

.edhop-gallery-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: edhop-gallery-spin 0.75s linear infinite;
}

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

/* Refined Squircle Navigation Arrows */
.edhop-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(20, 20, 26, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.edhop-gallery-arrow svg {
  width: 22px;
  height: 22px;
  display: block;
}

.edhop-gallery-arrow:hover {
  background: rgba(34, 34, 44, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-50%) scale(1.06);
}

.edhop-gallery-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.edhop-gallery-arrow--prev {
  left: 24px;
}

.edhop-gallery-arrow--next {
  right: 24px;
}

.edhop-gallery-root.is-zoomed .edhop-gallery-arrow {
  opacity: 0.35;
}

.edhop-gallery-root.is-zoomed .edhop-gallery-arrow:hover {
  opacity: 1;
}

/* Footer & Thumbnails */
.edhop-gallery-footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 24px;
  pointer-events: none;
}

.edhop-gallery-caption {
  pointer-events: auto;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(20, 20, 26, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 6px 16px;
  border-radius: 999px;
  max-width: min(80vw, 560px);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.edhop-gallery-caption:empty {
  display: none;
}

.edhop-gallery-thumbs {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 92vw;
  overflow-x: auto;
  padding: 4px 8px;
  scrollbar-width: thin;
}

.edhop-gallery-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  padding: 0;
  outline: none;
  flex-shrink: 0;
  opacity: 0.55;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.edhop-gallery-thumb:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.edhop-gallery-thumb.is-active {
  opacity: 1;
  border-color: #3b82f6;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
  transform: scale(1.05);
}

.edhop-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .edhop-gallery-header {
    padding: 16px;
  }


  .edhop-gallery-arrow--prev {
    left: 12px;
  }

  .edhop-gallery-arrow--next {
    right: 12px;
  }

  .edhop-gallery-arrow {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .edhop-gallery-arrow svg {
    width: 18px;
    height: 18px;
  }
  .edhop-gallery-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .edhop-gallery-thumb {
    width: 42px;
    height: 42px;
  }
}