/* ========================================
   STYLES.CSS - Certificate Generator
   SD Daarul Qur'an Kalianda
   ======================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lora', serif;
  background: linear-gradient(135deg, #0f4c3a 0%, #1a6b4f 30%, #0d3d2e 70%, #082a1f 100%);
}

.form-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   CERTIFICATE STYLES
   ======================================== */

.certificate-wrapper {
  width: 210mm;
  height: 297mm;
  position: relative;
  background-image: url('https://mtsdqai.ydqailamsel.com/images/bgserti2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.certificate-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3cm 2cm;
  z-index: 2;
  font-family: 'Amiri', serif;
}

/* Logo Sekolah - 3cm dari tepi atas */
.logo-school {
  position: absolute;
  top: 3cm;
  left: 55%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  object-fit: contain;
  z-index: 3;
}
/* Logo kemenag - 3cm dari tepi atas */
.logo-kemenag {
  position: absolute;
  top: 3cm;
  left: 45%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
  object-fit: contain;
  z-index: 3;
}

/* Watermark Logo Dikbud - Centered */
.certificate-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  opacity: 0.50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.certificate-watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
}

/* Teks Sertifikat */
.certificate-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 2rem;
  color: #1a5c3a;
  letter-spacing: 3px;
  margin: 0;
  text-transform: uppercase;
}

.student-name {
  font-family: 'Harrington', fantasy;
  font-weight: 700;
  font-size: 2.8rem;
  color: #1a5c3a;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  text-align: center;
  margin: 0;
}

.rank-badge {
  background: linear-gradient(135deg, #d4af37, #f0d060, #d4af37);
  color: #3d2b00;
  padding: 8px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  border: 2px solid #b8960c;
  display: inline-block;
}

.motivation-text {
  font-family: 'Lora', serif;
  font-style: italic;
  color: #2d5a3f;
  font-size: 1rem;
  max-width: 80%;
  text-align: center;
  line-height: 1.6;
}

/* Signature Section - 3cm dari tepi bawah */
.signature-section {
  position: absolute;
  bottom: 3cm;
  left: 4cm;
  right: 2cm;
  display: flex;
  justify-content: space-between;
  width: calc(79% - 3.5cm);
  z-index: 2;
}

.signature-block {
  text-align: center;
  width: 45%;
}

.signature-line {
  border-bottom: 1px solid #333;
  width: 80%;
  margin: 0 auto;
  margin-top: 60px;
  margin-bottom: 5px;
}

/* ========================================
   TOMBOL AKSI
   ======================================== */

.btn-generate {
  background: linear-gradient(135deg, #1a6b4f, #0f4c3a);
  color: white;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-generate:hover {
  background: linear-gradient(135deg, #228b5f, #1a6b4f);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 76, 58, 0.4);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-download {
  background: linear-gradient(135deg, #d4af37, #b8960c);
  color: #3d2b00;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-download:hover {
  background: linear-gradient(135deg, #e6c040, #d4af37);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-download:active {
  transform: translateY(0);
}

/* ========================================
   INPUT FORM STYLES
   ======================================== */

.input-field {
  border: 2px solid #e0e0e0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-field:focus {
  border-color: #1a6b4f;
  box-shadow: 0 0 0 3px rgba(26, 107, 79, 0.15);
  outline: none;
}

/* ========================================
   ANIMASI
   ======================================== */

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  body * {
    visibility: hidden;
  }

  .certificate-wrapper,
  .certificate-wrapper * {
    visibility: visible;
  }

  .certificate-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
  .certificate-wrapper {
    width: 100vw;
    height: auto;
    aspect-ratio: 210 / 297;
  }

  .student-name {
    font-size: 1.8rem;
  }

  .certificate-title {
    font-size: 1.3rem;
  }

  .signature-section {
    flex-direction: column;
    gap: 40px;
  }

  .signature-block {
    width: 100%;
  }
}