/* ==========================================================================
   CERTIFICATE VERIFICATION PORTAL STYLESHEET (css/verification.css)
   Dedicated styles for CACTS Certificate Verification Portal (verify.html)
   ========================================================================== */

/* Responsive Certificate Viewport */
.certificate-viewport {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 0;
  overflow: visible;
  min-height: 0;
}

/* ==========================================================================
   PRINT-READY CERTIFICATE CANVAS: Fixed A4 Landscape (1050px x 742px)
   Padded & Compacted to ensure ZERO bottom clipping in PDF/Print
   ========================================================================== */
#certificateCanvas {
  width: 1050px;
  height: 742px;
  background-color: #ffffff !important;
  color: #0a192f !important;
  position: relative;
  padding: 14px;
  box-sizing: border-box;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  margin: 0 auto;
  flex-shrink: 0;

  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}

/* Background Cryptographic Security Watermark */
.cert-security-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-family: 'Cinzel', serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: rgba(10, 25, 47, 0.035);
  text-transform: uppercase;
  letter-spacing: 6px;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* Metallic Gold Foil Seal Badge - Doubled Size (120px x 120px) */
.gold-foil-seal-badge {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, #ffe082 0%, #d4af37 40%, #aa771c 80%, #bf953f 100%);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(170, 119, 28, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  border: 3px solid #ffffff;
}

.gold-foil-seal-inner {
  width: 98px;
  height: 98px;
  border: 2px dashed #0a192f;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #0a192f;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.25;
}

/* Left CACTS Logo Badge - Matched 120px Scale Parallel to Seal */
.cert-logo-left-badge {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 120px;
  height: 120px;
  background: #ffffff;
  border-radius: 50%;
  border: 2px solid #bf953f;
  box-shadow: 0 4px 14px rgba(10, 25, 47, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  padding: 12px;
  box-sizing: border-box;
}

.cert-logo-left-badge img {
  max-width: 96px;
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Multi-layered Outer Frame incorporating CACTS Brand Palette */
.cert-frame-outer {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 3px solid #bf953f;
  pointer-events: none;
}

.cert-frame-middle {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border: 1px solid #e11d48;
  pointer-events: none;
}

.cert-frame-inner {
  position: absolute;
  top: 19px;
  left: 19px;
  right: 19px;
  bottom: 19px;
  border: 1.5px solid #0a192f;
  pointer-events: none;
}

/* Corner Vector Ornaments */
.corner-svg {
  position: absolute;
  width: 38px;
  height: 38px;
  color: #bf953f;
  pointer-events: none;
}

.corner-tl {
  top: 21px;
  left: 21px;
}

.corner-tr {
  top: 21px;
  right: 21px;
  transform: scaleX(-1);
}

.corner-bl {
  bottom: 21px;
  left: 21px;
  transform: scaleY(-1);
}

.corner-br {
  bottom: 21px;
  right: 21px;
  transform: scale(-1);
}

.cert-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 20px;
  text-align: center;
  box-sizing: border-box;
}

/* Header Section - Height-Matched 110px Block Centered Between 120px Badges */
.cert-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 0 135px;
  margin-bottom: 2px;
}

