/* ==========================================================================
   Shalimar Properties - Premium Interactive Gallery Slider & Modal Popup
   ========================================================================== */

/* --- On-Page Gallery Enhancements --- */
.gallery {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--r-lg, 16px);
  background: #0f172a;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

.gallery:hover {
  box-shadow: 0 20px 40px -12px rgba(14, 75, 49, 0.35);
}

.gallery > img#gMain {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.gallery:hover > img#gMain {
  transform: scale(1.025);
}

/* Floating Expand Badge */
.gallery-expand-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-expand-badge i {
  font-size: 13px;
  color: #34d399;
  transition: transform 0.25s ease;
}

.gallery:hover .gallery-expand-badge,
.gallery-expand-badge:hover {
  background: rgba(14, 75, 49, 0.92);
  border-color: rgba(52, 211, 153, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(14, 75, 49, 0.5);
}

.gallery:hover .gallery-expand-badge i {
  transform: scale(1.15);
}

/* Hover Quick Hint Overlay */
.gallery-hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 28, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gallery:hover .gallery-hover-overlay {
  opacity: 1;
}

.gallery-hover-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.gallery:hover .gallery-hover-circle {
  transform: scale(1);
  background: rgba(14, 75, 49, 0.85);
}

/* Page Thumbnail Strip Enhancements */
.gthumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 75, 49, 0.4) transparent;
}

.gthumbs::-webkit-scrollbar {
  height: 6px;
}
.gthumbs::-webkit-scrollbar-thumb {
  background: rgba(14, 75, 49, 0.4);
  border-radius: 4px;
}

.gthumbs button {
  position: relative;
  flex: 0 0 92px;
  height: 66px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #1e293b;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.72;
}

.gthumbs button:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.gthumbs button.on {
  opacity: 1;
  border-color: #0E4B31;
  box-shadow: 0 0 0 2px rgba(14, 75, 49, 0.3), 0 6px 18px rgba(14, 75, 49, 0.35);
  transform: translateY(-2px);
}

.gthumbs button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ==========================================================================
   Modal Popup Window & Fullscreen Slider
   ========================================================================== */
.gl-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent; /* Transparent so live page remains visible behind blur */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  user-select: none;
}

.gl-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gl-modal.is-closing {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

/* Translucent Blurred Backdrop - Keeps original page visible behind smooth blur */
.gl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 28, 0.45);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gl-modal.is-open .gl-backdrop {
  opacity: 1;
}

.gl-modal.is-closing .gl-backdrop {
  opacity: 0;
  transition: opacity 0.26s ease;
}

/* Modal Popup Dialog Card with Animated Open/Close */
.gl-dialog {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 92vw;
  max-width: 1140px;
  height: 86vh;
  max-height: 840px;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at center 25%, #0f1c30 0%, #060b14 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 35px 90px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: scale(0.88) translateY(32px);
  opacity: 0;
  box-sizing: border-box;
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease,
              width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.25s ease;
}

.gl-modal.is-open .gl-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.gl-modal.is-closing .gl-dialog {
  transform: scale(0.9) translateY(24px);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
}

/* Fullscreen Mode (When user clicks Full Screen button) */
.gl-dialog.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Lightbox Header */
.gl-header {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(6, 11, 20, 0.95) 0%, rgba(6, 11, 20, 0.6) 100%);
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.gl-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Hide SP Number and Project Name as requested */
.gl-title-wrap,
.gl-title,
.gl-subtitle,
.gl-badge-ref {
  display: none !important;
}

.gl-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  flex-shrink: 0;
}

.gl-counter-badge i {
  color: #34d399;
}

/* Header Toolbar Buttons */
.gl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.gl-btn.gl-btn-active {
  background: rgba(14, 75, 49, 0.85);
  border-color: #34d399;
  color: #34d399;
}

/* Fullscreen Pill Button */
.gl-btn-expand {
  width: auto;
  border-radius: 9999px;
  padding: 0 14px;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.gl-btn-expand i {
  font-size: 13px;
  color: #34d399;
}

.gl-btn-expand:hover {
  background: rgba(14, 75, 49, 0.85);
  border-color: #34d399;
  color: #ffffff;
}

.gl-btn-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  margin-left: 4px;
}

.gl-btn-close:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg) scale(1.05);
}


/* --- Center Slide Stage --- */
/* Uses flex: 1 1 0 with min-height: 0 so it never overflows or pushes the footer */
.gl-stage {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px 18px;
  box-sizing: border-box;
}

