/* Certificate Modal Styles */
.certificate-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

.certificate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.certificate-container {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
}

.certificate-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.certificate-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Certificate Design */
.certificate {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.certificate-border {
  border: 8px solid;
  border-image: linear-gradient(135deg, #9f7cff, #6b4eff, #9f7cff) 1;
  padding: 4px;
  position: relative;
}

.certificate-border-inner {
  border: 2px solid #9f7cff;
  padding: 40px;
  background: white;
  position: relative;
}

/* Certificate Header */
.certificate-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.certificate-logo {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.certificate-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #9f7cff, #6b4eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.certificate-subtitle {
  font-size: 1.2rem;
  color: #6c757d;
  margin: 0;
  font-style: italic;
}

/* Certificate Body */
.certificate-body {
  text-align: center;
  margin-bottom: 40px;
}

.certificate-text {
  font-size: 1.1rem;
  color: #495057;
  margin: 10px 0;
}

.certificate-name {
  font-size: 3rem;
  font-weight: 700;
  color: #212529;
  margin: 20px 0;
  font-family: 'Georgia', serif;
  border-bottom: 3px solid #9f7cff;
  padding-bottom: 10px;
  display: inline-block;
}

.certificate-course {
  font-size: 1.8rem;
  font-weight: 600;
  color: #6b4eff;
  margin: 20px 0;
}

/* Certificate Stats */
.certificate-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 40px 0;
  padding: 30px;
  background: linear-gradient(135deg, rgba(159, 124, 255, 0.1), rgba(107, 78, 255, 0.05));
  border-radius: 12px;
  border: 2px solid rgba(159, 124, 255, 0.3);
}

.certificate-stat {
  text-align: center;
}

.certificate-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #9f7cff;
  margin-bottom: 5px;
}

.certificate-stat-label {
  font-size: 0.9rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Skills Section */
.certificate-skills {
  margin: 30px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.certificate-skills-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
  margin: 0 0 15px;
  text-align: center;
}

.certificate-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.certificate-skill {
  font-size: 0.95rem;
  color: #495057;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  text-align: center;
}

/* Certificate Footer */
.certificate-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #e9ecef;
}

.certificate-signature-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.certificate-signature {
  text-align: center;
}

.certificate-signature-line {
  width: 200px;
  height: 2px;
  background: #495057;
  margin-bottom: 10px;
}

.certificate-signature-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #212529;
  margin: 5px 0;
  font-family: 'Georgia', serif;
}

.certificate-signature-title {
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0;
  font-style: italic;
}

.certificate-date-section {
  text-align: center;
}

.certificate-date-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0 0 5px;
}

.certificate-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: #212529;
  margin: 0;
}

.certificate-id {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

.certificate-id p {
  font-size: 0.85rem;
  color: #adb5bd;
  margin: 0;
  font-family: 'Courier New', monospace;
}

/* Certificate Seal */
.certificate-seal {
  position: absolute;
  bottom: 30px;
  right: 30px;
  width: 120px;
  height: 120px;
}

.certificate-seal-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #9f7cff, #6b4eff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(159, 124, 255, 0.5);
  border: 4px solid white;
  transform: rotate(-15deg);
}

.certificate-seal-text {
  text-align: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.4;
}

.certificate-seal-year {
  font-size: 1.5rem;
  margin-top: 5px;
}

/* Certificate Actions */
.certificate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* Confetti Animation */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 10003;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Print Styles */
@media print {
  .certificate-overlay,
  .certificate-close,
  .certificate-actions {
    display: none !important;
  }
  
  .certificate-container {
    max-width: 100%;
    width: 100%;
  }
  
  .certificate {
    box-shadow: none;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .certificate {
    padding: 20px;
  }
  
  .certificate-border-inner {
    padding: 20px;
  }
  
  .certificate-title {
    font-size: 1.8rem;
  }
  
  .certificate-name {
    font-size: 2rem;
  }
  
  .certificate-course {
    font-size: 1.3rem;
  }
  
  .certificate-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
  }
  
  .certificate-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .certificate-seal {
    width: 80px;
    height: 80px;
    bottom: 20px;
    right: 20px;
  }
  
  .certificate-seal-text {
    font-size: 0.7rem;
  }
  
  .certificate-seal-year {
    font-size: 1.1rem;
  }
}