/*NAVIGASI GLOBAL*/

.header-custom {
  background-color: #5c4b4b;
  color: #fff;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.header-title {
  font-weight: bold;
  margin: 0;
}

/* NAVBAR DESKTOP */
.header-nav {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-right: 25px;
}

.header-nav a {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 0;
  transition: 0.25s;
}

.header-nav a:hover {
  color: #e8d2d2;
}

/* ===================================
   HAMBURGER
====================================== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: white;
  border-radius: 5px;
  transition: 0.3s ease;
}

/* Aktif link navbar (halaman yang sedang dibuka) */
.nav-active {
  color: #e8d2d2 !important;
  font-weight: 600;
}

/* Info box khusus halaman Tentang agar lebih besar */
.content-home-left .info-box ul {
  text-align: left;
  font-size: 1rem;
  margin-left: 20px;
  margin-bottom: 15px;
}

.content-home-left .info-box p {
  font-size: 1rem;
  margin-bottom: 12px;
}

/* ===================================
   RESPONSIVE
====================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .header-nav {
    display: none;
    flex-direction: column;
    background-color: #5c4b4b;
    width: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    z-index: 10;
    padding: 10px 0;
  }

  .header-nav a {
    padding: 12px 20px;
    border-bottom: 1px solid #744f4f;
    color: white;
  }

  .header-nav.nav-show {
    display: flex;
  }

  /* Hamburger jadi X */
  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .content-home-left {
    padding-left: 20px;
  }
}

/* hilangkan underline */
a {
  text-decoration: none;
}

.box.active {
  background-color: #333; 
  color: #fff;
  transition: 0.3s;
}

.box img {
  filter: brightness(1); 
}

.box.active img {
  filter: brightness(0.8); 
}

/* Index */
/* ===== Umum ===== */
body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
}

header {
  background-color: #5c4b4b;
  color: rgb(255, 255, 255);
  text-align: center;
  padding: 1rem 0;
  font-weight: bold;
}

main.content.content-home {
  position: relative;
  min-height: 100vh; 
  display: flex; 
  justify-content: center;
  align-items: center;
}

/* Background gambar ayam dokter */
main.content.content-home::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("gambar/latar_index.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover; 
  opacity: 0.6; 
  z-index: 0;
  pointer-events: none; 
}

/* Supaya teks dan tombol tetap di atas gambar */
main.content.content-home > * {
  position: relative;
  z-index: 1;
}

main.content.content-home .info-box {
  background-color: rgba(255, 255, 255, 0.4); 
  border-radius: 15px;
  padding: 40px 30px;
  max-width: 500px;
  margin: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px); 
}

main.content.content-home .info-box h2 {
  color: #3b2f2f;
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 20px;
}

main.content.content-home .info-box .btn-custom {
  background-color: #5c4b4b;
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 12px 25px;
  border-radius: 15px;
  transition: 0.3s;
}

main.content.content-home .info-box .btn-custom:hover {
  background-color: #6f442d;
}

/* ===== Sidebar ===== */
.sidebar {
  background-color: #f8f3f3;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #ddd;
}

.sidebar a:hover {
  background-color: #e0e0e0;
}

.sidebar img {
  width: 20px;
  margin-right: 10px;
}

/* ===== Konten Utama ===== */
.content {
  height: 100%;
  background-color: #ddd;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.content h2 {
  color: #5c4b4b;
  font-weight: bold;
}

.btn-custom {
  background-color: #5c4b4b;
  color: white;
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  text-decoration: none;
}
.container-fluid,
.row {
  height: calc(100vh - 72px); 
}
/* ===== Responsif Tablet ===== */
@media (max-width: 1024px) {
  .sidebar a {
    white-space: normal !important; 
    word-wrap: break-word;
    font-size: 0.8rem; 
    padding: 8px;
  }
}

