﻿/* ============================================================
   CERTIFICATIONS PAGE STYLES (Light Theme Default + Dark Theme Toggle)
   Matches site header, glassmorphism design system, and dark mode
   ============================================================ */

:root {
  --cr-bg-light: #F8FAFC;
  --cr-surface-light: #FFFFFF;
  --cr-border-light: rgba(226, 232, 240, 0.8);
  --cr-text-dark: #0F172A;
  --cr-text-muted-light: #64748B;

  --cr-bg-dark: #070B14;
  --cr-surface-dark: #0E1526;
  --cr-card-dark: #111A2E;
  --cr-border-dark: rgba(255, 255, 255, 0.08);
  --cr-text-light: #F8FAFC;
  --cr-text-muted-dark: #9CA3AF;

  --cr-primary: #3B82F6;
  --cr-indigo: #4F46E5;
  --cr-purple: #8B5CF6;
}

/* Light Theme Default */
body[data-page="certifications"] {
  background-color: var(--cr-bg-light) !important;
  font-family: 'Inter', sans-serif;
  color: var(--cr-text-dark);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Theme Override */
body[data-page="certifications"].dark-mode {
  background-color: var(--cr-bg-dark) !important;
  color: var(--cr-text-light);
}

.cr-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HERO SECTION ===== */
.cr-hero {
  padding: 40px 0 40px;
  position: relative;
  overflow: hidden;
}

.cr-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.cr-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--cr-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

body[data-page="certifications"].dark-mode .cr-pill-badge {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818CF8;
}

.cr-hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--cr-text-dark);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

body[data-page="certifications"].dark-mode .cr-hero-title {
  color: #FFFFFF;
}

.cr-gradient-text {
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 50%, #8B5CF6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cr-hero-desc {
  font-size: 1.05rem;
  color: var(--cr-text-muted-light);
  line-height: 1.65;
  max-width: 580px;
}

body[data-page="certifications"].dark-mode .cr-hero-desc {
  color: #94A3B8;
}

/* 3D Certificate & Shield Graphic */
.cr-hero-graphic {
  position: relative;
  width: 100%;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cr-cert-document {
  width: 220px;
  height: 260px;
  background: #FFFFFF;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transform: rotate(-4deg);
}

body[data-page="certifications"].dark-mode .cr-cert-document {
  background: var(--cr-surface-dark);
  border-color: var(--cr-border-dark);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.cr-cert-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-cert-line {
  height: 8px;
  border-radius: 4px;
  background: #F1F5F9;
}

body[data-page="certifications"].dark-mode .cr-cert-line {
  background: rgba(255, 255, 255, 0.1);
}

.cr-cert-line.w80 { width: 80%; background: #DBEAFE; }
body[data-page="certifications"].dark-mode .cr-cert-line.w80 { background: rgba(59, 130, 246, 0.3); }
.cr-cert-line.w60 { width: 60%; }

.cr-cert-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3B82F6;
  color: #FFF;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
  align-self: flex-end;
}

.cr-shield-badge {
  position: absolute;
  bottom: 20px;
  right: 40px;
  width: 90px;
  height: 100px;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  border-radius: 20px 20px 50px 50px;
  display: grid;
  place-items: center;
  color: #FFF;
  font-size: 2.5rem;
  box-shadow: 0 15px 35px rgba(29, 78, 216, 0.4);
  animation: floatShield 5s ease-in-out infinite;
}

@keyframes floatShield {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Floating Stats Bar */
.cr-hero-stats {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 16px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--cr-border-light);
  display: flex;
  justify-content: space-around;
  margin-top: 30px;
  transition: background 0.3s, border-color 0.3s;
}

body[data-page="certifications"].dark-mode .cr-hero-stats {
  background: var(--cr-surface-dark);
  border-color: var(--cr-border-dark);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cr-hstat-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cr-hstat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--cr-primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

body[data-page="certifications"].dark-mode .cr-hstat-icon {
  background: rgba(99, 102, 241, 0.18);
  color: #818CF8;
}

.cr-hstat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--cr-text-dark);
  line-height: 1;
}

body[data-page="certifications"].dark-mode .cr-hstat-val {
  color: #FFFFFF;
}

.cr-hstat-lbl {
  font-size: 0.74rem;
  color: var(--cr-text-muted-light);
  font-weight: 600;
}

body[data-page="certifications"].dark-mode .cr-hstat-lbl {
  color: #94A3B8;
}

/* ===== FILTER TABS ===== */
.cr-filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 40px 0 36px;
}

