/* style.css */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #e0f7fa, #f3f4f6, #dbeafe);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background-color: #fff;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
}

h2 {
  text-align: center;
  color: #333;
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  color: #333;
  margin-bottom: 8px;
  font-weight: 500;
}

input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

select#gender {
  width: 100%;
  padding: 10px 12px;
  padding-right: 36px; /* Tambahkan ruang di kanan untuk panah */
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
  background-color: white;

  /* Hanya hilangkan default appearance untuk dropdown ini saja */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* Tambahkan panah dropdown secara manual */
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}

select#gender:focus {
  border-color: #26c6da;
  outline: none;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
  border-color: #26c6da;
  outline: none;
}

.radio-group {
  display: flex;
  gap: 20px;
  margin-top: 5px;
}

.radio-group label {
  font-weight: normal;
}

.voucher-group {
  margin-top: 50px; /* jarak tambahan di atas field kode voucher */
}

#voucherCode {
  font-family: monospace;
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  font-size: 0.9em;
  margin-left: 5px;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 280px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 5px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* tampil di atas icon ℹ️ */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85em;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%; /* panah ke bawah */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.voucher-link {
  margin-top: 0.5em;
  font-size: 0.9em;
}

.voucher-link a {
  color: #007bff;
  font-weight: bold;
  text-decoration: none;
}

.voucher-link a:hover {
  text-decoration: underline;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background-color: #26c6da;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-btn:hover {
  background-color: #00acc1;
}

.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 400px) {
  .container {
    padding: 20px;
  }
  .triangle-number {
    font-size: 2.8vw;
  }
}

.result {
  background-color: #f4f4f4;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.hidden {
  display: none;
}

/* Pastikan spinner terlihat normal di semua browser */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
  background-color: white;
  font-family: "Segoe UI", sans-serif;
}

/* Fokus */
input[type="number"]:focus {
  border-color: #26c6da;
  outline: none;
}

.result-container {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 32px;
}

/* Untuk judul */
#resultContainer h2 {
  margin-top: 0 !important; /* hilangkan margin bawaan <h2> */
  padding-top: 0 !important;
}

@media (max-width: 900px) {
  .result-container {
    max-width: 100%;
    padding: 0 16px; /* lebih ramping di mobile */
  }
  .result-card {
    padding: 25px 10px;
  }
}

.result-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  padding: 40px 40px;
  transition: all 0.3s ease;
}

.result-title {
  font-size: 2.2em;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 10px;
}

.result-item {
  background-color: #fffbb9;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 15px;
  color: #444;
  line-height: 1.5;
}

/* ...existing code... */
.result-root {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 auto;
  max-width: 280px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: background-color 0.4s ease;
  font-weight: bold;
  font-size: 18px;
  color: #000000;
}

/* Gaya ikon elemen */
/* Ikon elemen */
.element-icon {
  font-size: 42px;
  margin-bottom: 10px;
  animation-duration: 0.6s;
  animation-fill-mode: both;
}

/* AIR – naik perlahan */
.animate-air {
  animation-name: floatDown;
  animation-iteration-count: infinite;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
}
@keyframes floatDown {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(20px);
    opacity: 0;
  }
}

/* API – berkedip api */
.animate-api {
  animation-name: firePulse;
  animation-iteration-count: infinite;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
}
@keyframes firePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* LOGAM – muncul dari bawah */
.animate-logam {
  animation-name: spinRotate;
  animation-iteration-count: infinite;
  animation-duration: 2s;
  animation-timing-function: linear; /* agar rotasi konstan */
}
@keyframes spinRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* TANAH – mengembang */
.animate-tanah {
  animation-name: growEarth;
  animation-iteration-count: infinite;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
}
@keyframes growEarth {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* KAYU – dari samping */
.animate-kayu {
  animation-name: fadeIn;
  animation-iteration-count: infinite;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Elemen khusus (warna background + teks isi) */
.result-root.air {
  background-color: #e0f7fa;
}
.result-root.logam {
  background-color: #eeeeee;
}
.result-root.api {
  background-color: #ffebee;
}
.result-root.tanah {
  background-color: #f3e5ab;
}
.result-root.kayu {
  background-color: #efebe9;
}

/* Warna isi teks (dalam <span>) */
.result-root.air #resultRootNumber,
.result-root.air #resultRootElement {
  color: #0277bd;
}
.result-root.logam #resultRootNumber,
.result-root.logam #resultRootElement {
  color: #616161;
}
.result-root.api #resultRootNumber,
.result-root.api #resultRootElement {
  color: #d32f2f;
}
.result-root.tanah #resultRootNumber,
.result-root.tanah #resultRootElement {
  color: #6d4c41;
}
.result-root.kayu #resultRootNumber,
.result-root.kayu #resultRootElement {
  color: #795548;
}

/* Transisi warna teks */
#resultRootNumber,
#resultRootElement {
  transition: color 0.4s ease;
}
/* ...existing code... */

.result-separator {
  border: none;
  border-top: 2px solid #ddd;
  margin: 10px 0;
}

.hidden {
  display: none !important;
}

.triangle-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 40px auto;
}