.gl-slide-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease-out;
  overflow: hidden;
}

.gl-main-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: zoom-in;
  will-change: transform, opacity;
  display: block;
}

.gl-main-img.is-zoomed {
  cursor: grab;
  transform: scale(1.75);
  box-shadow: 0 35px 80px -15px rgba(0, 0, 0, 0.9);
}

.gl-main-img.is-zoomed:active {
  cursor: grabbing;
}

.gl-main-img.is-sliding-out-left {
  opacity: 0;
  transform: translateX(-50px) scale(0.97);
}

.gl-main-img.is-sliding-out-right {
  opacity: 0;
  transform: translateX(50px) scale(0.97);
}

.gl-main-img.is-sliding-in {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Ambient Glow behind Image */
.gl-ambient-glow {
  position: absolute;
  width: 65%;
  height: 65%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 75, 49, 0.35) 0%, rgba(14, 75, 49, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

/* Nav Arrows */
.gl-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.gl-arrow:hover {
  background: rgba(14, 75, 49, 0.92);
  border-color: rgba(52, 211, 153, 0.6);
  color: #34d399;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 14px 35px rgba(14, 75, 49, 0.6);
}

.gl-prev {
  left: 18px;
}

.gl-next {
  right: 18px;
}


/* --- Bottom Thumbnail Carousel Strip --- */
/* flex-shrink: 0 ensures the footer is NEVER clipped or squeezed */
.gl-footer {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px 14px;
  background: linear-gradient(to top, rgba(6, 11, 20, 0.98) 0%, rgba(6, 11, 20, 0.85) 100%);
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.gl-thumb-rail {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 6px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.35) rgba(255, 255, 255, 0.05);
  -webkit-overflow-scrolling: touch;
}

.gl-thumb-rail::-webkit-scrollbar {
  height: 5px;
}

.gl-thumb-rail::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
}

.gl-thumb-rail::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.4);
  border-radius: 9999px;
}

.gl-thumb-item {
  position: relative;
  flex: 0 0 70px;
  height: 48px;
  min-height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #1e293b;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

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

.gl-thumb-item.is-active {
  opacity: 1;
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.3), 0 8px 20px rgba(14, 75, 49, 0.5);
  transform: translateY(-2px) scale(1.05);
}

.gl-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Keyboard Hints Footer */
.gl-hints {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 16px;
}

.gl-hints span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gl-hints kbd {
  display: inline-block;
  padding: 2px 5px;
  font-size: 10px;
  font-family: inherit;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Autoplay Progress Bar */
.gl-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #34d399);
  width: 0%;
  transition: width linear;
  z-index: 20;
}


/* ==========================================================================
   Responsive Adaptations (Mobile & Small Screens)
   ========================================================================== */
@media (max-width: 900px) {
  .gl-modal {
    padding: 12px;
  }
  .gl-dialog {
    width: 96vw;
    height: 90vh;
    border-radius: 16px;
  }
  .gl-btn-label {
    display: none;
  }
  .gl-btn-expand {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
  }
}

@media (max-width: 640px) {
  .gl-modal {
    padding: 0;
  }
  .gl-dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .gl-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .gl-counter-badge {
    padding: 5px 11px;
    font-size: 12px;
  }
  .gl-btn {
    width: 35px;
    height: 35px;
    font-size: 13px;
  }
  .gl-btn-expand {
    width: 35px;
    height: 35px;
  }
  .gl-stage {
    padding: 6px 10px;
  }
  .gl-arrow {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }
  .gl-prev {
    left: 8px;
  }
  .gl-next {
    right: 8px;
  }
  .gl-footer {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }
  .gl-thumb-item {
    flex: 0 0 56px;
    height: 40px;
    min-height: 40px;
    border-radius: 6px;
  }
  .gl-hints {
    display: none;
  }
  .gallery-expand-badge {
    padding: 8px 14px;
    font-size: 12px;
    bottom: 12px;
    right: 12px;
  }
}

/* Landscape / short screens */
@media (max-height: 600px) {
  .gl-dialog {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .gl-header {
    padding: 8px 12px;
  }
  .gl-footer {
    padding: 6px 10px;
  }
  .gl-thumb-item {
    height: 34px;
    min-height: 34px;
    flex: 0 0 48px;
  }
  .gl-hints {
    display: none;
  }
}
