/* Certificate title styling */
.cert-title {
    background: none !important;
    color: inherit !important;
    padding: 15px 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    text-align: center !important;
    width: auto !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
}
.cert-title .text-blue {
    color: var(--secondary-yellow) !important;
}
/*  Reduced top padding */
.spt-30 {
  padding: 30px 0;
}
.text-blue {
  color: #007bff;
}
.db {
  display: block;
}
/* Larger, bolder title */
.cert-title {
  font-size: 2.8rem !important;
  font-weight: 800 !important;
  line-height: 1.2;
  text-align: center;
  margin-bottom:15px;
}
/* 3D Viewer Container */
.cert-3d-container {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 200px;
  perspective: 1800px;
  overflow: visible;
  border-radius: 22px;
  background: rgba(255, 255, 255, 1);
  cursor: default;
  user-select: none;
  margin: 0;
  padding: 0;
}
.cert-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin: 0;
  padding: 0;
}
.cert-face {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  max-width: 500px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  backface-visibility: hidden;
  transform: translate(-50%, -50%);
}
.cert-front {
  transform: translate(-50%, -50%) rotateY(0deg);
}
.cert-back {
  transform: translate(-50%, -50%) rotateY(180deg);
}
/* Drag Arrow - Only during drag */
.drag-arrow {
  position: absolute;
  width: 54px;
  height: 54px;
  background: rgba(17, 132, 219, 0.95);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--h5-size);
  font-weight: bold;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s;
}
.drag-arrow.active {
  opacity: 1;
}
.drag-arrow::after {
  content: "Drag to rotate";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
/* Flip Buttons with Font Awesome */
.flip-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(17, 132, 219, 0.92);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  z-index: 25;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}
.flip-btn:hover {
  background: #0d6efd;
  transform: translateY(-50%) scale(1.12);
}
.flip-btn.left {
  left: 218px;
}
.flip-btn.right {
  right: 218px;
}
/* Mobile */
@media (max-width: 768px) {
  .cert-3d-container {
    height: 400px;
  }
  .cert-face {
    width: 96%;
    max-width: 400px;
  }
  .cert-title {
    font-size: 2.2rem !important;
  }
  .flip-btn {
    top:350px;
    width: 48px;
    height: 48px;
    font-size: var(--h5-size);
  }
  .drag-arrow {
    width: 48px;
    height: 48px;
    font-size: var(--h6-size);
  }
}
/* Certificate Modal Styles */
.cert-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}
.cert-modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cert-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #333;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}
.cert-modal-close:hover {
    color: #ff4444;
}
.cert-modal-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 15px 15px;
}
.cert-modal-image {
    max-width: 95%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}
.cert-modal-image:hover {
    transform: scale(1.02);
}
.cert-modal-controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}
.cert-modal-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}
.cert-modal-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}
.cert-modal-btn.active {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}
/* Add cursor pointer to certificate images */
body section.spt-30[style*="background:white"] .cert-face {
    cursor: pointer;
    transition: transform 0.3s ease;
}
body section.spt-30[style*="background:white"] .cert-face:hover {
    transform: translateX(-50%) scale(1.05);
}
/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* Mobile responsive */
@media (max-width: 768px) {
    .cert-modal-content {
        width: 95%;
        height: 95vh;
        margin: 2.5% auto;
    }
    
    .cert-modal-container {
        padding: 35px 10px 10px;
    }
    
    .cert-modal-image {
        max-height: 85%;
        max-width: 98%;
    }
    
    .cert-modal-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .cert-modal-close {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }
}
/* Professional Single Flip Button */
.cert-flip-controls {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}
.flip-btn-single {
  background: linear-gradient(135deg, var(--primary-sky-blue), var(--dark-sky-blue));
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 119, 190, 0.3);
}
.flip-btn-single:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 119, 190, 0.4);
  background: linear-gradient(135deg, var(--dark-sky-blue), var(--primary-sky-blue));
}
.flip-btn-single i {
  font-size: 14px;
  transition: transform 0.3s ease;
}
.flip-btn-single:hover i {
  transform: rotate(180deg);
}
@media (max-width: 768px) {
  .flip-btn-single {
    padding: 10px 25px;
    font-size: 14px;
  }
}
/* Override CSS variable-based spacing for certificate section specifically */
section.spt-30[style*="background:white"] {
    margin: 0 !important;
    padding: 10px 0 !important;
    /* Override CSS variables for this section only */
    --section-padding: 0px !important;
    --content-padding: 0px !important;
    --element-margin: 0px !important;
    --small-margin: 0px !important;
}
/* Override padding for certificate section specifically */
section.spt-30[style*="background:white"]:has(.cert-3d-container) {
    padding: 10px 0 !important;
    margin: 0 !important;
}
/* -------------------------------------------------
   CERTIFICATE SECTION – FULL WIDTH + RESPONSIVE
   ------------------------------------------------- */
    /* ORIGINAL CERTIFICATE SECTION - COMPLETELY OVERRIDDEN */
    .cert-title {
      background: none !important;
      color: inherit !important;
      padding: 15px 0 !important;
      margin: 0 !important;
      border-radius: 0 !important;
      display: block !important;
      text-align: center !important;
      width: auto !important;
      position: static !important;
      left: auto !important;
      transform: none !important;
    }
    .cert-title .text-blue {
      color: var(--secondary-yellow) !important;
    }