.triangle-bg {
  width: 100%;
  height: auto;
  display: block;
}

.triangle-number {
  position: absolute;
  color: #000;
  font-weight: bold;
  font-size: clamp(
    10px,
    3vw,
    22px
  ); /* Responsive: min 10px, ideal 3vw, max 22px */
  text-align: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  line-height: 2.4em;
  transform: translate(-50%, -50%);
  /* angka lebih presisi di tengah lingkaran */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Contoh koordinat posisi (sesuaikan agar pas dengan triangle.png) */
.triangle-number.A {
  top: 14%;
  left: 27.5%;
}
.triangle-number.B {
  top: 14%;
  left: 32.5%;
}
.triangle-number.C {
  top: 14%;
  left: 41%;
}
.triangle-number.D {
  top: 14%;
  left: 46%;
}
.triangle-number.E {
  top: 14%;
  left: 55%;
}
.triangle-number.F {
  top: 14%;
  left: 60%;
}
.triangle-number.G {
  top: 14%;
  left: 65.5%;
}
.triangle-number.H {
  top: 14%;
  left: 70.8%;
}

.triangle-number.I {
  top: 34%;
  left: 34.5%;
}
.triangle-number.J {
  top: 34%;
  left: 44%;
}
.triangle-number.K {
  top: 34%;
  left: 54%;
}
.triangle-number.L {
  top: 34%;
  left: 64%;
}

.triangle-number.M {
  top: 48.5%;
  left: 44%;
}
.triangle-number.N {
  top: 48.5%;
  left: 54%;
}

.triangle-number.O {
  top: 62%;
  left: 49%;
}
.triangle-number.P {
  top: 78%;
  left: 44.5%;
}
.triangle-number.Q {
  top: 78%;
  left: 53.5%;
}
.triangle-number.R {
  top: 89%;
  left: 49%;
}

.triangle-number.S {
  top: 68%;
  left: 21%;
}
.triangle-number.T {
  top: 68%;
  left: 27.5%;
}
/*.triangle-number.U { top: 68%; left: 10.5%; }*/

.triangle-number.V {
  top: 68%;
  left: 71.5%;
}
.triangle-number.W {
  top: 68%;
  left: 77.5%;
}
/*.triangle-number.X { top: 68%; left: 87%; }*/

#triangleContainer {
  margin-top: 0px !important; /* jarak atas diperkecil */
  margin-bottom: 0px !important; /* jarak bawah diperkecil */
  padding: 0 !important; /* buang padding default */
}

.result-combination-section {
  margin-top: 30px;
}

#rootCharacterDescription {
  text-align: justify;
}

.result-combination-section h3 {
  font-size: 1.5em;
  color: #007bff;
  font-weight: bold;
  margin-bottom: 0.3em;
}

.result-combination-section p {
  font-size: 1em;
  line-height: 1.6;
  /*margin: 0.2em 0;*/
}

.career-business-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* tetap 2 kolom */
  column-gap: 2em; /* hanya jarak antar kolom */
  row-gap: 0; /* jangan tambah jarak vertikal */
}

/* Bagian untuk kolom karir dan bisnis*/
.career-business-grid h4 {
  font-size: 1.2em;
  color: #444;
  margin-top: 0; /* hilangkan jarak atas berlebih */
  margin-bottom: 0.5em;
}

.career-business-grid ul {
  font-size: 1em;
  line-height: 1.6;
  padding-left: 1.2em;
}

/* Responsive: kalau layar kecil, jadikan 1 kolom */
@media (max-width: 768px) {
  .career-business-grid {
    grid-template-columns: 1fr;
  }
}
/* End of bagian kolom karir dan bisnis*/

#btnPrint {
  background: linear-gradient(to bottom, #4da3ff, #0056b3);
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px #003d80;
  transition: all 0.2s ease-in-out;
  /* Properti baru untuk menengahkan tombol */
  display: block; /* Mengubah elemen inline menjadi block */
  margin: 20px auto; /* Memberikan margin otomatis untuk menengahkan */
}

#btnPrint:hover {
  background: linear-gradient(to bottom, #66b5ff, #004a99);
}

#btnPrint:active {
  box-shadow: 0 2px #003d80; /* seolah ditekan */
  transform: translateY(4px);
}

@media print {
  body {
    font-size: 12pt; /* ukuran lebih proporsional untuk PDF */
    line-height: 1.6;
  }

  /* Hilangkan animasi saat print */
  .element-icon {
    animation: none !important;
    transform: none !important;
  }

  /* Kalau perlu ganti emoji ke versi statis */
  .element-icon {
    content: attr(data-static); /* misalnya ambil dari atribut data-static */
  }

  button,
  .no-print {
    display: none; /* tombol atau elemen yang tidak perlu */
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid; /* jangan potong judul di akhir halaman */
  }

  .section {
    page-break-inside: avoid; /* biar satu section tidak kepotong */
  }

  #triangleContainer {
    zoom: 0.65; /* perkecil layout sekaligus tampilan */
    page-break-inside: avoid;
    break-inside: avoid;
  }

  #btnPrint {
    display: none !important;
  }
}
