/* ================================== */
/* 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: 100dvh;
  overflow: hidden;
    
}

a {
  text-decoration: none;
  color: inherit;
}

/* ================================== */
/* LAYOUT UTAMA                     */
/* ================================== */
.mobile-container {
  width: 100%;
  max-width: 420px;
  height: 100dvh;
  background-color: var(--background-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  /* 90px untuk nav-bottom + ruang aman di bawahnya */
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

/* ================================== */
/* HEADER                           */
/* ================================== */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.home-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
}

.notification-icon {
  position: relative;
  font-size: 1.8rem;
  color: var(--primary-color);
}

.notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background-color: var(--trend-down-color);
  border-radius: 50%;
  border: 2px solid var(--background-color);
}

/* ================================== */
/* SEARCH BAR                       */
/* ================================== */
.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);
}

/* ================================== */
/* MENU SECTION                     */
/* ================================== */
.menu-section {
  margin-bottom: 2rem;
}

.menu-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.25rem;
  background-color: var(--white-color);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.menu-item iconify-icon {
  font-size: 2rem;
  color: var(--primary-color);
}

/* ================================== */
/* TRENDS SECTION                   */
/* ================================== */
.trends-section {
  margin-bottom: 1rem;
}

.trends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.trends-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.trends-header a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-color);
}

.trends-list .trend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--white-color);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color);
}

.item-icon-name {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}

.item-icon-name iconify-icon {
  font-size: 2rem;
  color: var(--subtle-text-color);
}

.item-price-trend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.item-price-trend > iconify-icon {
  font-size: 2.5rem;
}

.price-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-details .price {
  font-weight: 600;
  font-size: 1rem;
}

.price-details .change {
  font-size: 0.8rem;
}

.trend-up {
  color: var(--trend-up-color);
}

.trend-down {
  color: var(--trend-down-color);
}

/* ================================== */
/* BOTTOM NAVIGATION                */
/* ================================== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  background-color: var(--white-color);
  border-top: 1px solid var(--border-color);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--subtle-text-color);
  padding: 0.5rem;
  border-radius: 8px;
}

.nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

.nav-item iconify-icon {
  font-size: 1.5rem;
}

.nav-item.active {
  color: var(--primary-color);
  background-color: var(--secondary-color);
}

/* =========================================== */
/* GAYA HEADER HALAMAN (DIPERBARUI)            */
/* =========================================== */
/* =========================================== */
/* GAYA HEADER HALAMAN (KONSISTEN)             */
/* =========================================== */
.page-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background-color: var(--white-color); /* Latar belakang putih solid */
  border-bottom: 1px solid var(--border-color); /* Garis batas bawah */
  flex-shrink: 0;
}

.page-header h1 {
  flex-grow: 1;
  text-align: center;
  font-size: 1.125rem; /* Ukuran standar */
  font-weight: 600;
  margin-left: -28px; /* Kompensasi agar judul tetap di tengah */
}

.back-button svg {
  width: 28px;
  height: 28px;
}

/* TAMBAHKAN KODE INI DI BAWAHNYA */
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px; /* KUNCI: Menambah area klik di sekitar ikon */
  border-radius: 50%; /* Membuat area sentuh menjadi bulat */
  transition: background-color 0.2s ease;
}

.back-button:hover {
  background-color: #f0f0f0; /* Efek visual saat disentuh */
}

.back-button svg {
  width: 28px;
  height: 28px;
}

/* =========================================== */
/* GAYA KHUSUS HALAMAN KEMITRAAN (DIPERBARUI) */
/* =========================================== */
.page-main-title {
  font-size: 1.75rem; /* DIUBAH: Lebih besar */
  font-weight: 700; /* DIUBAH: Lebih tebal */
  margin-bottom: 1.5rem;
  padding: 0 1.5rem;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1.5rem;
}

.info-card {
  background-color: #ffffff; /* DIUBAH: Latar belakang menjadi putih */
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08); /* DIUBAH: Menambah bayangan lembut */
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.card-icon {
  width: 28px;
  height: 28px;
}
.card-icon img {
  width: 100%;
  height: 100%;
}

.card-meta {
  font-size: 0.85rem;
  color: #888;
  margin-top: 1rem;
}

.card-title {
  font-size: 1.3rem; /* DIUBAH: Lebih besar */
  font-weight: 700; /* DIUBAH: Lebih tebal */
  color: #222;
  margin-top: 0.25rem;
  line-height: 1.4;
}

.card-body-text {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.75rem;
  line-height: 1.6;
}

.card-media {
  margin-top: 1rem;
}

.card-media img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0; /* Garis lebih samar */
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f5f5f5; /* DIUBAH: Latar abu-abu muda */
  border: none; /* DIUBAH: Tanpa border */
  padding: 8px 16px;
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
}
.action-btn img {
  width: 16px;
  height: 16px;
}

/* =========================================== */
/* GAYA KHUSUS HALAMAN KALKULATOR TANI       */
/* =========================================== */
.calculator-page {
  /* Gradien latar belakang dihapus agar tidak menyatu dengan header */
  background-color: #eaf6f0;
}

/* Style .calculator-page .page-header sudah dihapus 
  sehingga akan menggunakan gaya .page-header standar di atas.
*/

.calculator-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.menu-card-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background-color: var(--white-color);
  border: 1px solid #c9dbd1;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.menu-card-icon {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.menu-card-text {
  flex-grow: 1;
  font-weight: 500;
  font-size: 1rem;
}

.menu-card-arrow {
  font-size: 1.5rem;
  color: var(--subtle-text-color);
}

/* ================================== */
/* PANEL NOTIFIKASI                   */
/* ================================== */

/* Lapisan Overlay Latar Belakang */
.notification-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;

  /* State awal (tersembunyi) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

/* State saat terlihat */
.notification-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Konten Panel Notifikasi */
.notification-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  height: 100%;
  background-color: var(--white-color);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;

  /* State awal (tersembunyi di kanan) */
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}

/* State saat terlihat */
.notification-overlay.visible .notification-content {
  transform: translateX(0);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.notification-header h2 {
  font-size: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--subtle-text-color);
  cursor: pointer;
}

.notification-list {
  flex-grow: 1;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.notification-item:hover {
  background-color: #f8f9fa;
}

/* Tanda belum dibaca */
.notification-item.unread {
  background-color: var(--secondary-color);
  border-left: 4px solid var(--primary-color);
  padding-left: calc(1.5rem - 4px);
}

.notification-icon-wrapper {
  font-size: 1.5rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.notification-text strong {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.notification-text p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #555;
}

.notification-text .timestamp {
  font-size: 0.8rem;
  color: var(--subtle-text-color);
  margin-top: 0.5rem;
  display: block;
}

/* CSS untuk Efek Transisi Header */
.header-content {
  position: relative;
  flex-grow: 1;
}

.timed-welcome,
.main-title {
  transition: opacity 0.5s ease-in-out;
}

.main-title {
  /* Awalnya, judul utama disembunyikan */
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Kelas ini akan ditambahkan oleh JavaScript */
.timed-welcome.hidden {
  opacity: 0;
}

.main-title.visible {
  opacity: 1;
}
