@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  font-family: 'Poppins', sans-serif;
  background-color: #f5f7fa;
  position: relative;
  z-index: 1;
}

body {
  padding: 0;
  margin: 0;
}

.container-xl, .container {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  transform: translateX(0);
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar .logo-area {
  background-color: #2B2F9A;
  padding: 20px;
  text-align: center;
}

.sidebar .logo-area img {
  height: 60px;
}

.sidebar .sidebar-heading {
  padding: 15px 20px 5px;
  font-size: 12px;
  font-weight: bold;
  color: #2B2F9A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar .isi {
  margin-bottom: 10px;
}

.sidebar .nav-link {
  display: block;
  padding: 10px 20px;
  color: #2B2F9A;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease-in-out;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: #f0f0f0;
  color: #1a1a1a;
  border-radius: 5px;
}

/* MAIN CONTENT */
.main-content {
  margin-left: 240px;
  padding: 40px;
  background-color: #f5f7fa;
  min-height: 100vh;
  transition: margin-left 0.3s ease-in-out;
  z-index: 1;
  position: relative;
}

.card {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  text-align: center;
}

/* TABEL */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.table-responsive th,
.table-responsive td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

/* Tombol dan warna */
.btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
}

.btn-primary {
  background: #9490ff50;
  border: none;
  color: #4541af;
}

.btn-success {
  background: #00d25b50;
  border: none;
  color: #00d25b;
}

.btn-red {
  background-color: red;
  border: none;
  color: white;
  font-weight: bold;
}

.btn-purple:hover {
  background: #1a12fd;
  border: none;
}

/* Judul */
.heading {
  font-size: 3em;
  text-align: center;
}

.sub-heading {
  font-size: 2em;
  text-align: center;
}

.navbar {
  margin-top: 15px;
}

/* Form / Card styling */
.card-register {
  width: 90%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #bcd0e5;
  border-radius: 5px;
  padding: 20px;
}

.card-person {
  background-color: #3B3B98;
  color: white;
  border-radius: 10px;
  padding: 20px;
  margin: 10px auto;
  text-align: center;
}

.card-person i {
  font-size: 2rem;
}

.card-title {
  font-weight: bolder;
}

.gambar-penyakit,
img.img-fluid {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  margin: 15px auto;
}

/* OVERLAY untuk mobile */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: none;
  transition: all 0.3s ease-in-out;
}

.overlay.active {
  display: block;
}

/* TOGGLE BUTTON */
.menu-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  background: #2B2F9A;
  color: white;
  padding: 6px 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.menu-toggle::before {
  content: "\2261";
  font-size: 18px;
  line-height: 1;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 80vw;
    max-width: 300px;
    background-color: #2B2F9A;
    color: white;
    box-shadow: 5px 0 15px rgba(0,0,0,0.3);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar .sidebar-heading,
  .sidebar .nav-link {
    color: white;
  }

  .sidebar .nav-link:hover,
  .sidebar .nav-link.active {
    background-color: #ffffff33;
    color: #fff;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
    padding-top: 70px;
  }

  .card {
    padding: 20px;
    margin-top: 10px;
  }

  .card-deck {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    margin-top: 10px;
  }

  .kiri,
  .kanan {
    width: 100%;
    float: none;
    padding: 10px;
  }

  .heading, .sub-heading {
    text-align: center;
  }

  .navbar .container-xl {
    padding-left: 10px;
    padding-right: 10px;
  }

  .navbar-brand {
    width: 100%;
    text-align: center;
    white-space: normal;
  }

  .navbar-brand h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    word-break: break-word;
    padding: 5px 10px;
  }

  .card.w-50 {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .heading {
    font-size: 2em;
  }

  .sub-heading {
    font-size: 1.5em;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .navbar-brand h3 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 5px 10px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-control {
    font-size: 14px;
    padding: 10px;
  }
}