/* FINAL CERTIFICATE SECTION OVERRIDE - MAXIMUM SPECIFICITY */
body section.spt-30[style*="background:white"] {
    margin: 0 !important;
    padding: 8px 0 !important;
    min-height: auto !important;
    height: auto !important;
    box-sizing: border-box !important;
}
body section.spt-30[style*="background:white"] .container {
    margin: 0 !important;
    padding: 0 15px !important;
    max-width: 100% !important;
}
body section.spt-30[style*="background:white"] .row {
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
}
body section.spt-30[style*="background:white"] .col-lg-6,
body section.spt-30[style*="background:white"] .col-12 {
    margin: 0 !important;
    padding: 3px !important;
    min-height: auto !important;
}
body section.spt-30[style*="background:white"] .cert-title {
    margin: 0 !important;
    padding: 3px 0 !important;
    background: none !important;
    text-align: center !important;
    line-height: 1.2 !important;
}
body section.spt-30[style*="background:white"] .cert-3d-container {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 180px !important;
    height: auto !important;
}
/* Remove any inherited spacing from parent sections */
body .informed + section.spt-30[style*="background:white"] {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
/* Override any utility classes that might add spacing */
body section.spt-30[style*="background:white"].spb-60,
body section.spt-30[style*="background:white"].spt-60,
body section.spt-30[style*="background:white"].pt-3,
body section.spt-30[style*="background:white"].pb-3 {
    margin: 0 !important;
    padding: 8px 0 !important;
}
/* Fix certificate overlap by adjusting positioning and container height */
body section.spt-30[style*="background:white"] .cert-3d-container {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 520px !important; /* Increased by 30% from 400px */
    height: 520px !important;
    position: relative !important;
    overflow: visible !important;
}
/* Ensure certificate images don't overlap with title - 30% LARGER SIZE */
body section.spt-30[style*="background:white"] .cert-face {
    position: absolute;
    top: 10px; /* Add some top margin to prevent overlap */
    left: 50%;
    width: 100%; /* Increased from 95% (30% more coverage) */
    max-width: 780px; /* Increased from 600px (30% larger) */
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.28);
    backface-visibility: hidden;
    transform: translateX(-50%);
}
body section.spt-30[style*="background:white"] .cert-front {
    transform: translateX(-50%) rotateY(0deg);
}
body section.spt-30[style*="background:white"] .cert-back {
    transform: translateX(-50%) rotateY(180deg);
}
/* Ensure the certificate column has enough height */
body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
    min-height: 520px !important;
}
/* Add bottom margin to certificate section to prevent overlap with next section */
body section.spt-30[style*="background:white"] {
    margin: 0 !important;
    padding: 8px 0 60px 0 !important; /* Increased from 45px to 60px (+15px) */
    min-height: auto !important;
    height: auto !important;
    box-sizing: border-box !important;
}
/* Responsive adjustments for 30% larger certificate */
@media (max-width: 992px) {
    body section.spt-30[style*="background:white"] .cert-3d-container {
        min-height: 455px !important; /* 30% increase from 350px */
        height: 455px !important;
    }
    
    body section.spt-30[style*="background:white"] .cert-face {
        width: 98%; /* 30% increase from 90% */
        max-width: 650px; /* 30% increase from 500px */
    }
    
    body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
        min-height: 455px !important;
    }
}
@media (max-width: 768px) {
    body section.spt-30[style*="background:white"] .cert-3d-container {
        min-height: 390px !important; /* 30% increase from 300px */
        height: 390px !important;
    }
    
    body section.spt-30[style*="background:white"] .cert-face {
        width: 95%; /* 30% increase from 85% */
        max-width: 520px; /* 30% increase from 400px */
    }
    
    body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
        min-height: 390px !important;
    }
    
    body section.spt-30[style*="background:white"] {
        padding: 8px 0 35px 0 !important; /* Increased bottom padding */
    }
}
@media (max-width: 480px) {
    body section.spt-30[style*="background:white"] .cert-3d-container {
        min-height: 325px !important; /* 30% increase from 250px */
        height: 325px !important;
    }
    
    body section.spt-30[style*="background:white"] .cert-face {
        width: 90%; /* 30% increase from 80% */
        max-width: 390px; /* 30% increase from 300px */
    }
    
    body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
        min-height: 325px !important;
    }
}
/* COMPREHENSIVE CERTIFICATE SECTION OVERRIDE - FINAL VERSION */
/* This section overrides ALL previous certificate styling to fix conflicts */
/* Container and Scene - Highest Specificity */
body section.spt-30[style*="background:white"] .cert-3d-container {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 500px !important;
  max-height: none !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  perspective: 1000px !important;
  padding: 20px 0 80px 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}
