/* ============================================================
   nama file: ROOT/assets/rekomendasi.css
============================================================ */

/* ============================================================
   CSS VARIABLES
============================================================ */
.rekomendasi-wrap,
.rekomendasi-preview,
.rekomendasi-render-loading {
  --primary: #147574;
  --primary-dark: #0f5958;
  --radius: 0.75rem;
  --shadow: 0 4px 22px rgba(0, 0, 0, 0.08);
  --transition: 0.25s ease;
  font-family: "Poppins", sans-serif;
  color: #000;
}

/* ============================================================
   LAYOUT — WRAP & PAGE
============================================================ */
.rekomendasi-wrap {
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rekomendasi-page {
  background: #fff;
  width: 100%;
  max-width: 50rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.rekomendasi-page__inner {
  width: 100%;
}

.rekomendasi-page__inner--center {
  text-align: center;
}

.rekomendasi-page h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.rekomendasi-page p {
  margin-bottom: 1rem;
  color: #333;
}

/* ============================================================
   NOTICE / WARNING BOX
============================================================ */
.rekomendasi-notice--green {
  background: #d4f8d4;
  border-left: 0.35rem solid #38b000;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: #205c20;
  font-weight: 700;
}

.rekomendasi-notice--warn {
  background: #fff3cd;
  border-left: 0.35rem solid #ffeaa7;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ============================================================
   RULES LIST
============================================================ */
.rekomendasi-rules {
  list-style: none;
  padding: 0;
  margin: 1.5rem auto;
  max-width: 800px;
  text-align: justify;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 500;
}

.rekomendasi-rules li {
  margin-bottom: 0.7rem;
  position: relative;
  padding-left: 1.5rem;
}

.rekomendasi-rules li::before {
  content: "🟢";
  font-size: 0.5rem;
  position: absolute;
  left: 0;
  top: 5px;
}

/* ============================================================
   CONTOH SURAT
============================================================ */
.rekomendasi-contoh-label {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #0f5958 !important;
}

.rekomendasi-contoh-img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-top: 15px;
}

/* ============================================================
   TOMBOL
============================================================ */
.rekomendasi-btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  margin-top: 0.75rem;
}

.rekomendasi-btn--primary {
  background: var(--primary);
  color: #fff;
}

.rekomendasi-btn--primary:hover {
  background: var(--primary-dark);
}

.rekomendasi-btn--secondary {
  background: #e9ecef;
  color: #000;
}

.rekomendasi-btn--secondary:hover {
  background: #dfe3e7;
}

.rekomendasi-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================================
   NAVIGASI (tombol baris bawah form/interview)
============================================================ */
.rekomendasi-nav {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
}

.rekomendasi-nav .rekomendasi-btn {
  flex: 1;
  margin-top: 0;
  width: auto;
}

/* ============================================================
   FORM
============================================================ */
.rekomendasi-page form label {
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: block;
  color: var(--primary-dark);
}

.rekomendasi-page form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 2px solid #e0e0e0;
  margin-bottom: 1.1rem;
  font-size: 0.97rem;
  font-family: "Poppins", sans-serif;
  transition: 0.25s ease;
  box-sizing: border-box;
}

.rekomendasi-page form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.17rem rgba(20, 117, 116, 0.1);
  outline: none;
}

