/* --- Layout --- */
.sc-certificate-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 12px 32px 12px;
  min-height: 60vh;
  box-sizing: border-box;
}
.sc-certificate-col-left {
  flex: 1 1 700px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sc-certificate-col-right {
  flex: 0 0 260px;
  min-width: 220px;
  max-width: 320px;
  position: sticky;
  top: 40px;
  align-self: flex-start;
  z-index: 2;
  background: transparent;
}
@media (max-width: 1000px) {
  .sc-certificate-layout {
    flex-direction: column;
    gap: 24px;
    padding: 18px 2vw 18px 2vw;
  }
  .sc-certificate-col-right {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 24px;
  }
}

/* --- Certificate Card --- */
.sc-certificate-paper {
  background: #fff;
  border: 2px solid #0D3C72;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 850px;
  min-width: 320px;
  aspect-ratio: 1122/793;
  min-height: 520px;
  margin: 0 auto;
  padding: 40px 60px 120px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  justify-content: flex-start;
  box-sizing: border-box;
  letter-spacing: 0.3px;
}

.sc-cert-heading {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0D3C72;
  margin-bottom: 8px;
}
.sc-cert-name {
  font-size: 32px;
  font-weight: 700;
  color: #0D3C72;
  margin: 18px 0 8px 0;
  text-align: center;
  letter-spacing: 0.3px;
}
.sc-cert-title, .sc-cert-score, .sc-cert-date, .sc-cert-id {
  font-size: 16px;
}

.sc-cert-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 60px 40px 60px;
  min-height: 90px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
}
.sc-cert-footer > * {
  pointer-events: auto;
}
.sc-cert-qr {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
}
.sc-cert-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  text-align: right;
}
.sc-cert-signature img {
  max-width: 120px;
  max-height: 40px;
  margin-bottom: 4px;
}
.sc-cert-sign-meta {
  margin-top: 2px;
}
.sc-cert-sign-name {
  font-weight: 600;
  color: #0D3C72;
  font-size: 15px;
}
.sc-cert-sign-title {
  font-size: 13px;
  color: #666;
}
@media (max-width: 900px) {
  .sc-certificate-paper {
    padding-left: 4vw;
    padding-right: 4vw;
  }
  .sc-cert-footer {
    padding-left: 4vw;
    padding-right: 4vw;
  }
}
@media (max-width: 700px) {
  .sc-certificate-paper {
    padding-left: 2vw;
    padding-right: 2vw;
    padding-bottom: 150px;
  }
  .sc-cert-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 0 2vw 24px 2vw;
    min-height: 0;
  }
  .sc-cert-signature {
    align-items: flex-start;
    margin-left: 0;
    text-align: left;
  }
  .sc-cert-qrbox {
    margin-bottom: 10px;
    width: 100%;
    justify-content: flex-start;
  }
}
@media print {
  .sc-cert-footer {
    padding: 0 80px 40px 80px !important;
  }
  .sc-cert-qrbox {
    width: 120px !important;
    height: 120px !important;
  }
  .sc-cert-qr {
    width: 96px !important;
    height: 96px !important;
  }
}

@media (max-width: 1000px) {
  .sc-certificate-paper {
    max-width: 98vw;
    padding: 24px 4vw;
  }
}
@media (max-width: 700px) {
  .sc-certificate-paper {
    padding: 12px 2vw;
    min-width: 0;
    font-size: 0.97em;
    aspect-ratio: unset;
  }
}
@media print {
  body, html {
    background: #fff !important;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
  }
  body * {
    visibility: hidden !important;
  }
  .sc-certificate-paper, .sc-certificate-paper * {
    visibility: visible !important;
  }
  .sc-certificate-layout, .sc-certificate-col-left, .sc-certificate-paper {
    width: 1122px !important;
    height: 793px !important;
    max-width: 1122px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 2.5px solid #093C72 !important;
    padding: 0 !important;
    aspect-ratio: unset !important;
    position: relative !important;
    page-break-after: avoid;
  }
  .sc-certificate-actions, .sc-certificate-col-right, header, footer, .site-header, .site-footer {
    display: none !important;
    visibility: hidden !important;
  }
}
footer, .site-footer {
  display: block !important;
  position: static !important;
  width: 100% !important;
  margin: 0 auto !important;
}

