/* ============================================================
   certificate.css — Shareable certificate styles
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.cert-hero {
  padding: 24px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(236,72,153,.08));
  border-left: 4px solid #F59E0B;
}
.cert-hero h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}
.cert-hero p {
  margin: 0 0 14px;
  color: var(--text2);
  font-size: .95rem;
}
.cert-hero strong {
  color: var(--text);
}
.cert-stats {
  display: flex;
  gap: 24px;
}
.cert-stat {
  display: flex;
  flex-direction: column;
}
.cert-stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #F59E0B;
  line-height: 1;
}
.cert-stat-label {
  font-size: .8rem;
  color: var(--text2);
  margin-top: 4px;
}

/* ── Empty state ───────────────────────────────────────── */
.cert-empty {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 16px;
}
.cert-empty-icon {
  font-size: 4rem;
  margin-bottom: 10px;
  opacity: .6;
}
.cert-empty h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.cert-empty p {
  margin: 0 0 18px;
  color: var(--text2);
}
.cert-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.cert-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37,99,235,.3);
}

/* ── Grid ─────────────────────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.cert-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 18px 18px;
  text-align: center;
  transition: all .25s;
  overflow: hidden;
}
.cert-unlocked {
  cursor: pointer;
  border-color: var(--cert-color, var(--accent));
}
.cert-unlocked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--cert-color, var(--accent));
}
.cert-unlocked:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.cert-locked {
  opacity: .55;
  filter: grayscale(.5);
}
.cert-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--cert-color, var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.cert-card-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
.cert-card h3 {
  margin: 0 0 2px;
  font-size: 1.1rem;
}
.cert-card-th {
  color: var(--text2);
  font-size: .82rem;
  margin-bottom: 8px;
}
.cert-card-tagline {
  margin: 0 0 12px;
  color: var(--text2);
  font-size: .82rem;
  line-height: 1.4;
  min-height: 36px;
}
.cert-view-btn {
  width: 100%;
  padding: 8px 14px;
  background: var(--cert-color, var(--accent));
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}
.cert-req {
  display: block;
  color: var(--text3);
  font-size: .75rem;
  font-style: italic;
}

/* ── Preview modal-ish card ──────────────────────────── */
.cert-preview {
  position: relative;
  padding: 24px;
  margin-top: 16px;
}
.cert-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.cert-close:hover {
  background: var(--bg3);
}
.cert-preview h3 {
  margin: 0 0 16px;
  padding-right: 50px;
}
.cert-canvas-wrap {
  background: #F8FAFC;
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
}
#cert-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  border-radius: 4px;
  background: #fff;
}
.cert-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cert-btn {
  padding: 10px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s;
}
.cert-btn:hover {
  background: var(--bg3);
}
.cert-btn-primary {
  background: var(--brand-grad);
  color: #fff;
  border-color: transparent;
}
.cert-btn-primary:hover {
  background: var(--brand-grad);
  filter: brightness(1.05);
}

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .cert-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cert-stats {
    gap: 16px;
  }
  .cert-stat-value {
    font-size: 1.8rem;
  }
  .cert-actions {
    flex-direction: column;
  }
  .cert-btn {
    width: 100%;
  }
}
