.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;

  transition: all 0.3s ease;
}

.gallery img:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 25px rgba(255,0,0,0.5);
}

/* =========================
   LIGHTBOX ANIMATION UPGRADE
========================= */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);

  opacity: 0;
  pointer-events: none;

  transition: 
    background 0.4s ease,
    backdrop-filter 0.4s ease,
    opacity 0.3s ease;

  z-index: 9999;
}

/* ACTIVE STATE */
#lightbox.active {
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(6px);
  opacity: 1;
  pointer-events: all;
}

/* IMAGE (ZOOM START STATE) */
#lightboxImg {
  max-width: 85%;
  max-height: 75vh;

  border-radius: 12px;
  box-shadow: 0 0 40px rgba(255,0,0,0.5);

  transform: scale(0.8);
  opacity: 0;

  transition: 
    transform 0.4s ease,
    opacity 0.4s ease;
}

/* IMAGE WHEN OPEN */
#lightbox.active #lightboxImg {
  transform: scale(1);
  opacity: 1;
}

/* CLOSE BUTTON */
#closeBtn {
  position: absolute;
  top: 20px;
  right: 30px;

  font-size: 35px;
  color: #fff;
  cursor: pointer;

  transition: 0.3s;
}

#closeBtn:hover {
  color: red;
  transform: scale(1.2);
}

/* ARROWS */
#prevBtn, #nextBtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  font-size: 45px;
  color: #fff;
  cursor: pointer;

  transition: 0.3s;
}

#prevBtn { left: 20px; }
#nextBtn { right: 20px; }

#prevBtn:hover,
#nextBtn:hover {
  color: red;
  transform: translateY(-50%) scale(1.2);
}

/* =========================
   BACK TO TOP (MODERN)
========================= */
#topBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;

  width: 55px;
  height: 55px;

  border-radius: 50%;
  border: none;

  background: linear-gradient(145deg, #ff0000, #b30000);
  color: #fff;

  font-size: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  box-shadow: 0 0 15px rgba(255,0,0,0.4);

  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);

  transition: all 0.3s ease;
  z-index: 999;
}

/* SHOW */
#topBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* HOVER */
#topBtn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 25px rgba(255,0,0,0.8);
}

/* CLICK FEEDBACK */
#topBtn:active {
  transform: scale(0.95);
}