/**
 * Certificates Component Styles
 * 
 * Certificate carousel and modal styling with brand color integration
 * Features smooth infinite scroll, hover effects, and modal popup
 */

/* ========== CERTIFICATES SECTION LAYOUT ========== */
.certificates-section {
  overflow: hidden;
  position: relative;
  /* Brand color gradient background for seamless integration */
  background: linear-gradient(135deg, var(--color-secondary-25) 0%, var(--color-primary-50) 100%);
}

/* Seamless Transition Gradients */
.certificates-section .absolute.top-0 {
  /* Accent gradient at top for seamless transition from previous section */
  background: linear-gradient(to bottom, var(--color-accent-50) 0%, transparent 100%);
  z-index: 5;
}

.certificates-section .absolute.bottom-0 {
  /* Neutral gradient at bottom for seamless transition to next section */
  background: linear-gradient(to top, var(--color-neutral-50) 0%, transparent 100%);
  z-index: 5;
}

/* ========== CERTIFICATES CAROUSEL ========== */
.certificates-carousel-wrapper {
  position: relative;
  overflow: hidden;
  /* Clean overflow for better performance */
}

.certificatesSwiper {
  overflow: visible;
}

.certificatesSwiper .swiper-wrapper {
  transition-timing-function: linear;
}

/* ========== CERTIFICATE CONTAINERS ========== */
.certificate-container {
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-primary-100);
  transition: all var(--duration-normal) var(--ease-smooth);
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
}

.certificate-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(92, 225, 230, 0.15);
  border-color: var(--color-primary-300);
}

/* Certificate Image Wrapper */
.certificate-image-wrapper {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.certificate-image-wrapper img {
  transition: all var(--duration-slow) var(--ease-smooth);
}

.certificate-container:hover .certificate-image-wrapper img {
  transform: scale(1.1);
}

/* Hover Overlay */
.certificate-image-wrapper .absolute {
  transition: all var(--duration-normal) var(--ease-smooth);
}

.certificate-container:hover .certificate-image-wrapper .absolute {
  background-color: rgba(92, 225, 230, 0.1);
}

/* Certificate Title */
.certificate-container h3 {
  transition: color var(--duration-normal) var(--ease-smooth);
}

.certificate-container:hover h3 {
  color: var(--color-primary-600);
}

/* ========== CERTIFICATE MODAL ========== */
.certificate-modal {
  backdrop-filter: blur(8px);
  transition: all var(--duration-normal) var(--ease-smooth);
  cursor: pointer;
}

.certificate-modal.modal-open {
  opacity: 1;
  visibility: visible;
}

.certificate-modal.modal-open .modal-content {
  transform: scale(1);
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transition: transform var(--duration-normal) var(--ease-smooth);
  cursor: default;
}

.modal-close {
  transition: all var(--duration-fast) var(--ease-smooth);
  z-index: 60;
  cursor: pointer;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  outline: none;
}

.modal-close:hover {
  transform: scale(1.1);
  background-color: var(--color-primary-50);
}

.modal-close:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.modal-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.modal-image-container img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.modal-title-container {
  background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-primary-25) 100%);
  border-top: 1px solid var(--color-primary-100);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .certificate-container {
    /* Simplified mobile hover effects */
    transform: none;
  }
  
  .certificate-container:active {
    transform: scale(0.98);
  }
  
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 1rem;
  }
  
  .modal-image-container img {
    max-height: 70vh;
  }
}

/* ========== ACCESSIBILITY ========== */
.certificate-container:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.modal-close:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* Smooth infinite scroll effect */
.certificatesSwiper .swiper-slide {
  transition: transform var(--duration-normal) var(--ease-smooth);
}

/* Loading state */
.certificate-image-wrapper.loading {
  background: linear-gradient(90deg, var(--color-neutral-100) 25%, var(--color-neutral-50) 50%, var(--color-neutral-100) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
