/* Body Gradient */
body.gradient {
  background: linear-gradient(to right, #FFD700, #FF4500);
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
  
  justify-content: center;
  align-items: center;
}
body.gradient {
  background: linear-gradient(-45deg, #eeec52, #3c9fe7, #f67f00, #000);
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  min-height: 100vh;
  margin: 0;
}

/* Animasi perpindahan warna */
@keyframes gradientShift {
  0% {
    background-position: 0% 25%;
  }
  25% {
    background-position: 25% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Default untuk desktop */
body, .navbar h2, .table .row, .search-bar input, .harga .nominal {
  font-size: 45px;
}

/* Untuk layar kecil (mobile) */
@media (max-width: 768px) {
  body, .navbar h2, .table .row, .search-bar input, .harga .nominal {
    font-size: 18px;   /* lebih kecil agar pas di mobile */
    
  }

  .search-bar input {
    width: 90%;        /* input lebih lebar di mobile */
  }

  .table .row {
    grid-template-columns: 1fr; /* tabel jadi 1 kolom di mobile */
    text-align: center;
  }

  .harga {
    justify-content: center; /* Rp dan nominal rata tengah di mobile */
  }
    .table.full {
    width: 98% !important;
    margin: 0;
    padding: 20px;
  }
  .sch{padding: 0 18px;}
}
/* Mobile kecil (<=480px) */
@media (max-width: 480px) {
  body, .navbar h2, .table .row, .search-bar input, .harga .nominal {
    font-size: 13px;   /* font kecil agar pas di layar */
  }

  .search-bar input {
    width: 95%;        /* input hampir penuh */
  }

  .table .row {
    grid-template-columns: 1fr; /* tabel jadi 1 kolom */
    text-align: left;
    padding: 28px !important;
  }

  .harga {
    justify-content: center; /* Rp dan nominal rata tengah */
    flex-direction: column;  /* Rp di atas, angka di bawah */
  }

  .navbar {
    flex-direction: column;  /* judul di atas, tombol logout di bawah */
    text-align: center;
  }
  .table.full {
    width: 96% !important;
    margin: 0;
    padding: 20px !important;
    }
 
}


/* Login Box */
.login{display: flex;              /* penting untuk center login */
}
.login-box {
  width: 90%;
  max-width: 345px;
  background: rgba(255,255,255,0.9);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-align: center;
}

.login-box h2 {
  margin-bottom: 15px;
  color: #FF4500;
}

.input-group {
  display: flex;
  align-items: center;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

.input-group .icon {
  padding: 8px;
  font-size: 18px;
  color: #FF4500;
}

.input-group input {
  flex: 1;
  border: none;
  padding: 10px;
  outline: none;
  border-radius: 0 6px 6px 0;
}

.login-box button {
  width: 100%;
  padding: 10px;
  background: #FF4500;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
}

.login-box button:hover {
  background: #FFD700;
  color: #222;
}

/* Search Bar */
.search-bar.full {
  width: 100%;
  padding: 0 0 0 0;
  /* background: rgba(255,255,255,0.8); */
  text-align: center;
}

.search-bar input {
  padding: 16px;
  width: 95%;
  /* max-width: 400px; */
  border-radius: 100px;
  border: 0px;
  

}

.search-bar button {
  padding: 10px 15px;
  background: #FF4500;
  color: white;
  border: none;
  border-radius: 4px;
}

/* Table */
.table.full {
  width: 100%;
  margin: 0;
  padding: 20px;
}

.table .row {
  display: grid;
  grid-template-columns: 7% 40% 5% 25% 23%;
  align-items: center;
  padding: 12px;
  /* border-bottom: 1px solid #ddd; */
  padding: 0px 30px 0 30px;
  font-weight: bold;
}

.table .row.header {
  background: #ffe082 !important;
  color: #222;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 30px 30px 0 0;
  padding: 30px !important;
}

.table img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 9px 0 0 0;
}
.table .row:nth-child(odd) {
  background-color: #F6DEAD;   /* baris ganjil */
}

.table .row:nth-child(even) {
  background-color: #ECE4D4;   /* baris genap */
}

/* Pagination */
.pagination {
  text-align: center;
  margin: 20px;
}

.pagination a {
  display: inline-block;
  padding: 8px 12px;
  margin: 2px;
  background: #ffe082;
  color: #222;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.pagination a.active {
  background: #FF4500;
  color: white;
}

.pagination a:hover {
  background: #FFD700;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between; /* kiri & kanan sejajar */
  align-items: center;
  background: rgba(255,255,255,0.3);
  padding: 20px 20px;
  width: 100%;
  box-sizing: border-box;
}

.navbar h2,
.nav-left h2 {
  margin: 0;
  color: #222;
}

/* Logout Button */
.logout-btn {
  padding: 8px 14px;
  background: #FF4500;
  color: white;
  text-decoration: none;
  border-radius: 100px;
  font-weight: bold;
  padding: 13px 55px;
  font-size: 17px;
}

.logout-btn:hover {
  background: #FFD700;
  color: #222;
}

/* Pastikan elemen setelah navbar turun ke bawah */
.search-bar,
#loading,
#result {
  display: block;
  /* width: 97%; */
  margin-top: 20px;
  clear: both;
}
#result {width: 97%; }

/* Spinner */
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #FF4500;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.form-container {
   
  margin-top: 40px;
  padding: 0 62px 0 20px;
}

.form-box {
  width: 100%;
  /* max-width: 400px; */
  background: rgba(255,255,255,0.95);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.form-box label {
  display: block;
  margin: 10px 0 5px;
  font-weight: bold;
  color: #333;
}

.form-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 5px 5px 0;
  height: 30px;
}

.form-box button {
  width: 100%;
  padding: 12px;
  background: #FF4500;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.form-box button:hover {
  background: #FFD700;
  color: #222;
}

.msg {
  display: block;
  width: 100%;          /* penuh 100% */
  text-align: center;   /* rata tengah */
  font-weight: bold;
  margin: 0 auto 20px;  /* beri jarak ke form */
  padding: 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.8);
  color: 
}}
.harga {
  display: flex;
  justify-content: space-between; /* Rp kiri, angka kanan */
  align-items: center;
  width: 100%;
}

