/* ==========================================================================
   Certificates & Badges - Train & Hire
   Dashboard certificate views (dash-cert-) and public verification (cert-)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Dashboard Certificate Grid
   -------------------------------------------------------------------------- */

.dash-cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* --------------------------------------------------------------------------
   Dashboard Certificate Card
   -------------------------------------------------------------------------- */

.dash-cert-card {
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.22s ease;
  animation: fadeSlideIn 0.25s ease-out both;
  position: relative;
}

.dash-cert-card:hover {
  box-shadow: var(--th-shadow-hover);
  transform: translateY(-2px);
}

/* Top accent stripe per type */
.dash-cert-card::before {
  content: '';
  display: block;
  height: 4px;
}

.dash-cert-card-completion::before {
  background: linear-gradient(90deg, #b45309, #d97706, #f59e0b);
}

.dash-cert-card-verification::before {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa);
}

.dash-cert-card-inner {
  padding: 1.25rem 1.35rem 1.15rem;
}

/* Card header: icon + type badge */
.dash-cert-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.dash-cert-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-cert-card-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.75;
  fill: none;
  stroke: currentColor;
}

.dash-cert-card-completion .dash-cert-card-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.dash-cert-card-verification .dash-cert-card-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

/* Type badge */
.dash-cert-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dash-cert-type-badge svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.dash-cert-type-completion {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.dash-cert-type-verification {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

/* Card body: skill name + meta */
.dash-cert-card-skill {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.025em;
  margin-bottom: 0.55rem;
  line-height: 1.25;
}

.dash-cert-card-skill a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.dash-cert-card-skill a:hover {
  color: var(--th-accent);
}

.dash-cert-card-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.dash-cert-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--th-text-secondary);
  font-weight: 500;
}

.dash-cert-card-meta-item svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  opacity: 0.65;
}

.dash-cert-card-score {
  font-weight: 700;
  color: #1e40af;
}

/* Card actions: download + share */
.dash-cert-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--th-border-light);
}

.dash-cert-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--th-font);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 7px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.dash-cert-action-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.dash-cert-action-download {
  background: var(--th-accent);
  color: #fff;
  border-color: var(--th-accent);
}

.dash-cert-action-download:hover {
  background: var(--th-accent-hover);
  border-color: var(--th-accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(13, 110, 253, 0.2);
}

.dash-cert-action-share {
  background: #fff;
  color: var(--th-text-secondary);
  border-color: var(--th-border);
}

.dash-cert-action-share:hover {
  background: #f9fafb;
  color: var(--th-text);
  border-color: #d1d5db;
}

/* --------------------------------------------------------------------------
   Dashboard Certificate Detail (Show)
   -------------------------------------------------------------------------- */

.dash-cert-detail {
  max-width: 720px;
}

.dash-cert-detail-card {
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 12px;
  overflow: hidden;
  animation: fadeSlideIn 0.25s ease-out;
}

/* Decorative header band */
.dash-cert-detail-banner {
  padding: 2rem 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.dash-cert-detail-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      currentColor 10px,
      currentColor 11px
    );
  pointer-events: none;
}

.dash-cert-detail-banner-completion {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
}

.dash-cert-detail-banner-verification {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
}

.dash-cert-detail-banner-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  position: relative;
}

.dash-cert-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-cert-detail-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

.dash-cert-detail-banner-completion .dash-cert-detail-icon {
  background: rgba(180, 83, 9, 0.1);
}

.dash-cert-detail-banner-verification .dash-cert-detail-icon {
  background: rgba(29, 78, 216, 0.1);
}

.dash-cert-detail-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.dash-cert-detail-skill {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  position: relative;
}

.dash-cert-detail-banner-completion .dash-cert-detail-skill { color: #78350f; }
.dash-cert-detail-banner-verification .dash-cert-detail-skill { color: #1e3a8a; }

/* Detail body */
.dash-cert-detail-body {
  padding: 1.5rem 2rem 2rem;
}

.dash-cert-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--th-border-light);
  font-size: 0.85rem;
}

.dash-cert-detail-row:last-child {
  border-bottom: none;
}

.dash-cert-detail-label {
  color: var(--th-text-muted);
  font-weight: 500;
}

.dash-cert-detail-value {
  color: var(--th-text);
  font-weight: 600;
  text-align: right;
}

/* Download section */
.dash-cert-download-section {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--th-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Share section */
.dash-cert-share-section {
  background: var(--th-bg-card);
  border: 1.5px solid var(--th-border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-top: 1.25rem;
  animation: fadeSlideIn 0.3s ease-out 0.05s both;
}

.dash-cert-share-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--th-text-secondary);
  margin-bottom: 0.75rem;
}

