
#carousel {
  position: relative;
  height: 400px;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
}

#carousel div {
  position: absolute;
  transition: transform 1s, left 1s, opacity 1s, z-index 0s;
  opacity: 1;
}

#carousel div img {
  width: 400px;
  transition: width 1s;
  border-radius: 10px;
  box-shadow: 0px 4px 15px rgba(0,0,0,0.3);
}

/* Positions */
#carousel div.hideLeft { left: 0%; opacity: 0; transform: translateY(50%) translateX(-50%); }
#carousel div.hideLeft img { width: 200px; }

#carousel div.hideRight { left: 100%; opacity: 0; transform: translateY(50%) translateX(-50%); }
#carousel div.hideRight img { width: 200px; }

#carousel div.prev { z-index: 5; left: 30%; transform: translateY(50px) translateX(-50%); }
#carousel div.prev img { width: 300px; }

#carousel div.prevLeftSecond { z-index: 4; left: 15%; transform: translateY(50%) translateX(-50%); opacity: 0.7; }
#carousel div.prevLeftSecond img { width: 200px; }

#carousel div.selected { z-index: 10; left: 50%; transform: translateY(0px) translateX(-50%); }

#carousel div.next { z-index: 5; left: 70%; transform: translateY(50px) translateX(-50%); }
#carousel div.next img { width: 300px; }

#carousel div.nextRightSecond { z-index: 4; left: 85%; transform: translateY(50%) translateX(-50%); opacity: 0.7; }
#carousel div.nextRightSecond img { width: 200px; }

/* Buttons */
.buttons {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
}
.buttons button {
  background: none;
  border: none;
  font-size: 35px;
  cursor: pointer;
  margin: 0 20px;
  color: #333;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative; /* arrows iske andar fix ho jayenge */
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 12px;
}

/* Close button */
.modal .close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

/* Arrows */
.modal-prev, .modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 50%;
  transition: background 0.3s;
}

.modal-prev:hover, .modal-next:hover {
  background: rgba(0,0,0,0.7);
}

.modal-prev { left: -60px; }   /* image ke left side */
.modal-next { right: -60px; }  /* image ke right side */


/* Responsive */
@media(max-width: 600px) {
  #carousel div img { width: 200px; }
  #carousel div.prev img, #carousel div.next img { width: 150px; }
  #carousel div.selected img { width: 220px; }
}
@media(max-width: 600px) {
  .modal-prev { left: 10px; }
  .modal-next { right: 10px; }
}
