/* =========================================
   CERTIFICATES PAGE
========================================= */

.certificates-page {
  min-height: 70vh;
  padding: 70px 0;
  background: #f8fafc;
}

.page-header {
  margin-bottom: 40px;
}

.page-label {
  display: inline-block;
  margin-bottom: 10px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.page-header h1 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 36px;
}

.page-header p {
  margin: 0;
  color: #6b7280;
  font-size: 15px;
}

/* CERTIFICATE GRID */

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* CERTIFICATE CARD */

.certificate-card {
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
}

.certificate-icon {
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  background: #eff6ff;
  border-radius: 12px;
  font-size: 27px;
}

.certificate-card h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 20px;
}

.certificate-card p {
  margin: 5px 0;
  color: #6b7280;
  font-size: 14px;
}

.certificate-card .certificate-date {
  margin-top: 14px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

/* CERTIFICATE ACTIONS */

.certificate-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.certificate-actions a,
.certificate-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.view-certificate-btn {
  background: #2563eb;
  color: #ffffff;
}

.view-certificate-btn:hover {
  background: #1d4ed8;
}

.verify-certificate-btn {
  background: #eff6ff;
  color: #2563eb;
}

.verify-certificate-btn:hover {
  background: #dbeafe;
}

/* EMPTY STATE */

.certificates-empty {
  padding: 70px 20px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.empty-icon {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  background: #eff6ff;
  border-radius: 50%;
  font-size: 32px;
}

.certificates-empty h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 22px;
}

.certificates-empty p {
  margin: 0 0 22px;
  color: #6b7280;
  font-size: 14px;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .certificates-page {
    padding: 50px 0;
  }

  .page-header h1 {
    font-size: 30px;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .page-header h1 {
    font-size: 26px;
  }

  .certificate-actions {
    flex-direction: column;
  }

  .certificate-actions a,
  .certificate-actions button {
    width: 100%;
    text-align: center;
  }
}

/* =========================================
   INDIVIDUAL CERTIFICATE PAGE
========================================= */

.certificate-page {
  min-height: 75vh;
  padding: 60px 0;
  background: #f1f5f9;
}

.certificate-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

/* =========================================
   CERTIFICATE CARD
========================================= */

.certificate-card {
  padding: 14px;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.12);
}

.certificate-border {
  padding: 45px;
  border: 5px solid #2563eb;
  background: #ffffff;
}

.certificate-content {
  padding: 35px;
  text-align: center;
  border: 1px solid #bfdbfe;
}

/* =========================================
   LOGO
========================================= */

.certificate-logo {
  margin-bottom: 24px;
  color: #111827;
  font-size: 25px;
  font-weight: 800;
}

.certificate-logo span {
  color: #2563eb;
}

/* =========================================
   TITLE
========================================= */

.certificate-label {
  margin-bottom: 12px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
}

.certificate-content h1 {
  margin: 0 0 25px;
  color: #111827;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
}

.certificate-intro {
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 15px;
}

/* =========================================
   STUDENT NAME
========================================= */

.certificate-content h2 {
  margin: 0;
  color: #1d4ed8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

.certificate-line {
  width: 320px;
  max-width: 80%;
  height: 1px;
  margin: 10px auto 20px;
  background: #94a3b8;
}

/* =========================================
   COURSE
========================================= */

.certificate-text {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 15px;
}

.certificate-content h3 {
  margin: 0 0 20px;
  color: #111827;
  font-size: 24px;
}

.certificate-description {
  max-width: 700px;
  margin: 0 auto;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

/* =========================================
   DETAILS
========================================= */

.certificate-details {
  display: flex;
  justify-content: center;
  gap: 80px;
  margin-top: 35px;
}

.certificate-detail {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.certificate-detail span {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.certificate-detail strong {
  color: #111827;
  font-size: 14px;
}

/* =========================================
   SIGNATURES
========================================= */

.certificate-signatures {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 45px;
  margin-top: 45px;
}

.signature-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.signature-line {
  width: 160px;
  height: 1px;
  background: #64748b;
}

.signature-box span {
  color: #64748b;
  font-size: 12px;
}

/* =========================================
   VERIFIED SEAL
========================================= */

.certificate-seal {
  width: 75px;
  height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid #2563eb;
  border-radius: 50%;
  color: #2563eb;
  font-size: 24px;
}

.certificate-seal span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* =========================================
   ACTION BUTTONS
========================================= */

.certificate-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.certificate-action-btn,
.certificate-back-btn {
  min-height: 46px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.certificate-action-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.certificate-action-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.28);
}

.certificate-download-btn {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.20);
}

.certificate-download-btn:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-2px);
}

.certificate-back-btn {
  border-color: #d1d5db;
  background: #ffffff;
  color: #374151;
}

.certificate-back-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-2px);
}