.harga .rp {
  font-weight: bold;
  color: #FF4500;
}

.harga .nominal {
  text-align: right;
  flex: 1;
  font-weight: bold;
  color: #222;
  display: inherit;
}
.table .row.bg {
  display: grid;
  grid-template-columns: 10% 60% 30%;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;

  background-repeat: no-repeat;     /* gambar tidak diulang */
  background-size: auto 100%;       /* lebar otomatis, tinggi mengikuti baris */
  background-position: left center; /* posisi gambar di kiri tengah */
  color: #fff;                      /* teks putih agar kontras */
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}
.update-form {
  display: grid;
  grid-template-columns: 100px 100px 100px 100px; /* harga, harga_end, foto, tombol */
  gap: 20%;
  align-items: center;
  margin: 5px 0;
}

.update-form input[type="number"] {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: right;
  font-size: 14px;
  width: 100%;
}

.update-form button {
  padding: 6px 12px;
  background: #FF4500;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.update-form button:hover {
  background: #FFD700;
  color: #222;
}

.update-form img {
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.delete-btn {
padding: 5px 12px;
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  font-size: 16px;
}

.update-form delete-btn:hover {
  background: #ff5252;
}
/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
  margin-right: 10px;
}

/* Button */
.dropbtn {
  background: #FF4500;
  color: white;
  padding: 8px 14px;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;

  border-radius: 100px;
  font-weight: bold;
  padding: 13px 55px;
}

/* Dropdown content */
.dropdown-content {
  display: none;
  position: absolute;
  top:50px;
  right: 0;
  background-color: #fff;
  min-width: 200px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  border-radius: 16px;
  z-index: 1;
}

/* Links inside dropdown */
.dropdown-content a {
  color: #222;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #FFD700;
  border-radius: 16px;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Hover effect on button */
.dropdown:hover .dropbtn {
  background-color: #FFD700;
  color: #222;
}
/* Popup background */
.popup {
  display: none; /* hidden default */
  position: fixed;
  z-index: 999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
}

/* Popup image */
.popup-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
  border-radius: 8px;
  box-shadow: 0 0 10px #000;
}

/* Close button */
.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* Responsive mobile */
@media (max-width: 480px) {
  .popup-content {
    max-width: 100%;
    max-height: 70%;
  }
  .close {
    font-size: 30px;
    right: 20px;
  }
  .sch{padding: 0 18px;}
}