/* ============================================================
   WAWANCARA / INTERVIEW
============================================================ */
.rekomendasi-interview__soal {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.rekomendasi-interview__opsi {
  display: block;
  padding: 0.9rem 1rem;
  border: 2px solid #e3e3e3;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: 0.2s;
}

.rekomendasi-interview__opsi:hover {
  border-color: var(--primary);
  background: rgba(20, 117, 116, 0.08);
}

.rekomendasi-interview__opsi:has(input:checked) {
  border-color: var(--primary);
  background: rgba(20, 117, 116, 0.15);
}

.rekomendasi-interview__opsi input[type="radio"] {
  display: none;
}

/* ============================================================
   HISTORI SURAT
============================================================= */
.rekomendasi-histori__label {
  margin-top: 28px;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 1.5rem;
  color: #0f5958 !important;
}

.rekomendasi-histori__list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rekomendasi-histori__item {
  display: flex;
  align-items: center; /* ← kembali ke center */
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.rekomendasi-histori__btn-view {
  flex: 0 0 80%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: auto;
  min-height: 40px;
  padding: 6px 16px;
  background: #f0f4ff;
  border: 1px solid #d0d8f0;
  border-radius: 10px;
  color: #2a3a6e;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  gap: 12px;
}

/* nama Indo — kiri */
.rekomendasi-histori__name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  flex-shrink: 0;
  max-width: 35%;
}

/* kolom universitas — kanan */
.rekomendasi-histori__univs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.rekomendasi-histori__univ {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: right;
  direction: rtl;
  color: #2a3a6e;
}

.rekomendasi-histori__btn-hapus {
  flex: 0 0 15%;
  align-self: stretch; /* ← ikuti tinggi btn-view dalam baris yang sama */
  min-height: 40px;
  background: #fee9e7;
  color: #c0392b;
  border: 1px solid #fad2d0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ============================================================
   RENDER SOURCE (area tersembunyi untuk html2canvas)
   Harus position:fixed + off-screen agar html2canvas bisa ukur DOM
============================================================ */
#rek-renderSource {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 794px; /* A4 @ 96dpi */
  z-index: -1;
  pointer-events: none;
  visibility: hidden;
}
/* ============================================================
   SURAT (template render — fixed A4, tidak perlu responsive)
============================================================ */
.rekomendasi-surat {
  width: 794px;
  min-height: 1123px; /* A4 @ 96dpi */
  background: #fff;
  font-family: "Poppins", sans-serif;
  box-sizing: border-box;
}

.rekomendasi-surat__kop {
  width: 100%;
  height: auto;
  display: block;
}

.rekomendasi-surat__isi {
  padding: 32px 48px; /* 2rem = 32px, 3rem = 48px */
  direction: rtl;
  text-align: justify;
  font-size: 15.2px; /* 0.95rem = 15.2px (dengan asumsi 1rem = 16px) */
  line-height: 1.9;
  color: #111;
}

.rekomendasi-surat__isi p {
  margin-bottom: 13.6px; /* 0.85em dari font-size 16px = 13.6px */
}

.rekomendasi-surat__ttd-wrap {
  position: relative;
  height: 50px;
}

.rekomendasi-surat__ttd {
  position: absolute;
  left: 90%;
  top: 50%;
  transform: translate(-60%, -50%);
  width: 90px;
  height: auto;
  opacity: 0.85;
  z-index: 2;
}

.rekomendasi-surat__stempel {
  position: absolute;
  left: 85%;
  top: 50%;
  transform: translate(-100%, -50%) rotate(-5deg);
  width: 120px;
  height: auto;
  opacity: 0.7;
  z-index: 1;
}

/* ============================================================
   LOADING RENDER (halaman cetak — sebelum preview muncul)
============================================================ */
.rekomendasi-render-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  min-height: 50vh;
}

.rekomendasi-render-loading p {
  font-size: 1.5rem;
  color: #147574;
  font-weight: 700;
  text-align: center;
}

.rekomendasi-render-loading__bar {
  width: 80%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 99px;
  overflow: hidden;
}

.rekomendasi-render-loading__fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.15s ease;
}

/* ============================================================
   PREVIEW AREA (hasil render)
============================================================ */
.rekomendasi-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.rekomendasi-preview__images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  width: 100%;
}

.rekomendasi-preview__surat-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rekomendasi-preview__surat-label {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 6px;
  text-align: center;
  width: 100%;
}

.rekomendasi-preview__surat-img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: block;
  margin: 0 auto;
}

/* ============================================================
   CONTROL AREA (status + progress + tombol)
============================================================ */
.rekomendasi-preview__control {
  align-self: center;
  width: 100%;
  max-width: 600px;
  padding: 1.5rem 0 2.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.rekomendasi-preview__status {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--primary, #2563eb);
  font-weight: 500;
  width: 100%;
  line-height: 1.5;
}

.rekomendasi-preview__progress-wrap {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 99px;
  overflow: hidden;
  margin: 0 auto 1.5rem;
}

.rekomendasi-preview__progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary, #2563eb);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Navigation buttons */
.rekomendasi-preview__nav {
  width: 100%;
  margin: 0 auto;
  gap: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rekomendasi-preview__nav .rekomendasi-btn {
  padding: 0.75rem 0.5rem;
  margin: 0;
  width: 40%;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 550px) {
  .rekomendasi-page {
    padding: 1.4rem;
  }

  .rekomendasi-page h1 {
    font-size: 1.45rem;
  }
}