.certificate-action-btn:focus-visible,
.certificate-back-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 3px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {
  .certificate-page {
    padding: 40px 0;
  }

  .certificate-border {
    padding: 25px;
  }

  .certificate-content {
    padding: 25px 15px;
  }

  .certificate-content h1 {
    font-size: 30px;
  }

  .certificate-content h2 {
    font-size: 26px;
  }

  .certificate-details {
    gap: 35px;
  }

  .certificate-signatures {
    gap: 20px;
  }
}

@media (max-width: 550px) {
  .certificate-card {
    padding: 8px;
  }

  .certificate-border {
    padding: 12px;
    border-width: 3px;
  }

  .certificate-content {
    padding: 25px 10px;
  }

  .certificate-content h1 {
    font-size: 24px;
  }

  .certificate-content h2 {
    font-size: 22px;
  }

  .certificate-content h3 {
    font-size: 19px;
  }

  .certificate-details {
    flex-direction: column;
    gap: 18px;
  }

  .certificate-signatures {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .certificate-seal {
    margin: 0 auto;
  }

  .certificate-actions {
    flex-direction: column;
  }

  .certificate-action-btn,
  .certificate-back-btn {
    width: 100%;
    text-align: center;
  }
}

/* =========================================
   PRINT
========================================= */

@media print {
  .navbar,
  .footer,
  .certificate-actions {
    display: none !important;
  }

  .certificate-page {
    padding: 0;
    background: #ffffff;
  }

  .certificate-card {
    border: none;
    box-shadow: none;
  }
}

/* =========================================
   CERTIFICATES LIST PAGE
========================================= */

.certificate-hero {
  background: #f1f6ff;
  padding: 70px 20px;
  text-align: center;
}

.certificate-hero .container {
  max-width: 900px;
  margin: 0 auto;
}

.certificate-hero .section-label {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.certificate-hero h1 {
  margin: 0 0 15px;
  color: #0f172a;
  font-size: 42px;
}

.certificate-hero p:last-child {
  margin: 0;
  color: #64748b;
  font-size: 16px;
  line-height: 1.7;
}

/* CERTIFICATE SECTION */

.certificate-section {
  padding: 60px 20px;
  min-height: 450px;
}

.certificate-section .container {
  max-width: 1100px;
  margin: 0 auto;
}

/* CERTIFICATE GRID */

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

/* CERTIFICATE CARD */

.certificate-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
}

.certificate-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border-radius: 50%;
  font-size: 32px;
}

.certificate-card h2 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.4;
}