@media (max-width: 700px) {
  .sc-certificate-paper {
    padding: 18px 2vw 18px 2vw;
    min-width: 0;
    font-size: 0.97em;
    aspect-ratio: unset;
  }
}

.sc-cert-logo img {
  max-width: 120px;
  max-height: 80px;
  margin: 0 auto 18px auto;
  display: block;
}
.sc-cert-heading {
  font-family: 'Merriweather', serif;
  font-size: 2.1em;
  color: #093C72;
  margin-bottom: 0.3em;
  font-weight: 700;
}
.sc-cert-brand {
  color: #093C72;
  font-weight: 600;
  font-size: 1.15em;
  margin-bottom: 18px;
}
.sc-cert-name {
  font-family: 'Merriweather', serif;
  font-size: 2.2em;
  font-weight: 700;
  color: #093C72;
  margin: 18px 0 4px 0;
  text-align: center;
}
.sc-cert-email {
  font-size: 1em;
  color: #444;
  margin-bottom: 14px;
}
.sc-cert-title {
  font-size: 1.2em;
  margin: 12px 0 6px 0;
  color: #093C72;
  font-weight: 600;
}
.sc-cert-score {
  font-size: 1.15em;
  margin: 12px 0 6px 0;
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sc-cert-badge svg {
  vertical-align: middle;
  margin-right: 3px;
}
.sc-cert-date {
  font-size: 1em;
  color: #666;
  margin-bottom: 10px;
}
.sc-cert-id {
  font-size: 0.97em;
  color: #888;
  margin-bottom: 10px;
}
.sc-cert-footer {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 32px 24px 32px;
  min-height: 80px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
}
.sc-cert-footer > * {
  pointer-events: auto;
}
.sc-cert-qr {
  width: 74px;
  height: 74px;
  min-width: 74px;
  min-height: 74px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid #093C72;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(9,60,114,0.08);
}
.sc-cert-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  margin-left: auto;
}
@media (max-width: 700px) {
  .sc-cert-signature {
    align-items: flex-start;
    margin-left: 0;
  }
}
@media (max-width: 700px) {
  .sc-cert-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 0 8vw 16px 8vw;
  }
  .sc-certificate-paper {
    padding-bottom: 150px;
  }
  .sc-cert-signature {
    align-items: flex-start;
  }
}
@media print {
  .sc-cert-footer {
    padding: 0 64px 36px 64px !important;
  }
}
.sc-certificate-paper {
  position: relative;
  padding-bottom: 120px;
}
@media (max-width: 700px) {
  .sc-certificate-paper {
    min-height: 900px;
    padding-bottom: 260px;
  }
  .sc-cert-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 0 4vw 32px 4vw;
    min-height: 0;
  }
  .sc-cert-signature {
    align-items: flex-start;
    margin-left: 0;
    text-align: left;
  }
  .sc-cert-qr {
    margin-bottom: 12px;
  }
}
@media print {
  .sc-cert-footer {
    padding: 0 64px 36px 64px !important;
  }
}
.sc-cert-signature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sc-cert-signature img {
  max-width: 160px;
  max-height: 54px;
  display: block;
}
.sc-cert-sign-label {
  font-size: 15px;
  color: #222;
  margin-top: 4px;
  text-align: left;
  font-family: serif;
}
.sc-cert-qr {
  position: static;
  width: 74px;
  height: 74px;
  background: #fff;
  border: 1.5px solid #093C72;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(9,60,114,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.sc-cert-sign-label {
  font-size: 15px;
  color: #222;
  margin-top: 4px;
  text-align: left;
  font-family: serif;
}
.sc-cert-qr {
  position: absolute;
  left: 32px;
  bottom: 32px;
  width: 74px;
  height: 74px;
  background: #fff;
  border: 1.5px solid #093C72;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(9,60,114,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
@media (max-width: 700px) {
  .sc-cert-qr {
    left: 10px;
    bottom: 10px;
    width: 58px;
    height: 58px;
  }
}

/* --- Action Buttons --- */
.sc-certificate-actions {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
  margin-top: 12px;
  width: 100%;
}
.sc-cert-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  font-size: 1.08em;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid #093C72;
  background: #fff;
  color: #093C72;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  outline: none;
  box-shadow: 0 2px 8px rgba(9,60,114,0.06);
  margin-bottom: 0;
  width: 100%;
  text-align: left;
}
.sc-cert-action-btn:focus, .sc-cert-action-btn:hover {
  background: #FEC000;
  color: #093C72;
  border-color: #093C72;
}
.sc-cert-share-btn {
  border-color: #0A66C2;
  color: #0A66C2;
}
.sc-cert-share-btn:focus, .sc-cert-share-btn:hover {
  background: #eaf4fb;
  color: #0A66C2;
  border-color: #0A66C2;
}
.sc-cert-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
}

