/* Modal Gallery Styles */
.modaltwo {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modaltwo-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 85%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease-in-out;
}

.modaltwo-content:hover {
  transform: translate(-50%, -50%) scale(1.02);
}

.modaltwo-close-layer {
  position: absolute;
  top: 20px;
  right: 30px;
  z-index: 1001;
}

.closetwo {
  color: #fff;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.closetwo:hover,
.closetwo:focus {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.2);
  transform: rotate(90deg) scale(1.1);
}

/* Navigation Controls */
.modaltwo-controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1001;
}

.prevtwo, .nexttwo {
    
  position: fixed;
  top: 50%;
  margin-top: -35px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 24px;
  width: 70px;
  height: 70px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1002;
}

.prevtwo:hover, .nexttwo:hover {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.3), rgba(74, 144, 226, 0.1));
  border-color: rgba(74, 144, 226, 0.6);
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(74, 144, 226, 0.4);
}

.prevtwo:active, .nexttwo:active {
  transform: scale(0.95);
}

/* Positioning with better safe margins */
.prevtwo {
  left: 60px;
}

.nexttwo {
  right: 60px;
}

/* Arrow symbols */
.prevtwo::before {
  content: "‹";
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  margin-left: -2px;
}

.nexttwo::before {
  content: "›";
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  margin-right: -2px;
}

/* Image counter/indicator */
.image-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1001;
}

/* Mobile swipe hint */
.modaltwo-swipe-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .modaltwo-content {
    max-width: 95%;
    max-height: 80%;
  }
  
  .prevtwo, .nexttwo {
    position: fixed;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .prevtwo {
    left: 25px;
  }
  
  .nexttwo {
    right: 25px;
  }
  
  .closetwo {
    width: 50px;
    height: 50px;
    font-size: 35px;
  }
  
  .modaltwo-close-layer {
    top: 15px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .prevtwo, .nexttwo {
    display: none !important;
  }
  
  .modaltwo-swipe-hint {
    display: block;
  }
  
  .modaltwo-content {
    max-width: 98%;
    max-height: 75%;
  }
}

@media (min-width: 481px) {
  .modaltwo-swipe-hint {
    display: none;
  }
}