/* ================================== */
/* GAYA GLOBAL & DASAR                */
/* ================================== */
:root {
  --primary-color: #2a7854;
  --secondary-color: #d9eee1;
  --background-color: #f0f4f2;
  --text-color: #333333;
  --subtle-text-color: #888;
  --white-color: #ffffff;
  --trend-up-color: #28a745;
  --trend-down-color: #dc3545;
  --border-color: #e0e0e0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #e9ecef; /* Latar belakang luar kontainer */
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ================================== */
/* LAYOUT UTAMA                     */
/* ================================== */
.mobile-container {
  width: 100%;
  max-width: 420px;
  height: 100vh;
  /* max-height: 840px; Hapus max-height agar responsif di layar tinggi */
  background-color: var(--background-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border-radius: 16px; /* Radius tetap ada untuk tampilan desktop */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Tampilan Penuh di Mobile Kecil */
@media (max-width: 480px) {
  .mobile-container {
    border-radius: 0; /* Hilangkan radius di HP agar full screen */
    height: 100vh;
    max-height: none;
  }
}

.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  padding-bottom: 90px; /* Ruang agar tidak tertutup nav bawah */
}

/* ================================== */
/* GAYA HALAMAN DALAM (BUDIDAYA, DLL) */
/* ================================== */

/* Background khusus untuk halaman dalam */
.inner-page-bg {
  background-color: var(--background-color);
}

.inner-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0 1.5rem; /* Padding disesuaikan */
  color: var(--text-color);
}

.inner-header .back-button {
  font-size: 1.8rem;
  color: var(--text-color);
}

.inner-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Judul Sub di bawah header */
.page-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0 1.5rem; /* Padding agar sejajar dengan konten */
}

/* Menyesuaikan padding konten utama di halaman dalam */
.inner-page-bg .main-content {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* ================================== */
/* DAFTAR TAHAP BUDIDAYA            */
/* ================================== */
.tahap-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.5rem; /* Padding agar sejajar dengan konten */
}

.tahap-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--secondary-color);
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tahap-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tahap-card img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0; /* Mencegah gambar menyusut */
}

.tahap-info {
  flex-grow: 1;
}

.tahap-info h3 {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.tahap-info h3 b {
  font-weight: 600;
}

.tahap-info p {
  font-size: 0.85rem;
  color: var(--subtle-text-color);
}

.tahap-card iconify-icon {
  font-size: 1.8rem;
  color: var(--subtle-text-color);
}

/* ================================== */
/* HALAMAN TAHAP AWAL         */
/* ================================== */

.inner-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  padding-bottom: 0.5rem;
}

.inner-header .back-button {
  font-size: 1.8rem;
}

.inner-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ================================== */
/* NAVIGASI TAB                     */
/* ================================== */
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0;
  font-weight: 500;
  color: var(--subtle-text-color);
  position: relative;
  transition: color 0.3s ease;
}

.tab-item.active {
  color: var(--primary-color);
  font-weight: 600;
}

/* Garis bawah untuk tab aktif */
.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

/* ================================== */
/* BAR PENCARIAN                    */
/* ================================== */
.search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-bar iconify-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--subtle-text-color);
}

.search-bar input {
  width: 100%;
  padding: 14px 14px 14px 50px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  background-color: var(--white-color);
}
.search-bar input::placeholder {
  color: var(--subtle-text-color);
}

/* ================================== */
/* DAFTAR ARTIKEL                   */
/* ================================== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: var(--secondary-color);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.article-info {
  flex: 1;
}

.category-tag {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.article-info h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-color);
}

.article-card img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
}

/* ================================== */
/* GAYA FLOATING ACTION BUTTON (FAB)  */
/* ================================== */
.fab {
  position: absolute;
  bottom: 2rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-color);
  color: var(--white-color);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(42, 120, 84, 0.4);
  z-index: 10;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none; /* Tombol tidak bisa diklik saat tersembunyi */
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.mobile-container.video-tab-active .fab {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto; /* Tombol bisa diklik lagi */
}

.fab:hover {
  transform: scale(1.05);
}

