/* Image Viewer Modal Styles */
.image-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.image-viewer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-viewer-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--bg-gradient-onyx);
  border-radius: 20px;
  border: 1px solid var(--jet);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: scale(0.8) translateY(20px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-viewer-overlay.active .image-viewer-container {
  transform: scale(1) translateY(0);
}

/* Header */
.image-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-gradient-jet);
  border-bottom: 1px solid var(--jet);
}

.image-viewer-title {
  color: var(--white-1);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
  font-family: var(--ff-poppins);
}

.image-viewer-close {
  background: none;
  border: none;
  color: var(--light-gray);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.image-viewer-close:hover {
  background: var(--jet);
  color: var(--orange-yellow-crayola);
  transform: scale(1.1);
}

/* Content Area */
.image-viewer-content {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.image-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--smoky-black);
  overflow: hidden;
}

.certificate-image {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

.certificate-image.zoomed {
  cursor: zoom-out;
  transform: scale(1.5);
}

/* Navigation Controls */
.image-viewer-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-gradient-onyx);
  border: 1px solid var(--jet);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--white-1);
  font-size: 1.2rem;
  z-index: 10001;
}

.image-viewer-navigation:hover {
  background: var(--orange-yellow-crayola);
  color: var(--smoky-black);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-prev {
  left: 20px;
}

.nav-next {
  right: 20px;
}

.image-viewer-navigation.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Zoom Controls */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10001;
}

.zoom-btn {
  background: var(--bg-gradient-onyx);
  border: 1px solid var(--jet);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--white-1);
  font-size: 1rem;
}

.zoom-btn:hover {
  background: var(--orange-yellow-crayola);
  color: var(--smoky-black);
  transform: scale(1.1);
}

/* Certificate Info */
.certificate-info {
  padding: 20px 24px;
  background: var(--bg-gradient-jet);
  border-top: 1px solid var(--jet);
}

.certificate-info h3 {
  color: var(--orange-yellow-crayola);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 8px 0;
  font-family: var(--ff-poppins);
}

.certificate-info p {
  color: var(--light-gray);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 4px 0;
}

.certificate-info .organization {
  color: var(--white-2);
  font-weight: 400;
}

/* Indicators */
.image-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--bg-gradient-jet);
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--jet);
  cursor: pointer;
  transition: all 0.2s ease;
}

.indicator.active {
  background: var(--orange-yellow-crayola);
  transform: scale(1.2);
}

.indicator:hover {
  background: var(--light-gray);
}

/* Loading State */
.image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--light-gray);
  font-size: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--jet);
  border-top: 3px solid var(--orange-yellow-crayola);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Light Theme Support */
[data-theme="light"] .image-viewer-overlay {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .image-viewer-container {
  background: var(--bg-gradient-onyx);
  border-color: var(--light-gray-70);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .image-viewer-header,
[data-theme="light"] .certificate-info,
[data-theme="light"] .image-indicators {
  background: var(--eerie-black-1);
}

[data-theme="light"] .image-container {
  background: var(--white-1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .image-viewer-container {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 16px;
  }
  
  .image-viewer-header {
    padding: 16px 20px;
  }
  
  .image-viewer-title {
    font-size: 1.1rem;
  }
  
  .image-container {
    padding: 16px;
  }
  
  .certificate-image {
    max-height: 60vh;
  }
  
  .certificate-info {
    padding: 16px 20px;
  }
  
  .image-viewer-navigation {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  .nav-prev {
    left: 16px;
  }
  
  .nav-next {
    right: 16px;
  }
  
  .zoom-controls {
    bottom: 16px;
    right: 16px;
  }
  
  .zoom-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .image-viewer-container {
    max-width: 98vw;
    max-height: 98vh;
    border-radius: 12px;
  }
  
  .certificate-image {
    max-height: 50vh;
  }
  
  .image-viewer-navigation {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .nav-prev {
    left: 12px;
  }
  
  .nav-next {
    right: 12px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .image-viewer-overlay,
  .image-viewer-container,
  .certificate-image,
  .image-viewer-navigation,
  .zoom-btn,
  .indicator {
    transition: none !important;
    animation: none !important;
  }
  
  .loading-spinner {
    animation: none !important;
    border-top-color: var(--orange-yellow-crayola);
  }
}

/* Focus states for accessibility */
.image-viewer-close:focus,
.image-viewer-navigation:focus,
.zoom-btn:focus,
.indicator:focus {
  outline: 2px solid var(--orange-yellow-crayola);
  outline-offset: 2px;
}