body section.spt-30[style*="background:white"] .cert-scene {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 450px !important;
  max-height: none !important;
  transform-style: preserve-3d !important;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* Certificate Images - Override ALL previous positioning */
body section.spt-30[style*="background:white"] .cert-face {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  width: 100% !important;
  max-width: 600px !important;
  height: auto !important;
  transform: translateX(-50%) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  backface-visibility: hidden !important;
  z-index: 1 !important;
}
body section.spt-30[style*="background:white"] .cert-front {
  transform: translateX(-50%) rotateY(0deg) !important;
}
body section.spt-30[style*="background:white"] .cert-back {
  transform: translateX(-50%) rotateY(180deg) !important;
}
body section.spt-30[style*="background:white"] .cert-face:hover {
  transform: translateX(-50%) scale(1.02) !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25) !important;
}
body section.spt-30[style*="background:white"] .cert-back:hover {
  transform: translateX(-50%) rotateY(180deg) scale(1.02) !important;
}
/* Flip Button Controls - Position Below Certificate (Outside Scene) */
body section.spt-30[style*="background:white"] .cert-flip-controls {
  position: absolute !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  z-index: 10 !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Override any conflicting flip button styles */
body section.spt-30[style*="background:white"] .flip-btn-single {
  background: linear-gradient(135deg, var(--primary-sky-blue), var(--dark-sky-blue)) !important;
  color: white !important;
  border: none !important;
  padding: 12px 30px !important;
  border-radius: 25px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(0, 119, 190, 0.3) !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}
body section.spt-30[style*="background:white"] .flip-btn-single:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 119, 190, 0.4) !important;
}
/* Ensure column has proper height */
body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
  min-height: 500px !important;
}
/* ===== RESPONSIVE OVERRIDES ===== */
@media (max-width: 992px) {
  body section.spt-30[style*="background:white"] .cert-3d-container {
    min-height: 450px !important;
    padding: 15px 0 70px 0 !important;
  }
  
  body section.spt-30[style*="background:white"] .cert-scene {
    min-height: 400px !important;
  }
  
  body section.spt-30[style*="background:white"] .cert-face {
    max-width: 500px !important;
  }
  
  body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
    min-height: 450px !important;
  }
}
@media (max-width: 768px) {
  body section.spt-30[style*="background:white"] .cert-3d-container {
    min-height: 400px !important;
    padding: 10px 0 60px 0 !important;
  }
  
  body section.spt-30[style*="background:white"] .cert-scene {
    min-height: 350px !important;
  }
  
  body section.spt-30[style*="background:white"] .cert-face {
    max-width: 400px !important;
  }
  
  body section.spt-30[style*="background:white"] .flip-btn-single {
    padding: 10px 25px !important;
    font-size: 14px !important;
  }
  
  body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
    min-height: 400px !important;
  }
}
@media (max-width: 480px) {
  body section.spt-30[style*="background:white"] .cert-3d-container {
    min-height: 350px !important;
    padding: 8px 0 50px 0 !important;
  }
  
  body section.spt-30[style*="background:white"] .cert-scene {
    min-height: 300px !important;
  }
  
  body section.spt-30[style*="background:white"] .cert-face {
    max-width: 320px !important;
  }
  
  body section.spt-30[style*="background:white"] .flip-btn-single {
    padding: 8px 20px !important;
    font-size: 13px !important;
  }
  
  body section.spt-30[style*="background:white"] .col-lg-6:has(.cert-3d-container) {
    min-height: 350px !important;
  }
}