/* ==========================================================================
   CureTrip Medical Tourism - Certificates Collage Section
   ========================================================================== */

.certificates-section-area {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 50%, #edf3fa 100%);
  padding: 70px 0 85px;
}

.certificates-section-area::before {
  position: absolute;
  content: "";
  width: 400px;
  height: 400px;
  right: -140px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 179, 168, 0.12) 0%, rgba(18, 179, 168, 0) 70%);
  pointer-events: none;
}

.certificates-section-area::after {
  position: absolute;
  content: "";
  width: 360px;
  height: 360px;
  left: -130px;
  bottom: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 135, 55, 0.12) 0%, rgba(242, 135, 55, 0) 70%);
  pointer-events: none;
}

.certificates-section-area .container {
  position: relative;
  z-index: 2;
}

.certificates-heading {
  max-width: 700px;
  margin: 0 auto 40px;
}

/* Certificate Collage Grid */
.cert-collage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.cert-collage-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(2, 1, 90, 0.08);
  border: 1px solid rgba(2, 1, 90, 0.08);
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.cert-collage-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 45px rgba(242, 135, 55, 0.18);
  border-color: rgba(242, 135, 55, 0.4);
}

.cert-collage-frame {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-collage-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s ease;
  background: #ffffff;
}

.cert-collage-item:hover .cert-collage-img {
  transform: scale(1.05);
}

/* Collage Hover Overlay */
.cert-collage-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 1, 90, 0.2) 0%, rgba(2, 1, 90, 0.75) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.cert-collage-item:hover .cert-collage-overlay {
  opacity: 1;
}

.cert-collage-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f28737;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transform: scale(0.85);
  transition: transform 0.3s ease;
}

.cert-collage-item:hover .cert-collage-icon {
  transform: scale(1);
}

.cert-collage-label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cert-collage-caption {
  text-align: center;
  padding: 12px 6px 4px;
  font-size: 15px;
  font-weight: 700;
  color: #02015a;
  transition: color 0.25s ease;
  line-height: 1.35;
}

.cert-collage-item:hover .cert-collage-caption {
  color: #f28737;
}

/* ==========================================================================
   Certificate Lightbox Modal
   ========================================================================== */
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 1, 90, 0.88);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cert-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cert-modal-container {
  background: #ffffff;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cert-modal-backdrop.is-open .cert-modal-container {
  transform: scale(1);
}

.cert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #02015a;
  color: #ffffff;
}

.cert-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.cert-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cert-modal-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f28737;
  color: #ffffff !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.cert-modal-dl-btn:hover {
  background: #e07223;
}

.cert-modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cert-modal-close-btn:hover {
  background: #ef4444;
  transform: rotate(90deg);
}

.cert-modal-body {
  position: relative;
  padding: 20px;
  background: #0f172a;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 350px;
}

.cert-modal-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background: #ffffff;
}

/* Modal Nav Buttons */
.cert-modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.cert-modal-nav-btn:hover {
  background: #f28737;
  border-color: #f28737;
  transform: translateY(-50%) scale(1.1);
}

.cert-modal-prev {
  left: 20px;
}

.cert-modal-next {
  right: 20px;
}

.cert-modal-footer {
  padding: 12px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: #64748b;
}

.cert-modal-counter {
  font-weight: 700;
  color: #02015a;
}

/* Responsive Breakpoints */
@media (max-width: 1199px) {
  .cert-collage-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .cert-collage-frame {
    height: 320px;
  }
}

@media (max-width: 767px) {
  .certificates-section-area {
    padding: 55px 0 65px;
  }
  .cert-collage-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .cert-collage-frame {
    height: 280px;
  }
}