.certificate-card p {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.certificate-card .certificate-date {
  color: #16a34a;
  font-weight: 600;
}

/* BUTTON */

.certificate-actions {
  margin-top: 20px;
}

.view-certificate-btn {
  display: inline-block;
  padding: 11px 20px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 7px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: 0.3s ease;
}

.view-certificate-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* EMPTY STATE */

.certificates-empty {
  max-width: 600px;
  margin: 40px auto;
  padding: 50px 25px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.empty-icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.certificates-empty h2 {
  margin: 0 0 10px;
  color: #0f172a;
}

.certificates-empty p {
  margin: 0 0 22px;
  color: #64748b;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .certificates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .certificate-hero {
    padding: 50px 20px;
  }

  .certificate-hero h1 {
    font-size: 32px;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
  }

  .certificate-section {
    padding: 40px 15px;
  }
}

/* =========================================
   CERTIFICATES PAGE NAVBAR
========================================= */

.certificate-list-page .navbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.certificate-list-page .navbar .nav-container {
  max-width: 1200px;
  min-height: 70px;
  margin: 0 auto;
  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.certificate-list-page .navbar .logo {
  display: flex;
  align-items: center;
  gap: 5px;

  color: #111827;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;

  white-space: nowrap;
}

.certificate-list-page .navbar .logo span {
  color: #2563eb;
}

.certificate-list-page .navbar .nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.certificate-list-page .navbar.nav-menu a {
  display: inline-flex;
  align-items: center;

  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;

  white-space: nowrap;
  transition: color 0.3s ease;
}

.certificate-list-page .navbar .nav-menu a:hover {
  color: #2563eb;
}

.certificate-list-page .navbar .cart-link {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}

.certificate-list-page .navbar .cart-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #2563eb;
  color: #ffffff;

  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* =========================================
   CERTIFICATE LIST NAVBAR FIX
========================================= */

.certificate-list-page .navbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.certificate-list-page .navbar .nav-container {
  max-width: 1200px;
  min-height: 70px;
  margin: 0 auto;
  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.certificate-list-page .navbar .logo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.certificate-list-page .navbar .nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.certificate-list-page .navbar .nav-menu a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
}

.certificate-list-page .navbar .cart-link {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}

.certificate-list-page .navbar .cart-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

/* =========================================
   FINAL CERTIFICATES NAVBAR FIX
========================================= */

.certificate-list-page .navbar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.certificate-list-page .navbar .nav-container {
  width: 100%;
  max-width: 1200px;
  min-height: 70px;
  margin: 0 auto;
  padding: 0 20px;

  display: flex !important;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.certificate-list-page .navbar .logo {
  display: flex !important;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.certificate-list-page .navbar .nav-menu {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 28px !important;
  margin-left: auto !important;
  flex-wrap: nowrap;
}

.certificate-list-page .navbar .nav-menu a {
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
}

.certificate-list-page .navbar .cart-link {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}

.certificate-list-page .navbar .cart-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  background: #2563eb;
  color: #ffffff;
  border-radius: 50%;

  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* =========================================
   A4 CERTIFICATE PRINT FORMAT
========================================= */

@page {
  size: A4 landscape;
  margin: 0;
}

/* =========================================
   PRINT CERTIFICATE
========================================= */

@media print {
  html,
  body {
    width: 297mm;
    height: 210mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .navbar,
  .footer,
  .certificate-actions {
    display: none !important;
  }

  .certificate-page {
    width: 297mm;
    height: 210mm;
    min-height: 210mm !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .certificate-wrapper {
    width: 287mm;
    height: 200mm;
    max-width: none !important;
    margin: 0 !important;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .certificate-card {
    width: 287mm;
    height: 200mm;

    box-sizing: border-box;

    padding: 5mm !important;
    margin: 0 !important;

    border: 1px solid #dbe3ee;
    box-shadow: none !important;
    border-radius: 0 !important;

    background: #ffffff;
  }

  .certificate-border {
    width: 100%;
    height: 100%;

    box-sizing: border-box;

    padding: 8mm !important;

    border: 2mm solid #2563eb;

    background: #ffffff;
  }

  .certificate-content {
    width: 100%;
    height: 100%;

    box-sizing: border-box;

    padding: 7mm !important;

    border: 0.3mm solid #bfdbfe;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
  }

  .certificate-logo {
    margin-bottom: 4mm !important;
    font-size: 7mm !important;
  }

  .certificate-label {
    margin-bottom: 3mm !important;
    font-size: 3.5mm !important;
    letter-spacing: 1.5mm;
  }

  .certificate-content h1 {
    margin: 0 0 6mm !important;
    font-size: 11mm !important;
  }

  .certificate-intro {
    margin: 0 0 3mm !important;
    font-size: 4mm !important;
  }

  .certificate-content h2 {
    font-size: 8mm !important;
    margin: 0 !important;
  }

  .certificate-line {
    width: 80mm !important;
    margin: 2mm auto 4mm !important;
  }

  .certificate-text {
    margin: 0 0 3mm !important;
    font-size: 4mm !important;
  }

  .certificate-content h3 {
    margin: 0 0 4mm !important;
    font-size: 6mm !important;
  }

  .certificate-description {
    max-width: 190mm !important;
    font-size: 3.8mm !important;
    line-height: 1.5 !important;
  }

  .certificate-details {
    margin-top: 7mm !important;

    display: flex !important;
    flex-direction: row !important;

    justify-content: center !important;

    gap: 35mm !important;
  }

  .certificate-detail {
    gap: 2mm !important;
  }

  .certificate-detail span {
    font-size: 3mm !important;
  }

  .certificate-detail strong {
    font-size: 3.8mm !important;
  }

  .certificate-signatures {
    width: 100%;

    margin-top: 8mm !important;

    display: grid !important;
    grid-template-columns: 1fr 1fr !important;

    align-items: end !important;

    gap: 15mm !important;
  }

  .signature-box {
    gap: 2mm !important;
  }

  .signature-line {
    width: 45mm !important;
  }

  .signature-box span {
    font-size: 3mm !important;
  }

  .certificate-seal {
    width: 20mm !important;
    height: 20mm !important;

    border-width: 0.8mm !important;

    font-size: 6mm !important;
  }

  .certificate-seal span {
    font-size: 2mm !important;
  }
}

/* =========================================
   DARK MODE - CERTIFICATE PAGE
========================================= */

body.dark-mode .certificate-page {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

/* Outer certificate wrapper */
body.dark-mode .certificate-wrapper {
  background: #111827 !important;
  border-color: #334155 !important;
}

/* Keep actual certificate WHITE */
body.dark-mode .certificate-card {
  background: #ffffff !important;
  color: #111827 !important;
}

body.dark-mode .certificate-border {
  background: #ffffff !important;
  color: #111827 !important;
}

body.dark-mode .certificate-content {
  background: #ffffff !important;
  color: #111827 !important;
}

/* Certificate text stays readable */
body.dark-mode .certificate-content h1 {
  color: #111827 !important;
}

body.dark-mode .certificate-content h2 {
  color: #111827 !important;
}

body.dark-mode .certificate-content h3 {
  color: #111827 !important;
}

body.dark-mode .certificate-intro,
body.dark-mode .certificate-text,
body.dark-mode .certificate-description {
  color: #475569 !important;
}

body.dark-mode .certificate-detail span {
  color: #64748b !important;
}

body.dark-mode .certificate-detail strong {
  color: #111827 !important;
}

body.dark-mode .signature-box span {
  color: #64748b !important;
}

body.dark-mode .signature-line {
  background: #64748b !important;
}

/* Action buttons */
body.dark-mode .certificate-action-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

body.dark-mode .certificate-action-btn:hover {
  background: #1d4ed8 !important;
}

body.dark-mode .certificate-back-btn {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.dark-mode .certificate-back-btn:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

/* =========================================
   INSTRUCTOR SIGNATURE + HVAC STAMP
========================================= */

.certificate-signatures {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 0 70px;
  box-sizing: border-box;
}

.certificate-instructor {
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-signature {
  width: 210px;
  height: auto;
  display: block;
}

.certificate-stamp-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-stamp {
  width: 110px;
  height: auto;
  display: block;
}

/* =========================================
   MY CERTIFICATES - DARK MODE
   ========================================= */

body.dark-mode .certificates-page {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

body.dark-mode .certificates-header h1 {
  color: #ffffff !important;
}

body.dark-mode .certificates-header p {
  color: #94a3b8 !important;
}

/* Certificate Cards */
body.dark-mode .certificate-list-card,
body.dark-mode .certificate-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

/* Card title */
body.dark-mode .certificate-card h2,
body.dark-mode .certificate-card h3 {
  color: #ffffff !important;
}

/* Card description */
body.dark-mode .certificate-card p {
  color: #cbd5e1 !important;
}

/* Certificate ID and date */
body.dark-mode .certificate-card strong {
  color: #22c55e !important;
}

/* Trophy circle */
body.dark-mode .certificate-card .certificate-icon {
  background: #334155 !important;
}

/* View Certificate button */
body.dark-mode .certificate-card a,
body.dark-mode .certificate-card .certificate-view-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

body.dark-mode .certificate-card a:hover,
body.dark-mode .certificate-card .certificate-view-btn:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

/* =========================================
   CERTIFICATE - DARK MODE TEXT FIX
   Certificate itself stays WHITE
   ========================================= */

body.dark-mode .certificate-card,
body.dark-mode .certificate-border,
body.dark-mode .certificate-content {
  background: #ffffff !important;
  color: #111827 !important;
}

/* Main certificate heading */
body.dark-mode .certificate-content h1 {
  color: #111827 !important;
}

/* Student Name */
body.dark-mode #studentName {
  color: #111827 !important;
}

/* Course Name */
body.dark-mode #courseName {
  color: #111827 !important;
}

/* Normal certificate text */
body.dark-mode .certificate-intro,
body.dark-mode .certificate-text,
body.dark-mode .certificate-description {
  color: #64748b !important;
}

/* Certificate label */
body.dark-mode .certificate-label {
  color: #2563eb !important;
}

/* Details labels */
body.dark-mode .certificate-detail span {
  color: #64748b !important;
}

/* Certificate ID + Date */
body.dark-mode .certificate-detail strong {
  color: #111827 !important;
}

/* Signature labels */
body.dark-mode .signature-box span {
  color: #64748b !important;
}

/* Back button */
body.dark-mode .certificate-back-btn {
  background: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

/* =========================================
   CERTIFICATE - DARKER TEXT
   ========================================= */

body.dark-mode .certificate-content h1,
body.dark-mode #studentName,
body.dark-mode #courseName,
body.dark-mode .certificate-detail strong {
  color: #000000 !important;
}

body.dark-mode .certificate-intro,
body.dark-mode .certificate-text,
body.dark-mode .certificate-description {
  color: #1f2937 !important;
}

body.dark-mode .certificate-detail span,
body.dark-mode .signature-box span {
  color: #374151 !important;
}

/* =========================================
   FINAL MOBILE CERTIFICATE RESPONSIVE FIX
   ========================================= */

@media (max-width: 600px) {
  .certificate-page {
    width: 100%;
    padding: 20px 8px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .certificate-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .certificate-card {
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .certificate-border {
    width: 100%;
    padding: 12px;
    border-width: 3px;
    box-sizing: border-box;
  }

  .certificate-content {
    width: 100%;
    padding: 22px 10px;
    box-sizing: border-box;
  }

  .certificate-logo {
    font-size: 21px;
    margin-bottom: 16px;
  }

  .certificate-label {
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .certificate-content h1 {
    font-size: 25px;
    line-height: 1.2;
    margin-bottom: 20px;
  }

  .certificate-intro {
    font-size: 13px;
  }

  .certificate-content h2 {
    font-size: 23px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .certificate-line {
    width: 80%;
    max-width: 280px;
  }

  .certificate-text {
    font-size: 13px;
  }

  .certificate-content h3 {
    font-size: 20px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .certificate-description {
    font-size: 12px;
    line-height: 1.6;
  }

  /* Certificate ID + Completion Date */
  .certificate-details {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 25px;
  }

  .certificate-detail {
    min-width: 0;
    gap: 5px;
  }

  .certificate-detail span {
    font-size: 10px;
  }

  .certificate-detail strong {
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  /* Signature + Stamp */
  .certificate-signatures {
    width: 100%;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 25px !important;
    padding: 0 5px !important;
    box-sizing: border-box;
  }

  .certificate-instructor,
  .certificate-stamp-box {
    width: 50%;
    min-width: 0;
  }

  .certificate-signature {
    width: 150px;
    max-width: 100%;
    height: auto;
  }

  .certificate-stamp {
    width: 75px;
    max-width: 100%;
    height: auto;
  }

  /* Buttons */
  .certificate-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
  }

  .certificate-action-btn,
  .certificate-back-btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .certificate-page {
    padding: 15px 5px;
  }

  .certificate-border {
    padding: 8px;
  }

  .certificate-content {
    padding: 18px 7px;
  }

  .certificate-content h1 {
    font-size: 22px;
  }

  .certificate-content h2 {
    font-size: 20px;
  }

  .certificate-content h3 {
    font-size: 18px;
  }

  .certificate-signature {
    width: 130px;
  }

  .certificate-stamp {
    width: 68px;
  }

  .certificate-detail strong {
    font-size: 10px;
  }
}