.dash-cert-share-desc {
  font-size: 0.82rem;
  color: var(--th-text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.dash-cert-share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-cert-share-url {
  flex: 1;
  font-family: var(--th-font);
  font-size: 0.8rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--th-border);
  border-radius: 8px;
  background: var(--th-bg-subtle);
  color: var(--th-text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-cert-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--th-font);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--th-accent);
  background: var(--th-accent);
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.dash-cert-copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.dash-cert-copy-btn:hover {
  background: var(--th-accent-hover);
  border-color: var(--th-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(13, 110, 253, 0.2);
}

.dash-cert-copy-btn[data-copied="true"] {
  background: #059669;
  border-color: #059669;
}

.dash-cert-share-feedback {
  font-size: 0.75rem;
  font-weight: 600;
  color: #059669;
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dash-cert-share-feedback.visible {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Dashboard Certificate Empty State
   -------------------------------------------------------------------------- */

.dash-cert-empty {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeSlideIn 0.25s ease-out;
}

.dash-cert-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-cert-empty-icon svg {
  width: 30px;
  height: 30px;
  stroke: #b45309;
  stroke-width: 1.5;
  fill: none;
}

.dash-cert-empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--th-text);
  margin-bottom: 0.35rem;
}

.dash-cert-empty-text {
  font-size: 0.85rem;
  color: var(--th-text-secondary);
  max-width: 420px;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Public Verification Page (cert- prefix)
   -------------------------------------------------------------------------- */

.cert-verify-page {
  max-width: 620px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
  animation: fadeSlideIn 0.35s ease-out;
}

.cert-verify-card {
  background: #fff;
  border: 1.5px solid var(--th-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Verification header with seal */
.cert-verify-header {
  padding: 2.5rem 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cert-verify-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 12px,
      currentColor 12px,
      currentColor 13px
    );
  pointer-events: none;
}

.cert-verify-header-completion {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
}

.cert-verify-header-verification {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
}

/* Shield / seal icon */
.cert-verify-seal {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cert-verify-seal::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dashed currentColor;
  opacity: 0.2;
}

.cert-verify-seal svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.cert-verify-header-completion .cert-verify-seal {
  background: rgba(180, 83, 9, 0.1);
}

.cert-verify-header-verification .cert-verify-seal {
  background: rgba(29, 78, 216, 0.1);
}

.cert-verify-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.cert-verify-status svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.cert-verify-header-completion .cert-verify-status {
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
}

.cert-verify-header-verification .cert-verify-status {
  background: rgba(29, 78, 216, 0.12);
  color: #1e40af;
}

.cert-verify-title {
  font-family: var(--th-font);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  position: relative;
}

.cert-verify-header-completion .cert-verify-title { color: #78350f; }
.cert-verify-header-verification .cert-verify-title { color: #1e3a8a; }

/* Verification body */
.cert-verify-body {
  padding: 2rem 2.5rem 2.5rem;
}

.cert-verify-recipient {
  text-align: center;
  margin-bottom: 2rem;
}

.cert-verify-recipient-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--th-text-muted);
  margin-bottom: 0.3rem;
}

.cert-verify-recipient-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.03em;
}

.cert-verify-description {
  font-size: 0.92rem;
  color: var(--th-text-secondary);
  line-height: 1.7;
  text-align: center;
  margin-bottom: 2rem;
}

/* Detail rows */
.cert-verify-details {
  border-top: 1px solid var(--th-border-light);
  padding-top: 1.5rem;
}

.cert-verify-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  font-size: 0.85rem;
}

.cert-verify-detail-label {
  color: var(--th-text-muted);
  font-weight: 500;
}

.cert-verify-detail-value {
  color: var(--th-text);
  font-weight: 600;
}

/* Footer/note */
.cert-verify-footer {
  padding: 1.25rem 2.5rem;
  border-top: 1px solid var(--th-border-light);
  text-align: center;
}

.cert-verify-issuer {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--th-text);
  margin-bottom: 0.5rem;
}

.cert-verify-note {
  font-size: 0.75rem;
  color: var(--th-text-muted);
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Public Verification - Not Found State
   -------------------------------------------------------------------------- */

.cert-verify-not-found {
  text-align: center;
  padding: 3rem 2rem;
}

.cert-verify-not-found-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-verify-not-found-icon svg {
  width: 30px;
  height: 30px;
  stroke: #dc2626;
  stroke-width: 1.5;
  fill: none;
}

.cert-verify-not-found-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--th-text);
  margin-bottom: 0.5rem;
}

.cert-verify-not-found-text {
  font-size: 0.88rem;
  color: var(--th-text-secondary);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .dash-cert-grid {
    grid-template-columns: 1fr;
  }

  .dash-cert-detail-banner,
  .dash-cert-detail-body,
  .dash-cert-download-section,
  .dash-cert-share-section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .cert-verify-header,
  .cert-verify-body,
  .cert-verify-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .dash-cert-share-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-cert-detail-skill {
    font-size: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .dash-cert-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-cert-action-btn {
    justify-content: center;
  }
}
