* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: url("../images/chili-bg.jpg") no-repeat center center fixed;
  background-size: cover;
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.nav-title h1 {
  color: white;
  font-size: 24px;
  text-align: center;
}

.nav-icon {
  width: 40px;
  height: 40px;
}

.nav-menu {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 5px;
  transition: background 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: rgba(255, 255, 255, 0.2);
}

/* Login Page */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
}

.login-container h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 28px;
}

.login-container > p {
  color: #666;
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #333;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #ff0000;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 14px;
}

.form-options a {
  color: #007bff;
  text-decoration: none;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-login:hover {
  transform: translateY(-2px);
}

.signup-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.signup-link a {
  color: #007bff;
  text-decoration: none;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #c62828;
}

.success-message {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #2e7d32;
}

/* Home Container */
.home-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.hero-section {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 30px;
}

.hero-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.hero-content {
  padding: 30px;
  text-align: center;
}

.hero-content h2 {
  color: #333;
  margin-bottom: 15px;
  font-size: 28px;
}

.hero-content p {
  color: #666;
  margin-bottom: 25px;
  font-size: 16px;
}

.btn-start {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: transform 0.2s;
}

.btn-start:hover {
  transform: translateY(-2px);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.info-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.info-card h3 {
  color: #ff0000;
  margin-bottom: 10px;
  font-size: 20px;
}

.info-card p {
  color: #666;
}

/* Diagnosa Container */
.diagnosa-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
}

.diagnosa-card {
  background: rgba(76, 175, 80, 0.95);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.diagnosa-card h2 {
  color: white;
  text-align: center;
  margin-bottom: 10px;
  font-size: 28px;
}

.subtitle {
  color: white;
  text-align: center;
  margin-bottom: 30px;
}

.gejala-list {
  background: white;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 25px;
}

.gejala-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

.gejala-item:hover {
  background: #f5f5f5;
}

.gejala-item input {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.gejala-item span {
  color: #333;
  font-size: 16px;
}

.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-proses,
.btn-reset {
  padding: 15px 40px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-proses {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
}

.btn-reset {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.btn-proses:hover,
.btn-reset:hover {
  transform: translateY(-2px);
}

/* Hasil Container */
.hasil-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
}

.hasil-card {
  background: rgba(76, 175, 80, 0.95);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  color: white;
}

.hasil-card h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 28px;
}

.penyakit-nama {
  background: white;
  color: #333;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  text-align: center;
}

.penyakit-nama h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.kode {
  background: #ff0000;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
}

.info-section {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.info-section h4 {
  margin-bottom: 10px;
  font-size: 18px;
}

.btn-cetak,
.btn-ulang {
  padding: 15px 40px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s;
}

.btn-cetak {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
}

.btn-ulang {
  background: white;
  color: #4caf50;
}

.btn-cetak:hover,
.btn-ulang:hover {
  transform: translateY(-2px);
}

/* Data Container */
.data-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.data-card {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.data-card h2 {
  color: #333;
  margin-bottom: 20px;
}

.btn-tambah {
  padding: 10px 25px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #f5f5f5;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.data-table th {
  font-weight: bold;
  color: #333;
}

.btn-edit,
.btn-hapus,
.btn-detail {
  padding: 5px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  margin-right: 5px;
  display: inline-block;
}

.btn-detail {
  background: #2196f3;
  color: white;
}

.btn-edit {
  background: #ff9800;
  color: white;
}

.btn-hapus {
  background: #f44336;
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-menu {
    flex-direction: column;
    gap: 10px;
  }

  .button-group {
    flex-direction: column;
  }

  .data-table {
    font-size: 14px;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }
}

/* Form Container */
.form-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px;
}

.form-card {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.form-wide {
  max-width: 100%;
}

.form-card h2 {
  color: #333;
  margin-bottom: 25px;
  text-align: center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group small {
  display: block;
  color: #666;
  font-size: 12px;
  margin-top: 5px;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border 0.3s;
}

textarea:focus {
  outline: none;
  border-color: #4caf50;
}

.checkbox-group {
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-item:hover {
  background: #f5f5f5;
}

.checkbox-item input {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.btn-simpan,
.btn-batal {
  padding: 12px 35px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s;
}

.btn-simpan {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.btn-batal {
  background: linear-gradient(135deg, #757575 0%, #616161 100%);
  color: white;
}

.btn-simpan:hover,
.btn-batal:hover {
  transform: translateY(-2px);
}

/* Detail Container */
.detail-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 20px;
}

.detail-card {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid #4caf50;
}

.detail-header h2 {
  color: #333;
  font-size: 28px;
  margin: 0;
}

.kode-badge {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 16px;
}

.detail-section {
  margin-bottom: 30px;
}

.detail-section h3 {
  color: #4caf50;
  margin-bottom: 15px;
  font-size: 22px;
}

.detail-section p {
  color: #555;
  line-height: 1.8;
  font-size: 16px;
}

.gejala-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gejala-badge {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  border: 2px solid #4caf50;
}

.detail-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}

.btn-edit-detail,
.btn-back {
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s;
}

.btn-edit-detail {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
}

.btn-back {
  background: linear-gradient(135deg, #757575 0%, #616161 100%);
  color: white;
}

.btn-edit-detail:hover,
.btn-back:hover {
  transform: translateY(-2px);
}

/* Basis Aturan */
.subtitle-text {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  font-size: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state p {
  color: #666;
  font-size: 18px;
  margin-bottom: 20px;
}

.aturan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
}

.aturan-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}

.aturan-card:hover {
  border-color: #4caf50;
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.2);
}

.aturan-header {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.aturan-header h3 {
  margin: 0;
  font-size: 20px;
}

.aturan-body {
  padding: 20px;
}

.aturan-body h4 {
  color: #4caf50;
  margin-bottom: 12px;
  font-size: 16px;
}

.aturan-conditions {
  margin-bottom: 20px;
}

.condition-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 8px;
}

.condition-badge {
  background: #4caf50;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 13px;
}

.condition-operator {
  text-align: center;
  color: #ff0000;
  font-weight: bold;
  padding: 5px 0;
  font-size: 14px;
}

.aturan-conclusion {
  background: #e3f2fd;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #2196f3;
}

.aturan-conclusion h4 {
  color: #1976d2;
  margin-bottom: 8px;
}

.aturan-conclusion p {
  color: #555;
  margin: 0;
}

.aturan-actions {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  background: #f9f9f9;
  border-top: 1px solid #eee;
}

.btn-edit-small,
.btn-detail-small {
  flex: 1;
  padding: 8px 15px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: transform 0.2s;
}

.btn-edit-small {
  background: #ff9800;
  color: white;
}

.btn-detail-small {
  background: #2196f3;
  color: white;
}

.btn-edit-small:hover,
.btn-detail-small:hover {
  transform: translateY(-2px);
}

/* Update nav-menu for basis aturan */
.nav-menu a[href="basis_aturan.php"] {
  display: inline-block;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .aturan-grid {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .detail-actions {
    flex-direction: column;
  }
}

@media print {
  .navbar,
  .button-group,
  .detail-actions,
  .aturan-actions {
    display: none !important;
  }
}
