/* ============================================================
   Certificates Page Styles — IQCL
   Mirrors the React CertificatesHeroSection,
   CertificatesGridSection, and CertificatesTrustBadge
   ============================================================ */

/* ── Hero Section ── */
.cert-hero {
  position: relative;
  padding-top: clamp(7rem, 12vw, 10rem);
  padding-bottom: clamp(4rem, 7vw, 7rem);
  overflow: hidden;
}

.cert-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(210 70% 35% / 0.05) 0%, var(--background) 50%, hsl(195 85% 45% / 0.05) 100%);
  pointer-events: none;
}

.cert-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(3rem);
  pointer-events: none;
}

.cert-blob-1 {
  top: 5rem;
  left: 25%;
  width: 18rem;
  height: 18rem;
  background: hsl(210 70% 35% / 0.08);
  animation: pulse-glow 4s ease-in-out infinite;
}

.cert-blob-2 {
  bottom: 2.5rem;
  right: 25%;
  width: 24rem;
  height: 24rem;
  background: hsl(195 85% 45% / 0.06);
}

.cert-grid-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(hsl(var(--foreground, 220 25% 10%)) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground, 220 25% 10%)) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.cert-hero-content {
  position: relative;
  z-index: 10;
}

.cert-hero-inner {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Hero badge */
.cert-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: hsl(210 70% 35% / 0.1);
  border: 1px solid hsl(210 70% 35% / 0.2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.025em;
}

.cert-hero-badge svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Hero title */
.cert-hero-title {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--foreground);
}

/* Hero description */
.cert-hero-desc {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 40rem;
  line-height: 1.7;
}

/* Hero pills */
.cert-hero-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.cert-hero-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.cert-hero-pill svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Certificates Grid Section ── */
.cert-grid-section {
  padding: clamp(4rem, 7vw, 7rem) 0;
  background: var(--background);
  position: relative;
}

.cert-cards-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cert-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .cert-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Certificate Card */
.cert-card {
  position: relative;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              border-color 0.4s ease;
  overflow: hidden;
}

.cert-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: inherit;
}

.cert-card:hover {
  transform: translateY(-8px);
}

/* Color variants */
.cert-card--primary { border-color: hsl(210 70% 35% / 0.2); }
.cert-card--primary:hover {
  border-color: hsl(210 70% 35% / 0.4);
  box-shadow: 0 8px 40px -8px hsl(210 70% 35% / 0.25);
}
.cert-card--primary::before { background: linear-gradient(135deg, hsl(210 70% 35% / 0.04), transparent); }
.cert-card--primary:hover::before { opacity: 1; }

.cert-card--accent { border-color: hsl(195 85% 45% / 0.2); }
.cert-card--accent:hover {
  border-color: hsl(195 85% 45% / 0.4);
  box-shadow: 0 8px 40px -8px hsl(195 85% 45% / 0.25);
}
.cert-card--accent::before { background: linear-gradient(135deg, hsl(195 85% 45% / 0.04), transparent); }
.cert-card--accent:hover::before { opacity: 1; }

.cert-card--success { border-color: hsl(155 70% 40% / 0.2); }
.cert-card--success:hover {
  border-color: hsl(155 70% 40% / 0.4);
  box-shadow: 0 8px 40px -8px hsl(155 70% 40% / 0.25);
}
.cert-card--success::before { background: linear-gradient(135deg, hsl(155 70% 40% / 0.04), transparent); }
.cert-card--success:hover::before { opacity: 1; }

/* Card icon */
.cert-card-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease;
}

.cert-card:hover .cert-card-icon {
  transform: scale(1.08);
}

.cert-icon--primary { background: hsl(210 70% 35% / 0.1); color: var(--primary); }
.cert-icon--primary svg { color: var(--primary); }
.cert-card--primary:hover .cert-icon--primary { background: hsl(210 70% 35% / 0.18); }

.cert-icon--accent { background: hsl(195 85% 45% / 0.1); color: var(--accent); }
.cert-icon--accent svg { color: var(--accent); }
.cert-card--accent:hover .cert-icon--accent { background: hsl(195 85% 45% / 0.18); }

.cert-icon--success { background: hsl(155 70% 40% / 0.1); color: var(--success); }
.cert-icon--success svg { color: var(--success); }
.cert-card--success:hover .cert-icon--success { background: hsl(155 70% 40% / 0.18); }

/* Card body */
.cert-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cert-card-title {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.3;
}

.cert-card-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.65;
}

/* Details list */
.cert-details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex: 1;
}

.cert-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.cert-detail-item > svg {
  color: var(--muted-foreground);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.cert-detail-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.cert-detail-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.5;
  word-break: break-word;
  margin: 0;
}

/* Active status */
.cert-status-active {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--success) !important;
}

.cert-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Card actions */
.cert-card-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.cert-card-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ── Trust Badges Section ── */
.cert-trust-section {
  position: relative;
  padding: clamp(4rem, 7vw, 6rem) 0;
  background: hsl(210 15% 92% / 0.3);
  overflow: hidden;
}

.cert-trust-blob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 300px;
  background: hsl(210 70% 35% / 0.05);
  border-radius: 50%;
  filter: blur(3rem);
  pointer-events: none;
}

.cert-trust-inner {
  position: relative;
  z-index: 10;
}

.cert-trust-header {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cert-trust-title {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--foreground);
}

.cert-trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .cert-trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cert-trust-card {
  text-align: center;
  padding: 1.75rem 1.25rem;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid hsl(210 20% 88% / 0.5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.cert-trust-card:hover {
  border-color: hsl(210 70% 35% / 0.3);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

.cert-trust-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: hsl(210 70% 35% / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  transition: background 0.3s ease;
}

.cert-trust-icon svg {
  color: var(--primary);
}

.cert-trust-card:hover .cert-trust-icon {
  background: hsl(210 70% 35% / 0.2);
}

.cert-trust-label {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.cert-trust-sub {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* ── PDF Modal ── */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cert-modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.cert-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cert-modal-box {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  width: 100%;
  max-width: 56rem;
  height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cert-modal.is-open .cert-modal-box {
  transform: scale(1) translateY(0);
}

.cert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cert-modal-title {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
}

.cert-modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--secondary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--foreground);
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.cert-modal-close:hover {
  background: var(--muted);
  transform: scale(1.05);
}

.cert-modal-body {
  flex: 1;
  padding: 1rem 1.5rem 1.5rem;
  overflow: hidden;
}

.cert-modal-body iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--muted);
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* ── Responsive Adjustments ── */
@media (max-width: 767px) {
  .cert-hero-title {
    font-size: clamp(1.875rem, 8vw, 2.5rem);
  }

  .cert-hero-desc {
    font-size: 1rem;
  }

  .cert-hero-pills {
    gap: 1rem;
  }

  .cert-card {
    padding: 1.5rem;
  }

  .cert-modal-box {
    height: 90vh;
    border-radius: 0.75rem;
  }

  .cert-modal-body {
    padding: 0.75rem 1rem 1rem;
  }

  .cert-trust-grid {
    gap: 1rem;
  }

  .cert-trust-card {
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 480px) {
  .cert-card-actions {
    flex-direction: column;
  }

  .cert-hero-pills {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ── Print ── */
@media print {
  .cert-modal,
  .cert-card-actions { display: none !important; }
}
