/* ======== Gallery Section ======== */
.gallery-section {
  text-align: center;
  padding: 60px 20px;
  background: #f8f9fa;
}

.gallery-section h2 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #2b2b2b;
  font-weight: 700;
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 10px;
}

.gallery-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1rem;
  padding: 10px;
  text-align: center;
}

/* ======== Lightbox ======== */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img,
.lightbox-content iframe {
  max-width: 90%;
  max-height: 85%;
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
}

/* ======== Controls (Close + Zoom) ======== */
.controls-wrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
}

/* Close Button */
.close-btn {
  background: red;
  border: none;
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
  transition: 0.3s ease;
}

.close-btn:hover {
  background: darkred;
  transform: scale(1.1);
}

/* Zoom Buttons */
.zoom-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .controls-wrapper {
    top: 10px;
    right: 10px;
    gap: 8px;
  }
  .close-btn, .zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}


/* add for animaiton */

/* ===================================================================================================================================== */ 

/* 3D Rotating Image Gallery - Responsive Version */

/* 3D Rotating Image Gallery - Final Responsive Version with Spacing */

.wrapper {
  width: 100%;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 🔹 Background Image */
.background {
  background-image: url('../img/bgy.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.5);
  z-index: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 🔹 Gallery Inner Ring */
.inner {
  --w: 180px;
  --h: 250px;
  --translateZ: calc((var(--w) + var(--h)) * 0.8); /* 🔸 increased for spacing */
  --rotateX: -15deg;
  --perspective: 1000px;
  position: absolute;
  width: var(--w);
  height: var(--h);
  transform-style: preserve-3d;
  animation: rotating 20s linear infinite;
  z-index: 2;
}

@keyframes rotating {
  from {
    transform: perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(0);
  }
  to {
    transform: perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(1turn);
  }
}

/* 🔹 Cards */
.card {
  position: absolute;
  inset: 0;
  transform: rotateY(calc((360deg / var(--quantity)) * var(--index)))
    translateZ(var(--translateZ));
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border-radius: 15px;
  transition: 0.5s;
}

.card:hover .img {
  transform: scale(1.05);
}

.wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* ===============================
   ✅ RESPONSIVE ADJUSTMENTS
   =============================== */

/* Tablets (landscape & portrait) */
@media (max-width: 1024px) {
  .inner {
    --w: 150px;
    --h: 210px;
    --translateZ: calc((var(--w) + var(--h)) * 0.85); /* 🔸 more spacing */
    --rotateX: -12deg;
    --perspective: 900px;
  }
}

/* Mobiles (below 768px) */
@media (max-width: 768px) {
  .wrapper {
    height: 90vh;
  }

  .inner {
    --w: 120px;
    --h: 170px;
    --translateZ: calc((var(--w) + var(--h)) * 0.9); /* 🔸 spacing added */
    --rotateX: -10deg;
    --perspective: 800px;
  }

  .card {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  }
}

/* Small Phones (below 480px) */
@media (max-width: 480px) {
  .wrapper {
    height: 85vh;
  }

  .inner {
    --w: 100px;
    --h: 140px;
    --translateZ: calc((var(--w) + var(--h)) * .7); /* 🔸 max spacing for tiny screens */
    --rotateX: -8deg;
    --perspective: 700px;
  }

  .card {
    border-radius: 10px;
  }
}




/* ======================Gallery Title==================== */

.gallery-title01 {
  position: absolute;
  top: 80px; /* Title ko image ke top ke thoda neeche rakhta hai */
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  animation: glow 1s ease-in-out infinite alternate;
  z-index: 5;
}

/* Glowing animation */
@keyframes glow {
  from {
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  }
  to {
    text-shadow: 0 0 20px #ff00ff, 0 0 30px #ff00ff;
  }
}