.cr-filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--cr-border-light);
  color: var(--cr-text-dark);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

body[data-page="certifications"].dark-mode .cr-filter-btn {
  background: var(--cr-surface-dark);
  border-color: var(--cr-border-dark);
  color: #94A3B8;
}

.cr-filter-btn:hover {
  border-color: var(--cr-primary);
  color: var(--cr-primary);
}

body[data-page="certifications"].dark-mode .cr-filter-btn:hover {
  border-color: #818CF8;
  color: #818CF8;
}

.cr-filter-btn.active {
  background: #0F172A;
  border-color: #0F172A;
  color: #FFFFFF;
}

body[data-page="certifications"].dark-mode .cr-filter-btn.active {
  background: #3B5BDB;
  border-color: #3B5BDB;
  color: #FFFFFF;
}

/* ===== CERTIFICATIONS CARDS GRID ===== */
.cr-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.cr-card {
  background: #FFFFFF;
  border: 1px solid var(--cr-border-light);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.3s ease;
  min-height: 180px;
}

body[data-page="certifications"].dark-mode .cr-card {
  background: var(--cr-surface-dark);
  border-color: var(--cr-border-dark);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cr-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

body[data-page="certifications"].dark-mode .cr-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(99, 102, 241, 0.4);
}

.cr-card-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 12px;
}

body[data-page="certifications"].dark-mode .cr-card-brand {
  color: #F8FAFC;
}