/* --- Accessibility --- */
.sc-cert-action-btn:focus {
  outline: 2px solid #093C72;
  outline-offset: 2px;
}

/* --- Print Styles --- */
@media print {
  body * {
    visibility: hidden !important;
  }
  .sc-certificate-paper, .sc-certificate-paper * {
    visibility: visible !important;
  }
  .sc-certificate-layout, .sc-certificate-col-left, .sc-certificate-paper {
    display: block !important;
    position: static !important;
    width: 100vw !important;
    max-width: 1122px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 2px solid #093C72 !important;
    padding: 0 !important;
    aspect-ratio: unset !important;
  }
  .sc-certificate-actions, .sc-certificate-col-right, header, footer, .site-header, .site-footer {
    display: none !important;
    visibility: hidden !important;
  }
}

/* --- Footer Fix --- */
footer, .site-footer {
  display: block !important;
  position: static !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Final mobile overrides to keep footer centered and prevent left overlap */
@media (max-width: 700px) {
  .sc-certificate-paper {
    padding-bottom: 24px !important;
    aspect-ratio: unset !important;
    min-height: 0 !important;
  }
  .sc-cert-footer {
    position: static !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
    padding: 12px 4vw 16px 4vw !important;
    min-height: 0 !important;
  }
  .sc-cert-qr {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto !important;
  }
  .sc-cert-signature {
    align-items: center !important;
    text-align: center !important;
    margin-left: 0 !important;
  }
}

.sc-certificate-paper {
  background: #fff;
  border: 3px solid #0057b8;
  border-radius: 16px;
  padding: 40px 24px 32px 24px;
  text-align: center;
  box-shadow: 0 8px 48px rgba(0,87,184,0.13);
  width: 100%;
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
  position: relative;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}
@media (max-width: 1000px) {
  .sc-certificate-paper {
    max-width: 98vw;
    padding: 24px 4vw;
  }
}
@media (max-width: 600px) {
  .sc-certificate-paper {
    padding: 12px 2vw;
    font-size: 0.97em;
  }
}

@media print {
  body, html, .sc-certificate-container.sc-certificate-landscape {
    background: #fff !important;
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
  }
  .sc-certificate-paper {
    box-shadow: none !important;
    border: 2px solid #0057b8 !important;
    width: 100vw !important;
    min-height: 700px !important;
    max-width: 100vw !important;
    page-break-after: avoid;
  }
}

.sc-certificate-paper {
  background: #fff;
  border: 2px solid #0057b8;
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}
.sc-cert-brand {
  color: #0057b8;
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 18px;
}
.sc-cert-name {
  font-size: 2.2em;
  font-weight: bold;
  margin: 18px 0 4px 0;
  color: #222;
}
.sc-cert-email {
  font-size: 1em;
  color: #444;
  margin-bottom: 14px;
}
.sc-cert-title {
  font-size: 1.3em;
  margin: 12px 0;
  color: #0057b8;
}
.sc-cert-score {
  font-size: 1.1em;
  margin: 10px 0;
  color: #333;
}
.sc-cert-date {
  font-size: 1em;
  color: #666;
  margin-bottom: 10px;
}
.sc-cert-id {
  font-size: 0.95em;
  color: #888;
  margin-bottom: 10px;
}
.sc-cert-qr {
  margin: 12px auto 0 auto;
  width: 90px;
  height: 90px;
}
.sc-certificate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.sc-certificate-actions .button {
  min-width: 120px;
  margin-bottom: 8px;
}
@media (max-width: 600px) {
  .sc-certificate-actions {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .sc-certificate-actions .button {
    width: 100%;
    min-width: 0;
  }
}
