/* ============================================================
   Shared styles for the Certificate UI (verification + certificate)
   Replicates the Hero Vired / GiveMyCertificate look.
   ============================================================ */

:root {
  --bg: #f7fafc;              /* light blue-gray page background */
  --card-bg: #ffffff;
  --border: #e2e8f0;          /* chakra gray.200 */
  --text: #1a202c;           /* chakra gray.800 */
  --text-muted: #4a5568;     /* chakra gray.600 */
  --text-faint: #718096;     /* chakra gray.500 */
  --red: #e11d2a;            /* Hero Vired red */
  --red-600: #c81e1e;
  --teal: #2c9d8f;           /* verified badge */
  --blue: #3182ce;
  --green: #38a169;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.05);
}

/* ---------- Dark theme ---------- */
body.dark {
  --bg: #0f151d;             /* deep slate page background */
  --card-bg: #1a212b;        /* elevated surface */
  --border: #2d3748;         /* chakra gray.700 */
  --text: #edf2f7;           /* chakra gray.100 */
  --text-muted: #a0aec0;     /* chakra gray.400 */
  --text-faint: #718096;     /* chakra gray.500 */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 28px rgba(0, 0, 0, 0.45);
}
/* Nav wordmark has dark text — render it white on the dark bar */
body.dark .navbar .brand img { filter: brightness(0) invert(1); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Ubuntu", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top navigation bar ---------- */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.navbar .brand img {
  height: 30px;
  display: block;
}

/* Small square "V" logo used in card headers */
.org-logo { height: 30px; width: auto; display: block; }
.issued-by .org-logo { height: 24px; }

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  padding: 6px;
  line-height: 1;
  border-radius: 6px;
}
.theme-toggle:hover { background: var(--bg); }

/* ---------- Layout containers ---------- */
.page {
  padding: 28px 16px 60px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============================================================
   VERIFICATION PAGE
   ============================================================ */
.verify-card {
  max-width: 1080px;
  min-height: 78vh;
  margin: 0 auto;
  padding: 44px 48px;
}

.verify-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.org {
  display: flex;
  align-items: center;
  gap: 12px;
}
.org .org-mark {
  color: var(--red);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}
.org .org-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.verified-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--teal);
  font-size: 12px;
  flex-shrink: 0;
}
.verified-badge .badge-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.verified-badge .verified-gif {
  width: 70px;
  height: auto;
  display: block;
  border-radius: 8px;
}
/* GIF has an opaque white background — make it a tidy chip on dark */
body.dark .verified-badge .verified-gif {
  padding: 6px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

/* Body: certificate thumbnail + metadata grid */
.verify-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

.cert-thumb {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
}
.cert-thumb img,
.cert-thumb canvas { width: 100%; height: 100%; object-fit: contain; }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.meta-field .meta-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.meta-field .meta-label .icon { font-size: 15px; line-height: 1; }
.meta-field .meta-value {
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

/* Start / End date row */
.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 28px;
}

/* Footer: follow us */
.follow {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.follow .follow-label {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}
.social-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.social {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
}
.social.facebook  { background: #1877f2; }
.social.twitter   { background: #1da1f2; }
.social.linkedin  { background: #0a66c2; }
.social.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #bc1888); }

/* ============================================================
   CERTIFICATE PAGE
   ============================================================ */
.cert-layout {
  max-width: 1240px;
  min-height: 78vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  align-items: start;
}

.cert-stage {
  display: flex;
  justify-content: center;
}
.cert-stage img,
.cert-stage canvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
/* placeholder frame when no image */
.cert-placeholder {
  width: 100%;
  aspect-ratio: 1.5 / 1;
  border: 1px solid var(--border);
  border-left: 5px solid var(--red);
  border-radius: 4px;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 14px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px 18px 20px;
}
.sidebar h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
}
.sidebar .section + .section { margin-top: 18px; }

.issued-by {
  display: flex;
  align-items: center;
  gap: 10px;
}
.issued-by .org-mark { color: var(--red); font-weight: 700; font-size: 20px; }
.issued-by .issued-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }

.sub-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--card-bg);
  margin-bottom: 8px;
  font-family: inherit;
}
.btn .btn-icon { font-size: 14px; }
.btn.outline-blue  { color: var(--blue);  border-color: var(--blue); }
.btn.outline-red   { color: var(--red);   border-color: var(--red); }
.btn.outline-green { color: var(--green); border-color: var(--green); }
.btn.solid-blue    { color: #fff; background: #0a66c2; border-color: #0a66c2; }
.btn:hover { filter: brightness(0.97); }

.share-row {
  display: flex;
  gap: 8px;
}
.share-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}
.share-icon.fb    { background: #1877f2; }
.share-icon.li    { background: #0a66c2; }
.share-icon.more  { background: #38a169; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .verify-body { grid-template-columns: 1fr; gap: 24px; }
  .cert-thumb { max-width: 320px; margin: 0 auto; }
  .date-row { grid-template-columns: 1fr; gap: 20px; }
  .cert-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}