.cr-card-brand.coursera { color: #0056D2; }
body[data-page="certifications"].dark-mode .cr-card-brand.coursera { color: #3B82F6; }

.cr-card-brand.google { color: #4285F4; }
.cr-card-brand.ibm { color: #052FAD; font-family: 'Space Grotesk', sans-serif; }
body[data-page="certifications"].dark-mode .cr-card-brand.ibm { color: #60A5FA; }

.cr-card-brand.hedera { color: #222222; }
body[data-page="certifications"].dark-mode .cr-card-brand.hedera { color: #F8FAFC; }

.cr-card-brand.british { color: #002B49; }
body[data-page="certifications"].dark-mode .cr-card-brand.british { color: #38BDF8; }

.cr-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.35;
  margin-bottom: 6px;
}

body[data-page="certifications"].dark-mode .cr-card-title {
  color: #FFFFFF;
}

.cr-card-issuer {
  font-size: 0.78rem;
  color: var(--cr-text-muted-light);
  font-weight: 600;
  margin-bottom: 16px;
}

body[data-page="certifications"].dark-mode .cr-card-issuer {
  color: #94A3B8;
}

.cr-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #F1F5F9;
  margin-top: auto;
}

body[data-page="certifications"].dark-mode .cr-card-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.cr-card-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cr-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s, color 0.2s;
}

body[data-page="certifications"].dark-mode .cr-card-link {
  color: #818CF8;
}

.cr-card-link:hover {
  gap: 8px;
  color: #1D4ED8;
}

body[data-page="certifications"].dark-mode .cr-card-link:hover {
  color: #A5B4FC;
}

.cr-card-icon-link {
  color: #94A3B8;
  font-size: 0.82rem;
  transition: color 0.2s;
}

.cr-card-icon-link:hover {
  color: var(--cr-primary);
}

/* ===== BOTTOM BANNER (LEARNING NEVER STOPS) ===== */
.cr-bottom-banner {
  background: #FFFFFF;
  border: 1px solid var(--cr-border-light);
  border-radius: 24px;
  padding: 24px 36px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 80px;
  transition: background 0.3s, border-color 0.3s;
}

body[data-page="certifications"].dark-mode .cr-bottom-banner {
  background: var(--cr-surface-dark);
  border-color: var(--cr-border-dark);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.cr-banner-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.cr-banner-graphic {
  font-size: 2.8rem;
  color: var(--cr-primary);
  flex-shrink: 0;
}

body[data-page="certifications"].dark-mode .cr-banner-graphic {
  color: #818CF8;
}

.cr-banner-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
}

body[data-page="certifications"].dark-mode .cr-banner-title {
  color: #FFFFFF;
}

.cr-banner-desc {
  font-size: 0.85rem;
  color: var(--cr-text-muted-light);
  max-width: 540px;
}

body[data-page="certifications"].dark-mode .cr-banner-desc {
  color: #94A3B8;
}

.cr-banner-btn {
  padding: 12px 24px;
  border-radius: 14px;
  background: #3B82F6;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.2s;
}

.cr-banner-btn:hover {
  background: #2563EB;
  transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .cr-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 850px) {
  .cr-hero-grid { grid-template-columns: 1fr; }
  .cr-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .cr-bottom-banner { flex-direction: column; text-align: center; }
  .cr-banner-left { flex-direction: column; }
}

@media (max-width: 580px) {
  .cr-cards-grid { grid-template-columns: 1fr; }
  .cr-hero-stats { flex-direction: column; gap: 16px; align-items: flex-start; }
}

/* ============================================================
   CERTFX ANIMATED CARD COMPONENT — exact match to user's design
   ============================================================ */

.certificates-section {
  padding: 90px 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(66, 133, 244, 0.1), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(124, 58, 237, 0.09), transparent 30%),
    #f8fafc;
  font-family: Inter, Poppins, Arial, sans-serif;
}

.certificates-container {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.certificates-heading {
  max-width: 680px;
  margin-bottom: 45px;
}

.certificates-label {
  display: inline-block;
  margin-bottom: 10px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.certificates-heading h2 {
  margin: 0 0 15px;
  color: #0f172a;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
}

.certificates-heading p {
  margin: 0;
  color: #64748b;
  font-size: 16px;
  line-height: 1.75;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 35px;
  align-items: start;
}

.certfx-card {
  --cert-accent: #4285f4;
  --cert-secondary: #7c3aed;
  --cert-soft: #eef4ff;

  position: relative;
  width: min(100%, 340px);
  height: 180px;
transition: height 0.58s cubic-bezier(0.22, 1, 0.36, 1);
  margin: 0 auto;
  outline: none;
}
.certfx-card:hover,
.certfx-card:focus,
.certfx-card:focus-within {
  height: 410px;
}
.certfx-front,
.certfx-back {
  position: absolute;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.1),
    0 4px 12px rgba(15, 23, 42, 0.05);
  transition:
    height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s ease,
    background-color 0.4s ease,
    box-shadow 0.4s ease;
}

.certfx-front {
  top: 0;
  z-index: 2;
  height: 180px;
  overflow: hidden;
  padding: 23px;
  border-radius: 27px;
  background: #ffffff;
}

.certfx-back {
  top: 8px;
  z-index: 1;
  height: 165px;
  overflow: hidden;
  border-radius: 30px;
  background: #ffffff;
}

.certfx-card:hover .certfx-front,
.certfx-card:focus-within .certfx-front,
.certfx-card:focus .certfx-front {
  transform: translateX(-50%) translateY(-7px);
  background: var(--cert-soft);
  box-shadow:
    0 25px 55px rgba(15, 23, 42, 0.15),
    0 8px 20px rgba(15, 23, 42, 0.07);
}

.certfx-card:hover .certfx-back,
.certfx-card:focus-within .certfx-back,
.certfx-card:focus .certfx-back {
  height: 395px;
  border-bottom-right-radius: 20px;
  border-bottom-left-radius: 20px;
}

.certfx-decoration {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.5s ease;
}

.certfx-decoration-one {
  top: -55px;
  right: -45px;
  width: 145px;
  height: 145px;
  background: linear-gradient(145deg, var(--cert-accent), var(--cert-secondary));
  opacity: 0.14;
}

.certfx-decoration-two {
  right: 38px;
  bottom: -45px;
  width: 90px;
  height: 90px;
  background: var(--cert-accent);
  opacity: 0.08;
}

.certfx-card:hover .certfx-decoration-one,
.certfx-card:focus-within .certfx-decoration-one {
  transform: scale(1.15);
}

.certfx-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.certfx-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--cert-accent), var(--cert-secondary));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--cert-accent) 25%, transparent);
}

.certfx-icon svg {
  width: 25px;
  height: 25px;
  fill: #ffffff;
}

.certfx-category {
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--cert-accent) 20%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cert-accent) 8%, transparent);
  color: var(--cert-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.certfx-main-content {
  position: relative;
  z-index: 2;
  margin-top: 14px;
}

.certfx-provider {
  margin: 0 0 4px;
  color: var(--cert-accent);
  font-size: 12px;
  font-weight: 700;
}

.certfx-main-content h3 {
  margin: 0 0 7px;
  color: #0f172a;
  font-size: 21px;
  line-height: 1.25;
}

.certfx-summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.certfx-hover-label {
  position: absolute;
  right: 22px;
  bottom: 13px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 600;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.certfx-hover-label svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.certfx-card:hover .certfx-hover-label,
.certfx-card:focus-within .certfx-hover-label {
  opacity: 0;
  transform: translateY(5px);
}

.certfx-overview {
  position: absolute;
  top: 22px;
  left: 24px;
  display: flex;
  gap: 32px;
  color: #0f172a;
}

.certfx-overview-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.certfx-overview-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: var(--cert-accent);
}

.certfx-overview-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.certfx-overview-item span {
  color: #94a3b8;
  font-size: 9px;
}

.certfx-overview-item strong {
  color: #334155;
  font-size: 11px;
}

.certfx-expanded-content {
  position: absolute;
  top: 195px;
  left: 24px;
  right: 24px;
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.32s ease 0.14s, transform 0.4s ease 0.14s;
}

.certfx-card:hover .certfx-expanded-content,
.certfx-card:focus-within .certfx-expanded-content,
.certfx-card:focus .certfx-expanded-content {
  opacity: 1;
  transform: translateY(0);
}

.certfx-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

.certfx-detail span {
  color: #94a3b8;
  font-size: 10px;
}

.certfx-detail strong {
  max-width: 55%;
  overflow: hidden;
  color: #334155;
  font-size: 10px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certfx-skills {
  padding-top: 12px;
}

.certfx-skills-title {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.certfx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.certfx-tags span {
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--cert-soft);
  color: var(--cert-accent);
  font-size: 8px;
  font-weight: 700;
}

.certfx-status {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(135deg, var(--cert-accent), var(--cert-secondary));
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0;
  transform: translateY(100%);
  transition:
    opacity 0.3s ease 0.2s,
    transform 0.4s ease 0.2s,
    filter 0.3s ease;
}

.certfx-card:hover .certfx-status,
.certfx-card:focus-within .certfx-status,
.certfx-card:focus .certfx-status {
  opacity: 1;
  transform: translateY(0);
}

.certfx-status:hover {
  filter: brightness(1.08);
}

.certfx-status svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.certfx-status-dot {
  width: 7px;
  height: 7px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

/* ---- DARK MODE overrides ---- */
[data-theme="dark"] .certificates-section,
body.dark-mode .certificates-section {
  background:
    radial-gradient(circle at 15% 15%, rgba(66, 133, 244, 0.08), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(124, 58, 237, 0.07), transparent 30%),
    #070B14;
}

[data-theme="dark"] .certificates-heading h2,
body.dark-mode .certificates-heading h2 {
  color: #F1F5F9;
}

[data-theme="dark"] .certificates-heading p,
body.dark-mode .certificates-heading p {
  color: #94A3B8;
}

[data-theme="dark"] .certfx-front,
body.dark-mode .certfx-front {
  background: #0E1526;
  border-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .certfx-back,
body.dark-mode .certfx-back {
  background: #111A2E;
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .certfx-card:hover .certfx-front,
[data-theme="dark"] .certfx-card:focus-within .certfx-front,
body.dark-mode .certfx-card:hover .certfx-front,
body.dark-mode .certfx-card:focus-within .certfx-front {
  background: color-mix(in srgb, var(--cert-soft) 15%, #0E1526);
}

[data-theme="dark"] .certfx-main-content h3,
body.dark-mode .certfx-main-content h3 {
  color: #F1F5F9;
}

[data-theme="dark"] .certfx-summary,
body.dark-mode .certfx-summary {
  color: #94A3B8;
}

[data-theme="dark"] .certfx-overview,
body.dark-mode .certfx-overview {
  color: #F1F5F9;
}

[data-theme="dark"] .certfx-overview-item strong,
body.dark-mode .certfx-overview-item strong {
  color: #CBD5E1;
}

[data-theme="dark"] .certfx-detail,
body.dark-mode .certfx-detail {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .certfx-detail strong,
body.dark-mode .certfx-detail strong {
  color: #CBD5E1;
}

[data-theme="dark"] .certfx-skills-title,
body.dark-mode .certfx-skills-title {
  color: #94A3B8;
}

[data-theme="dark"] .certfx-tags span,
body.dark-mode .certfx-tags span {
  background: rgba(255, 255, 255, 0.06);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .certificates-section {
    padding: 65px 16px;
  }

  .certificates-heading {
    margin-bottom: 35px;
  }

  .certificates-grid {
    gap: 25px;
  }

  .certfx-card {
    width: min(100%, 330px);
  }
}

@media (hover: none) {
  .certfx-hover-label span {
    font-size: 0;
  }

  .certfx-hover-label span::before {
    content: "Tap to view details";
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .certfx-front,
  .certfx-back,
  .certfx-decoration,
  .certfx-hover-label,
  .certfx-expanded-content,
  .certfx-status {
    transition: none;
  }
}

/* ============================================================
   CERTIFICATE CARD ANIMATION ONLY
   Preserves the existing certificate design and page structure.
   ============================================================ */

.certfx-card {
  isolation: isolate;
}

.certfx-front {
  transform-origin: center top;
  will-change: transform, box-shadow;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.4s ease,
    box-shadow 0.42s ease;
}

.certfx-back {
  transform-origin: center top;
  will-change: height, box-shadow, border-radius;
  transition:
    height 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.48s ease,
    box-shadow 0.48s ease;
}

.certfx-card:hover .certfx-front,
.certfx-card:focus .certfx-front,
.certfx-card:focus-within .certfx-front {
  transform: translateX(-50%) translateY(-8px) scale(1.01);
}

.certfx-card:hover .certfx-back,
.certfx-card:focus .certfx-back,
.certfx-card:focus-within .certfx-back {
  height: 395px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow:
    0 24px 55px rgba(15, 23, 42, 0.14),
    0 8px 20px rgba(15, 23, 42, 0.06);
}

.certfx-decoration-one {
  will-change: transform;
}

.certfx-card:hover .certfx-decoration-one,
.certfx-card:focus .certfx-decoration-one,
.certfx-card:focus-within .certfx-decoration-one {
  transform: scale(1.18) rotate(8deg);
}

.certfx-decoration-two {
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.certfx-card:hover .certfx-decoration-two,
.certfx-card:focus .certfx-decoration-two,
.certfx-card:focus-within .certfx-decoration-two {
  transform: translate(-8px, -8px) scale(1.12);
}

.certfx-hover-label {
  will-change: opacity, transform;
}

.certfx-card:hover .certfx-hover-label,
.certfx-card:focus .certfx-hover-label,
.certfx-card:focus-within .certfx-hover-label {
  opacity: 0;
  transform: translateY(8px);
}

.certfx-expanded-content {
  will-change: opacity, transform;
  transition:
    opacity 0.34s ease 0.16s,
    transform 0.44s cubic-bezier(0.22, 1, 0.36, 1) 0.16s;
}

.certfx-card:hover .certfx-expanded-content,
.certfx-card:focus .certfx-expanded-content,
.certfx-card:focus-within .certfx-expanded-content {
  opacity: 1;
  transform: translateY(0);
}

.certfx-status {
  will-change: opacity, transform;
  transition:
    opacity 0.32s ease 0.24s,
    transform 0.44s cubic-bezier(0.22, 1, 0.36, 1) 0.24s,
    filter 0.3s ease;
}

.certfx-card:hover .certfx-status,
.certfx-card:focus .certfx-status,
.certfx-card:focus-within .certfx-status {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .certfx-front,
  .certfx-back,
  .certfx-decoration-one,
  .certfx-decoration-two,
  .certfx-hover-label,
  .certfx-expanded-content,
  .certfx-status {
    transition: none !important;
  }
}

/* ============================================================
   CERTFX LOGOS + COMPLETE CONTENT + SLOWER OPENING ANIMATION
   ============================================================ */

/* Display each issuing institution's official website brand mark. */
.certfx-icon {
  width: 52px;
  height: 52px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cert-accent) 22%, transparent);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 24px color-mix(in srgb, var(--cert-accent) 20%, transparent);
}

.certfx-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.certfx-logo-fallback {
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--cert-accent);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.certfx-logo-fallback:not([hidden]) {
  display: grid;
}

/* Give the visible card enough room so titles and descriptions are not cropped. */
.certfx-card {
  height: 500px;
}

.certfx-front {
  height: 245px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.certfx-main-content {
  flex: 1;
  margin-top: 15px;
  padding-bottom: 24px;
}

.certfx-main-content h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.certfx-summary {
  display: block;
  overflow: visible;
  font-size: 12px;
  line-height: 1.58;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.certfx-hover-label {
  bottom: 14px;
}

/* Slower, smoother layered opening. */
.certfx-front,
.certfx-back {
  transition:
    height 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.8s ease,
    box-shadow 0.9s ease,
    border-radius 0.9s ease;
}

.certfx-back {
  height: 220px;
}

.certfx-card:hover .certfx-front,
.certfx-card:focus-within .certfx-front,
.certfx-card:focus .certfx-front {
  transform: translateX(-50%) translateY(-9px);
}

.certfx-card:hover .certfx-back,
.certfx-card:focus-within .certfx-back,
.certfx-card:focus .certfx-back {
  height: 485px;
}

.certfx-decoration {
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.certfx-hover-label {
  transition:
    opacity 0.55s ease,
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.certfx-expanded-content {
  top: 260px;
  opacity: 0;
  transform: translateY(-18px);
  transition:
    opacity 0.65s ease 0.42s,
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.38s;
}

.certfx-status {
  transition:
    opacity 0.55s ease 0.55s,
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.48s,
    filter 0.35s ease;
}

[data-theme="dark"] .certfx-icon,
body.dark-mode .certfx-icon {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 768px) {
  .certfx-card {
    height: 510px;
  }

  .certfx-front {
    height: 255px;
  }

  .certfx-back {
    height: 230px;
  }

  .certfx-card:hover .certfx-back,
  .certfx-card:focus-within .certfx-back,
  .certfx-card:focus .certfx-back {
    height: 495px;
  }

  .certfx-expanded-content {
    top: 270px;
  }
}

/* ============================================================
   CERTIFICATE CONTENT + LOCAL PARTNER LOGO REFINEMENTS
   ============================================================ */

/* Local partner logos are cropped from the supplied certificates. */
.certfx-icon {
  padding: 6px;
  background: #ffffff;
}

.certfx-logo {
  border-radius: 6px;
  object-fit: contain;
}

/* Keep long institution, platform, and credential names fully readable. */
.certfx-detail {
  align-items: flex-start;
}

.certfx-detail strong {
  max-width: 62%;
  overflow: visible;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
}

/* The supplied course titles and details need a little more expansion room. */
.certfx-card {
  height: 535px;
}

.certfx-card:hover .certfx-back,
.certfx-card:focus-within .certfx-back,
.certfx-card:focus .certfx-back {
  height: 520px;
}

.certfx-expanded-content {
  right: 22px;
  left: 22px;
}

.certfx-tags span {
  line-height: 1.25;
}

/* Smooth filtering without leaving animation transforms behind. */
.certfx-card[style*="display: none"] {
  animation: none !important;
}

@media (max-width: 768px) {
  .certfx-card {
    height: 545px;
  }

  .certfx-card:hover .certfx-back,
  .certfx-card:focus-within .certfx-back,
  .certfx-card:focus .certfx-back {
    height: 530px;
  }
}

/* Provider-logo reliability fix */
.certfx-icon {
  display: grid;
  place-items: center;
  background: #ffffff !important;
}

.certfx-logo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* Larger provider logos without visible white image background */
.certfx-icon {
  width: 135px !important;
  height: 55px !important;
  min-width: 135px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
}

.certfx-logo {
  display: block !important;
  width: auto !important;
  height: 45px !important;
  max-width: 135px !important;
  max-height: 50px !important;
  object-fit: contain !important;
  object-position: left center;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  mix-blend-mode: multiply;
}
/* Remove empty vertical space between closed card rows */
.certificates-grid,
.cr-cards-grid {
  row-gap: 90px !important;
  align-items: start;
}

.certfx-card {
  height: 180px;
  position: relative;
  z-index: 1;
  transform: translateY(0);
  transform-origin: center;
  transition:
    height 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.certfx-card:hover,
.certfx-card:focus,
.certfx-card:focus-within {
  height: 410px;
  transform: translateY(-115px);
  z-index: 20;
}

/* ============================================================
   FINAL FIX: EXPAND EQUALLY UPWARD AND DOWNWARD
   Keeps row-gap: 90px !important unchanged.
   ============================================================ */

.certificates-grid,
.cr-cards-grid {
  row-gap: 90px !important;
  align-items: start;
  overflow: visible;
}

.certificates-section,
.certificates-container {
  overflow: visible;
}

/* Keep the grid item's closed height fixed to avoid blank space below it. */
.certfx-card {
  height: 245px !important;
  position: relative;
  z-index: 1;
  overflow: visible;
}

/* Do not increase the grid-row height on hover. */
.certfx-card:hover,
.certfx-card:focus,
.certfx-card:focus-within {
  height: 245px !important;
  z-index: 50;
}

/* Closed front position. */
.certfx-front {
  top: 0 !important;
  height: 245px !important;
  transform: translateX(-50%) translateY(0) !important;
  transition:
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.8s ease,
    box-shadow 0.9s ease,
    border-radius 0.9s ease;
}

/* Closed back is vertically centred behind the 245px front. */
.certfx-back {
  top: 12.5px !important;
  height: 220px !important;
  transform: translateX(-50%) !important;
  transform-origin: center center;
  transition:
    top 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    height 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.9s ease,
    border-radius 0.9s ease;
}

/*
  Expanded height: 520px
  Closed height: 245px
  Equal movement on each side: 137.5px
*/
.certfx-card:hover .certfx-front,
.certfx-card:focus .certfx-front,
.certfx-card:focus-within .certfx-front {
  transform: translateX(-50%) translateY(-137.5px) !important;
}

.certfx-card:hover .certfx-back,
.certfx-card:focus .certfx-back,
.certfx-card:focus-within .certfx-back {
  top: -137.5px !important;
  height: 520px !important;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

/* Mobile dimensions: 530px expanded from 255px closed = 137.5px each side. */
@media (max-width: 768px) {
  .certfx-card,
  .certfx-card:hover,
  .certfx-card:focus,
  .certfx-card:focus-within {
    height: 255px !important;
  }

  .certfx-front {
    height: 255px !important;
  }

  .certfx-back {
    top: 12.5px !important;
    height: 230px !important;
  }

  .certfx-card:hover .certfx-front,
  .certfx-card:focus .certfx-front,
  .certfx-card:focus-within .certfx-front {
    transform: translateX(-50%) translateY(-137.5px) !important;
  }

  .certfx-card:hover .certfx-back,
  .certfx-card:focus .certfx-back,
  .certfx-card:focus-within .certfx-back {
    top: -137.5px !important;
    height: 530px !important;
  }
}