/* ==========================================================================
   Linus LetterPro - Real Printable Completion Certificate Styles
   ========================================================================== */

#certificate-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 200;
}

#certificate-modal.active {
  display: flex;
}

.certificate-backdrop {
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.certificate-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1050px;
}

.certificate-action-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* The Printable Certificate Sheet (Optimized for 4:3 / Landscape Print) */
.certificate-sheet {
  width: 100%;
  max-width: 980px;
  background: linear-gradient(135deg, #FFFDF5 0%, #FEF9C3 100%);
  color: #1E293B;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  padding: 16px;
  position: relative;
  font-family: Georgia, 'Times New Roman', serif;
}

.cert-border-outer {
  border: 10px solid #D97706;
  border-radius: 8px;
  padding: 8px;
  background: transparent;
}

.cert-border-inner {
  border: 3px double #B45309;
  border-radius: 4px;
  padding: 32px 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Corner Filigrees */
.cert-corner {
  position: absolute;
  font-size: 24px;
  color: #D97706;
}

.cert-corner.top-left { top: 8px; left: 10px; }
.cert-corner.top-right { top: 8px; right: 10px; }
.cert-corner.bottom-left { bottom: 8px; left: 10px; }
.cert-corner.bottom-right { bottom: 8px; right: 10px; }

/* Header */
.cert-academy-logo {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #B45309;
  margin-bottom: 8px;
}

.cert-main-title {
  font-size: 42px;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.cert-subtitle {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #64748B;
  margin-bottom: 24px;
}

/* Body */
.cert-presented-text {
  font-size: 16px;
  font-style: italic;
  color: #475569;
  margin-bottom: 12px;
}

.cert-student-name-box {
  width: 80%;
  border-bottom: 3px solid #F59E0B;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.cert-student-name {
  font-family: 'Brush Script MT', 'Segoe Script', cursive, serif;
  font-size: 52px;
  font-weight: 800;
  color: #1E3A8A;
}

.cert-description {
  font-size: 16px;
  line-height: 1.6;
  max-width: 720px;
  color: #334155;
  margin-bottom: 24px;
}

/* Honors Badges */
.cert-honors-row {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-bottom: 28px;
}

.cert-honor-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 8px 18px;
}

.cert-honor-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #92400E;
  letter-spacing: 1px;
}

.cert-honor-value {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #1E293B;
  margin-top: 2px;
}

/* Footer with Signatures & Gold Foil Seal */
.cert-footer {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 10px;
}

.cert-sig-block {
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cert-sig-line {
  width: 100%;
  border-bottom: 2px solid #64748B;
  margin-bottom: 6px;
}

.cert-sig-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #64748B;
  font-weight: 600;
}

/* 3D Embossed Gold Foil Seal */
.cert-gold-seal {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal-circle {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FDE047 0%, #D97706 70%, #92400E 100%);
  border: 3px dashed #78350F;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.seal-inner-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seal-icon {
  font-size: 24px;
}

.seal-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #78350F;
}

.seal-ribbon {
  position: absolute;
  bottom: -14px;
  width: 24px;
  height: 38px;
  background: #DC2626;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
  z-index: 1;
}

.seal-ribbon.left {
  left: 20px;
  transform: rotate(15deg);
}

.seal-ribbon.right {
  right: 20px;
  transform: rotate(-15deg);
}

/* ==========================================================================
   Clean Printing Rules (window.print())
   Prints ONLY the certificate sheet full-page landscape, hides all UI
   ========================================================================== */

@media print {
  @page {
    size: landscape;
    margin: 0;
  }

  body, html {
    background: white !important;
    overflow: visible !important;
  }

  #app-container,
  .no-print,
  .certificate-action-bar {
    display: none !important;
  }

  #certificate-modal {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: none !important;
  }

  .certificate-backdrop {
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .certificate-dialog {
    max-width: 100% !important;
  }

  .certificate-sheet {
    max-width: 100% !important;
    width: 100vw !important;
    height: 100vh !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 20px !important;
    page-break-after: avoid;
    page-break-inside: avoid;
  }
}