/* ===== Responsif HP ===== */
@media (max-width: 768px) {
  .sidebar {
    display: flex; 
    flex-direction: row !important;
    flex-wrap: wrap; 
    height: auto;
  }

  .sidebar a {
    flex: 1 1 33.33%; 
    box-sizing: border-box; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 0.85rem;
  }

  .sidebar a:nth-child(3n) {
    border-right: none;
  }

  .sidebar a:nth-last-child(-n + 3) {
    border-bottom: none;
  }

  .sidebar img {
    width: 18px;
    margin: 0;
  }
}

/* Halaman Login Admin */
.login-body {
  background-color: #5c4b4b !important;
}

.login-box {
  background-color: #f0f0f0;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  border-radius: 10px;
}

.btn-login {
  background-color: #5c4b4b;
  color: #fff;
  border-radius: 10px;
}

.btn-login:hover {
  background-color: #4a3e3e;
}

/* Halaman Admin */

/* Main content sejajar dengan sidebar */
main {
  padding: 0;
  height: 93vh;
  overflow-y: auto; 
  display: flex;
  flex-direction: column;
}

/* Box container */
.box-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between; 
  align-items: stretch; 
  gap: 0.5rem; 
  flex: 1;
  margin: 0; 
  padding: 0.5rem; 
  box-sizing: border-box;
}

