/* ============================================
   CERTIFICATES SECTION — FULL UPDATED CSS
   (includes lightbox styles)
   ============================================ */

.certificates {
  padding: 6rem 2rem;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.certificates::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.certificates::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Header */
.certificates .section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  position: relative;
  z-index: 1;
}

.certificates .section-header h2 {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Space Grotesk', sans-serif;
}

.certificates .section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Stats Row */
.cert-stats-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.cert-stat-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.2rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 50px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.cert-stat-chip strong {
  color: var(--primary-light);
  font-weight: 700;
}

/* Grid */
.certificates-grid {
  max-width: 1100px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Card Base */
.certificate-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  cursor: pointer;
}

.certificate-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), rgba(236, 72, 153, 0.04));
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.certificate-card:hover {
  transform: translateY(-8px);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow:
    0 20px 50px rgba(139, 92, 246, 0.2),
    0 0 0 1px rgba(139, 92, 246, 0.08);
}

.certificate-card:hover::before {
  opacity: 1;
}

/* Click hint pulse on first load */
.certificate-card:not(.featured) {
  animation: subtle-pulse 3s ease-in-out 1s 2;
}

@keyframes subtle-pulse {

  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
  }
}

/* Featured Card */
.certificate-card.featured {
  grid-column: span 2;
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, #0F0B1A 0%, #160e28 100%);
}

.cert-accent-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 20px 20px 0 0;
}

.cert-featured-pill {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  padding: 0.25rem 0.8rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
}

/* Card Top */
.cert-top {
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.certificate-card.featured .cert-top {
  padding: 2rem 2rem 1.2rem;
}

/* Issuer Logo */
.cert-issuer-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.certificate-card.featured .cert-issuer-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 28px;
}

.cert-meta {
  flex: 1;
  min-width: 0;
}

.cert-issuer-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-family: 'Space Grotesk', sans-serif;
}

.cert-title-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  font-family: 'Space Grotesk', sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.certificate-card.featured .cert-title-text {
  font-size: 1.15rem;
}

.cert-verified {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--success);
  font-weight: 700;
}

.cert-divider {
  height: 1px;
  background: var(--border);
  margin: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.cert-skills {
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.cert-skill-tag {
  padding: 0.25rem 0.7rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-light);
  transition: all 0.2s ease;
}

.certificate-card:hover .cert-skill-tag {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.35);
}

.cert-footer {
  padding: 0.8rem 1.5rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.cert-type-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.cert-type-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.cert-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--primary-light);
  transition: all 0.25s ease;
}

.certificate-card:hover .cert-arrow-btn {
  background: var(--primary);
  transform: scale(1.1);
}

/* Hidden state */
.certificate-card.hidden {
  display: none;
}

/* ============================================
   LIGHTBOX MODAL
   ============================================ */

.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cert-lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.cert-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.cert-lightbox-panel {
  position: relative;
  z-index: 1;
  background: #1A1625;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.88) translateY(30px);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cert-lightbox.active .cert-lightbox-panel {
  transform: scale(1) translateY(0);
}

/* Top gradient bar */
.cert-lightbox-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 2;
}

.cert-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.cert-lightbox-close:hover {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.4);
  color: var(--accent);
  transform: rotate(90deg);
}

.cert-lightbox-inner {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 88vh;
}

/* Image side — full width, natural aspect ratio */
.cert-lightbox-img-wrap {
  width: 100%;
  background: #0a0712;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  flex-shrink: 0;
}

.cert-lightbox-img {
  width: 100%;
  max-width: 700px;
  height: auto;
  max-height: 55vh;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Info side */
.cert-lightbox-info {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}

.cert-lightbox-issuer {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary-light);
  font-family: 'Space Grotesk', sans-serif;
}

.cert-lightbox-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  font-family: 'Space Grotesk', sans-serif;
}

.cert-lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cert-lightbox-tags .cert-skill-tag {
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
}

.cert-lightbox-type {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.cert-lightbox-type::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Nav arrows inside lightbox */
.cert-lightbox-nav {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}


.cert-nav-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--primary-light);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  font-family: 'Space Grotesk', sans-serif;
}

.cert-nav-btn:hover {
  background: var(--primary);
  color: white;
}

.cert-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* See More Button */
.certificates .see-more-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.certificates .see-more-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 2rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, .3);
  background: rgba(139, 92, 246, .07);
  color: var(--primary-light);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s;
}

.certificates .see-more-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transition: width 0.5s ease, height 0.5s ease;
  z-index: -1;
}

.certificates .see-more-btn:hover::before {
  width: 350px;
  height: 350px;
}

.certificates .see-more-btn:hover {
  color: white;
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.35);
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .certificate-card.featured {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .certificates {
    padding: 4rem 1.5rem;
  }

  .certificates .section-header h2 {
    font-size: 2.2rem;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .cert-stats-row {
    gap: 0.8rem;
  }

  .certificates .see-more-btn {
    /* width: 100%; */
    justify-content: center;
  }

  .cert-lightbox-img-wrap {
    padding: 1rem;
  }

  .cert-lightbox-img {
    max-height: 45vh;
  }

  .cert-lightbox-info {
    padding: 1.2rem 1.5rem 1.5rem;
    gap: 0.8rem;
  }

  .cert-lightbox-title {
    font-size: 1.1rem;
  }

  .cert-lightbox-panel {
    border-radius: 18px;
    max-height: 95vh;
  }
}

@media (max-width: 480px) {
  .certificates .section-header h2 {
    font-size: 1.8rem;
  }

  .cert-top {
    padding: 1.2rem 1.2rem 0.8rem;
  }

  .cert-skills {
    padding: 0.8rem 1.2rem;
  }

  .cert-footer {
    padding: 0.6rem 1.2rem 1rem;
  }
}