.cert-header-tag {
  font-size: 0.6rem;
  font-weight: 800;
  color: #bf953f;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cert-institute-name {
  font-family: 'Cinzel', serif;
  font-size: 1.22rem;
  font-weight: 800;
  color: #0a192f;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 5px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.cert-institute-sub {
  font-size: 0.7rem;
  font-weight: 800;
  color: #e11d48;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

/* Main Title Section */
.cert-title-container {
  margin: 2px 0;
}

.cert-main-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0a192f !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cert-divider-line {
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e11d48, #bf953f, transparent);
  margin: 2px auto;
}

/* Body Section */
.cert-body {
  margin: 4px 0;
  padding: 2px 0;
}

.cert-lead-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.cert-student-name {
  font-family: 'Alex Brush', cursive;
  font-size: 3.2rem;
  color: #0a192f;
  margin: 0;
  line-height: 1.05;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.cert-wording {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.45;
  max-width: 820px;
  margin: 4px auto 6px auto;
}

.cert-course-name {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0a192f;
  letter-spacing: 2px;
  line-height: 1.35;
  margin: 8px 0 8px 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.cert-meta-details {
  font-size: 0.78rem;
  font-weight: 700;
  color: #aa771c;
  letter-spacing: 1px;
  margin-top: 2px;
  margin-bottom: 4px;
}

/* Compliance Strip */
.cert-standards-strip {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 2px 0;
  font-size: 0.6rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cert-standard-tag {
  padding: 1px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
}

/* Footer Row 5-Column Alignment - 88px Core Height */
.cert-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(10, 25, 47, 0.12);
  width: 100%;
  min-height: 88px;
}

.qr-item-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 76px;
  height: 88px;
}

.qr-code-box {
  width: 76px;
  height: 76px;
  background: #ffffff;
  padding: 2px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.qr-code-box canvas,
.qr-code-box img {
  width: 70px !important;
  height: 70px !important;
  image-rendering: pixelated;
}

.seal-center-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin: 0 2px;
  height: 88px;
}

.seal-svg-img {
  width: 76px;
  height: 76px;
}

.sig-item-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 165px;
  height: 88px;
  white-space: nowrap;
}

.sig-handwritten {
  font-family: 'Dancing Script', cursive;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0a192f;
  margin-bottom: 2px;
  line-height: 1;
  white-space: nowrap;
}

.sig-handwritten-director {
  font-family: 'Sacramento', cursive;
  font-size: 1.8rem;
  font-weight: 700;
  color: #0a192f;
  margin-bottom: 2px;
  line-height: 1;
  white-space: nowrap;
}

.sig-rule {
  width: 145px;
  height: 1.5px;
  background-color: #0a192f;
  margin-top: 1px;
  margin-bottom: 4px;
}

.sig-name-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0a192f;
  margin-bottom: 3px;
  line-height: 1.2;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.sig-title-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Bottom Credentials Footer Bar */
.cert-credentials-footer {
  font-size: 0.62rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px dashed rgba(10, 25, 47, 0.15);
}

.cert-status-badge {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cert-status-badge.valid {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid #10b981;
}

.cert-status-badge.expired {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid #f59e0b;
}

.cert-status-badge.revoked {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid #ef4444;
}

/* Interactive Skills & Project Breakdown Section */
.breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 850px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.skill-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.skill-badge {
  background: rgba(191, 149, 63, 0.1);
  border: 1px solid rgba(191, 149, 63, 0.3);
  color: var(--accent-light);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.project-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  transition: var(--transition);
}

.project-card-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hash-box-code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}

/* Light Theme Overrides for Breakdown Section */
body.light-theme .project-card-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body.light-theme .project-card-title span,
body.light-theme .breakdown-card h3,
body.light-theme .error-display-card h2 {
  color: #0f172a !important;
}

body.light-theme .hash-box-code {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #475569;
}

body.light-theme .skill-badge {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.3);
  color: #0f766e;
}

/* Strict A4 Landscape Native Print Styles */
@page {
  size: A4 landscape;
  margin: 0;
}

@media print {
  html,
  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .site-header,
  footer.site-footer,
  .control-panel-card,
  .status-alert,
  nav[aria-label="Breadcrumb"],
  .floating-ctas,
  #breakdownSection,
  #toastNotification {
    display: none !important;
  }

  main,
  section.tech-section,
  .certificate-viewport {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }

  #certificateCanvas {
    box-shadow: none !important;
    margin: auto !important;
    padding: 14px !important;
    transform: scale(1) !important;
    width: 1050px !important;
    height: 742px !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    box-sizing: border-box !important;
  }
}