/* Box style */
.box {
  flex: 1 1 calc(25% - 0.5rem); 
  min-height: 160px;
  border-radius: 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Label teks */
.box div {
  font-size: 0.9rem;
  font-weight: 400;
}

/* Hover effect */
.box:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Icon styling */
.box img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

/* Warna box */
.box-gejala {
  background: linear-gradient(135deg, #4db8ff, #0077cc);
}

.box-penyakit {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.box-pengetahuan {
  background: linear-gradient(135deg, #e0b343, #c28a00);
}

.box-riwayat {
  background: linear-gradient(135deg, #546e7a, #37474f);
}

/* Responsif HP: jadi 2 kolom */
@media (max-width: 768px) {
  .box {
    flex: 1 1 calc(50% - 0.5rem);
    min-height: 130px;
  }
}

/* Responsif layar kecil: 1 kolom */
@media (max-width: 480px) {
  .box {
    flex: 1 1 100%;
  }
}

/* =============================
   PIE CHART STYLE
   ============================= */

/* Pembungkus chart agar tetap proporsional */
.chart-wrapper {
  position: relative;
  margin: 0 auto;
  background: transparent;
  border-radius: 20px;
  padding: 20px;
  width: 500px; 
  height: 500px; 
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: none;
  transition: all 0.3s ease;
}

/* Animasi hover lembut */
.chart-wrapper:hover {
  transform: scale(1.02);
  box-shadow: none;
}

/* Canvas chart agar fleksibel di dalam container */
.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Jika di layar kecil, otomatis kecil */
@media (max-width: 768px) {
  .chart-wrapper {
    width: 90%;
    height: auto;
    min-height: 300px;
  }
}

/*INFORMASI TERNAK*/

/*  Area utama di bawah header */
main.informasi-main {
  display: flex;
  justify-content: center; 
  align-items: center; 
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Background khusus di main */
main.informasi-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("gambar/latar_index.png") no-repeat center center;
  background-size: cover;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

/* Kotak form */
main.informasi-main .info-form {
  position: relative;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  max-width: 700px;
  width: 100%;
  padding: 40px;
  animation: fadeIn 0.8s ease;
}

/* Judul */
main.informasi-main .info-form h5 {
  color: #3b2f2f;
  font-weight: 700;
}

/* Label & Input */
main.informasi-main .info-form .form-label {
  font-weight: 600;
  color: #2c2c2c;
}

main.informasi-main .info-form .form-control {
  border-radius: 10px;
  border: 1px solid #bfbfbf;
  padding: 10px;
  transition: 0.2s;
}

main.informasi-main .info-form .form-control:focus {
  border-color: #5c4b4b;
  box-shadow: 0 0 8px rgba(92, 75, 75, 0.3);
}

/* Tombol */
main.informasi-main .info-form .btn-kirim {
  background-color: #5c4b4b;
  color: white;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 25px;
  transition: all 0.3s ease;
}

main.informasi-main .info-form .btn-kirim:hover {
  background-color: #6f442d;
  transform: translateY(-2px);
}

/* nimasi muncul lembut */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table th,
.table td {
  vertical-align: middle;
}

/* Styling khusus halaman Riwayat Diagnosa */

.riwayat-table {
  width: 100%;
}

.riwayat-card {
  border-radius: 15px;
  background-color: #fffdf9;
}

.riwayat-header {
  background-color: #5c4b4b;
  color: #fff;
  border-radius: 15px 15px 0 0;
}

.riwayat-btn {
  background-color: #5c4b4b;
  border: none;
  color: #fff;
}
.riwayat-btn:hover {
  background-color: #5a3f2e;
}

.riwayat-table thead {
  background-color: #5c4b4b !important;
  color: #fff !important;
}

.riwayat-table tbody tr:hover {
  background-color: #f5f0eb;
}

.riwayat-table td,
.riwayat-table th {
  font-size: 0.9rem;
  vertical-align: middle !important;
}

.riwayat-badge {
  background-color: #a9a9a9;
  font-size: 0.85rem;
}

/* ============ SIDEBAR KHUSUS HALAMAN RIWAYAT ============ */
.riwayat-page .sidebar {
  width: 60px;
  background-color: #f8f3f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.riwayat-page .sidebar a {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  width: 100%;
}

.riwayat-page .sidebar img {
  width: 24px;
  height: 24px;
}

/* Konten utama bergeser ke kanan */
.riwayat-page .main-content {
  margin-left: 60px;
  padding: 1rem;
}

/* Input Gejala */

/* ===== Layout ===== */
.container-main {
  display: flex;
  min-height: 100vh;
}

.input_content {
  flex: 1;
  padding: 20px;
}

/* ===== Card ===== */
.card-gejala {
  background: #d9d9d9;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

/* ===== Table ===== */
.gejala-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.gejala-table th,
.gejala-table td {
  text-align: center;
  padding: 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.gejala-table th {
  font-weight: 600;
  text-transform: capitalize;
}

.gejala-table td:first-child {
  text-align: right;
  font-weight: 500;
  width: 40px;
}

.gejala-table td:nth-child(2) {
  text-align: left;
  padding-left: 8px;
  width: 220px;
  white-space: normal;
}

/* ===== Radio ===== */
.radio-wrap {
  display: flex;
  justify-content: center; 
  align-items: center; 
  margin: 0 auto;
  font-size: 0.85rem;
}

.radio-wrap input[type="radio"] {
  margin-right: 6px;
  transform: scale(1.1);
}

/* Desktop & tablet: sembunyikan label */
.radio-wrap span {
  display: none;
}

/* ===== Tombol submit ===== */
.btn-submit {
  background: #5c4b4b;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  transition: background 0.2s ease-in-out;
}
.btn-submit:hover {
  background: #472f23;
}
.btn-submit:active {
  background: #2f1d15;
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 1024px) {
  .input_content {
    padding: 15px;
  }
  .gejala-table {
    min-width: 100%;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .gejala-table {
    min-width: 100%;
  }

  .gejala-table thead {
    display: none; 
  }

  .gejala-table tr {
    display: block;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .gejala-table td {
    display: block;
    text-align: left !important;
    width: 100% !important;
    padding: 6px 4px;
  }

  .gejala-table td:first-child {
    display: none; 
  }

  .gejala-table td:nth-child(2) {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
  }

  /* Mobile: radio + label ditampilkan */
  .radio-wrap {
    justify-content: flex-start;
    background: #f9f9f9;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.8rem;
  }
  .radio-wrap span {
    display: inline;
    margin-left: 4px;
  }
  .radio-wrap input[type="radio"] {
    transform: scale(1.1);
  }

  .btn-submit {
    width: 100%;
    font-size: 0.95rem;
    padding: 10px;
    margin-top: 8px;
  }
}

/* ==========================
   HASIL DIAGNOSA STYLE (RAMAFIX)
   ========================== */
main.hasil-main {
  position: relative;
  min-height: calc(100vh - 80px); 
  padding: 100px 20px 60px; 
  background: url("gambar/latar_index.png") no-repeat center center;
  background-size: cover;
  z-index: 1;
}

/* efek blur lembut untuk kotak hasil */
main.hasil-main .hasil-box {
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  padding: 30px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.8s ease;
}

/* tombol dan tabel tetap pakai tema sama */
main.hasil-main .btn-kembali {
  background-color: #5c4b4b;
  color: #fff;
  border-radius: 10px;
  padding: 10px 25px;
  transition: 0.3s;
}

main.hasil-main .btn-kembali:hover {
  background-color: #6f442d;
  transform: translateY(-2px);
}

/* =======================================
   MODAL VALIDASI (KHUSUS #modalValidasi)
   Tema coklat #5c4b4b
   ======================================= */

#modalValidasi .modal-content {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(92, 75, 75, 0.25);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

/* HEADER coklat */
#modalValidasi .modal-header {
  background: #5c4b4b;
  color: #fff;
  border-bottom: none;
  padding: 14px 16px;
}

#modalValidasi .modal-title {
  font-weight: 600;
  font-size: 16px;
}

/* BODY */
#modalValidasi .modal-body {
  padding: 16px;
  font-size: 14px;
}

/* FOOTER coklat */
#modalValidasi .modal-footer {
  background: #5c4b4b;
  border-top: none;
  padding: 12px 16px;
  gap: 10px;
}

/* Button footer */
#modalValidasi .modal-footer .btn {
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
}

/* Tombol Batal */
#modalValidasi .modal-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
}

#modalValidasi .modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Tombol Lanjut Diagnosa */
#modalValidasi .modal-footer .btn-primary {
  background: #fff;
  border: none;
  color: #5c4b4b;
}

#modalValidasi .modal-footer .btn-primary:hover {
  background: #f2f2f2;
}

/* RESPONSIF tambahan untuk HP */
@media (max-width: 576px) {
  #modalValidasi .modal-dialog {
    margin: 12px;
  }

  #modalValidasi .modal-footer {
    justify-content: center;
  }

  #modalValidasi .modal-footer .btn {
    width: 100%;
  }
}