.fab iconify-icon {
  font-size: 1.4rem;
}

/* ================================== */
/* GAYA HALAMAN KALKULATOR TANI       */
/* ================================== */
.calculator-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem; /* Memberi sedikit jarak dari header */
}

.calculator-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--white-color);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--secondary-color);
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculator-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
  border-color: var(--primary-color);
}

.calc-icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background-color: var(--secondary-color);
  border-radius: 12px;
}

.calc-icon-wrapper iconify-icon {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.calculator-item span {
  flex-grow: 1;
}

.calculator-item .chevron {
  font-size: 1.8rem;
  color: var(--border-color);
}

/* ================================== */
/* GAYA HALAMAN FORM KALKULATOR       */
/* ================================== */
.calculator-form {
  background-color: var(--white-color);
  padding: 1.5rem;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef2f0;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group:last-of-type {
  margin-bottom: 2rem; /* Jarak lebih besar sebelum tombol */
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

/* Penampung untuk select agar bisa diberi custom arrow */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none; /* Agar bisa klik select di bawahnya */
}

.calculator-form input[type="number"],
.calculator-form select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem; /* Ukuran font aman untuk iOS agar tidak zoom */
  font-family: "Poppins", sans-serif;
  background-color: var(--white-color);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none; /* Menghilangkan arrow default */

  /* --- UPDATE RESPONSIVE --- */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%; /* Mencegah elemen melebar keluar kontainer */
}

/* Khusus Select: Tambah padding kanan agar teks tidak tertabrak icon */
.calculator-form select {
  padding-right: 3rem; /* Ruang untuk ikon kustom */
  cursor: pointer;
}

.calculator-form input[type="number"]::placeholder {
  color: var(--subtle-text-color);
}

.calculator-form select {
  color: var(--text-color);
}

/* Memberi warna abu-abu untuk placeholder select */
.calculator-form select:required:invalid {
  color: var(--subtle-text-color);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.input-group input {
  flex-grow: 1; /* Input angka mengambil sisa ruang */
  width: 0; /* Trik flexbox agar input mengecil jika sempit */
  min-width: 0;
}

.input-group .unit-selector {
  flex-shrink: 0;
  width: 90px; /* Lebar tetap untuk unit */
}

/* Perbaikan Responsive untuk Input Group di layar sangat kecil */
@media (max-width: 360px) {
  .input-group .unit-selector {
    width: 75px; /* Perkecil unit selector */
  }
  .calculator-form input[type="number"],
  .calculator-form select {
    padding: 12px 10px; /* Kurangi padding */
    font-size: 0.9rem;
  }
}

.btn-calculate {
  width: 100%;
  padding: 1rem;
  background-color: var(--primary-color);
  color: var(--white-color);
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-calculate:hover {
  background-color: #226345; /* Warna sedikit lebih gelap saat hover */
  transform: translateY(-2px);
}

/* ================================== */
/* GAYA HASIL KALKULATOR              */
/* ================================== */
.calculation-result {
  background-color: var(--white-color);
  padding: 1.5rem;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef2f0;
  margin-top: 2rem; /* Jarak dari form di atas */
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calculation-result h2 {
  text-align: center;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.result-group {
  margin-bottom: 1.5rem;
}

.result-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  display: block;
}

.result-display-group {
  display: flex;
  gap: 0.75rem;
}

.result-value {
  flex-grow: 1;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  background-color: var(--background-color);
  text-align: left;
  color: var(--text-color);
  outline: none;
}

.result-unit {
  flex-shrink: 0;
  width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--white-color);
  font-weight: 500;
  font-size: 1rem;
}

.result-recommendations h3,
.result-tips p b {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.result-recommendations ul {
  list-style-position: inside;
  padding-left: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.result-tips {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--subtle-text-color);
  line-height: 1.6;
}

.result-tips p {
  margin: 0;
}

.result-tips p:first-child {
  margin-bottom: 0.25rem;
}

/* Kelas utilitas untuk menyembunyikan elemen */
.hidden {
  display: none;
}