/* =======================================
   KONTEN POPUP VALIDASI (popup_validasi.php)
   Wrapper: .popup-validasi-cf
   ======================================= */

#modalValidasi .popup-validasi-cf {
  width: 100%;
}

/* Judul utama */
#modalValidasi .popup-validasi-cf h6 {
  margin: 0 0 14px 0;
  font-size: 14px;
  font-weight: 700;
  color: #5c4b4b;
}

/* Box tiap gejala */
#modalValidasi .popup-validasi-cf .popup-item {
  border: 1px solid rgba(92, 75, 75, 0.2);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  margin-bottom: 12px;
}

/* Nama gejala */
#modalValidasi .popup-validasi-cf .popup-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #2b2b2b;
}

/* Grid pilihan radio */
#modalValidasi .popup-validasi-cf .popup-radio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* RESPONSIF: 2 kolom */
@media (min-width: 576px) {
  #modalValidasi .popup-validasi-cf .popup-radio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* RESPONSIF: 3 kolom */
@media (min-width: 992px) {
  #modalValidasi .popup-validasi-cf .popup-radio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =======================================
   RADIO SAMA MODEL INPUT_GEJALA (radio-wrap)
   KHUSUS popup validasi
   ======================================= */

#modalValidasi .popup-validasi-cf .radio-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(92, 75, 75, 0.2);
  background: #fafafa;
  cursor: pointer;
  font-size: 13px;
  margin: 0;
  transition: 0.2s;
}

#modalValidasi .popup-validasi-cf .radio-wrap:hover {
  border-color: #5c4b4b;
  background: rgba(92, 75, 75, 0.08);
}

#modalValidasi .popup-validasi-cf .radio-wrap input[type="radio"] {
  margin: 0;
  transform: scale(1.1);
  accent-color: #5c4b4b;
}

/* Di popup: teks harus tampil */
#modalValidasi .popup-validasi-cf .radio-wrap span {
  display: inline;
}