/* ========== Variables ========== */
:root {
  --primary-color: #0d6efd;
  --primary-hover: #0b5ed7;
  --secondary-color: #6c757d;
  --bg-light: #f8f9fa;
  --card-bg: #ffffff;
  --text-dark: #212529;
  --radius: 12px;
  --transition: all 0.3s ease-in-out;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 80px;
  --transition: 0.3s;
}

/* ========== Global ========== */
body {
  background: var(--bg-light);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== Register Card ========== */
.register-card {
  width: 100%;
  max-width: 520px;
  background: var(--card-bg);
  transition: var(--transition);
  transform: translateY(30px);
  opacity: 0;
}

/* Animasi muncul */
.animate-card.show {
  transform: translateY(0);
  opacity: 1;
}

/* Input group */
.input-group-text {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
}

.form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(13, 110, 253, 0.25);
}

/* Button */
.btn-register {
  background: var(--primary-color);
  border: none;
  padding: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
}

.btn-register:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid #eee;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  z-index: 1000;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar .profile {
  text-align: center;
  margin-bottom: 30px;
}

.sidebar .profile-img {
  border-radius: 50%;
  width: 80px;
  height: 80px;
  border: 3px solid var(--primary-color);
  margin-bottom: 10px;
  transition: width var(--transition), height var(--transition);
}

.sidebar.collapsed .profile-img {
  width: 50px;
  height: 50px;
}

.sidebar .profile-name {
  transition: opacity var(--transition);
}

.sidebar.collapsed .profile-name {
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.sidebar .menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--text-color);
  text-decoration: none;
  transition: all var(--transition);
}

.sidebar.collapsed .menu span {
  display: none;
}

/* Toggle button */
.sidebar-toggle {
  top: 15px;
  left: var(--sidebar-width);
  background: var(--primary-color);
  border: none;
  color: #fff;
  width: 35px;
  height: 35px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1100;
  transition: left var(--transition);
}

/* Geser toggle saat collapsed */
.sidebar.collapsed + .sidebar-toggle {
  left: var(--sidebar-collapsed-width);
}

/* Konten utama */
.content {
  margin-left: var(--sidebar-width);
  padding: 20px;
  transition: margin-left var(--transition);
}

.sidebar.collapsed ~ .content {
  margin-left: var(--sidebar-collapsed-width);
}

.menu-item {
  padding: 10px 15px;
  border-radius: var(--radius);
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}
.menu-item.active {
  background: var(--primary-color);
  color: #fff;
}
.menu-item.logout {
  margin-top: auto;
  color: var(--secondary-color);
}
/* Sidebar submenu */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 0.5rem;
}
.has-submenu.open .submenu {
  max-height: 500px; /* cukup besar untuk isi menu */
}
.submenu-item i {
  margin-right: 10px; /* bisa atur sesuai selera */
}

/* pastikan override semua link di sidebar */
.sidebar .menu-item > a,
.sidebar .submenu .submenu-item {
  color: var(--text-dark) !important;
  text-decoration: none !important;
}

.sidebar .menu-item > a:hover,
.sidebar .submenu .submenu-item:hover {
  color: var(--primary-color) !important;
}

/* Daftar Pesanan full height */
.orders-section {
  min-height: calc(100vh - 200px); /* tinggi layar dikurangi navbar + margin */
  display: flex;
  flex-direction: column;
}
.orders-section .table-responsive {
  flex-grow: 1;
  overflow-y: auto;
}

/* ========== Content ========== */
.content {
  margin-left: 240px;
  padding: 20px;
  transition: var(--transition);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}
.switch input {
  display: none;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 25px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary-color);
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Statistik Card */
.stat-card {
  border-radius: var(--radius);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* QR Scanner Box */
.scanner-box {
  width: 100%;
  height: 200px;
  border: 2px dashed var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  border-radius: var(--radius);
}

/* ========== Login Button ========== */
.btn-login-custom {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}
.btn-login-custom:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========== Hero ========== */
.hero-custom {
  background: url("https://images.unsplash.com/photo-1600891964599-f61ba0e24092?auto=format&fit=crop&w=1350&q=80")
    center/cover no-repeat;
  height: 180px;
  border-radius: var(--radius);
  margin: 50px 15px 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--card-bg);
  padding: 15px;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
.hero-custom.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Saldo User ========== */
.saldo-user-custom {
  margin: 0 15px 15px;
  padding: 12px 15px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
.saldo-user-custom.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Section Titles ========== */
.section-title-custom {
  margin-left: 15px;
  margin-top: 15px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
.section-title-custom.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Menu & Rekomendasi Scroll ========== */
.menu-scroll-custom,
.rekom-scroll-custom {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-left: 15px;
  padding-bottom: 10px;
}

.menu-card-custom,
.rekom-card-custom {
  min-width: 140px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.menu-card-custom:hover,
.rekom-card-custom:hover {
  transform: scale(1.05);
}

.menu-card-custom img,
.rekom-card-custom img {
  width: 100%;
  height: 100px;
  border-radius: var(--radius);
  object-fit: cover;
}

.menu-card-custom h6,
.rekom-card-custom strong {
  font-size: 0.95rem;
  margin: 5px 0;
}
.menu-card-custom small,
.rekom-card-custom small {
  font-size: 0.85rem;
  color: var(--secondary-color);
}

.rating-custom {
  font-size: 0.85rem;
  color: #ffb400;
}

/* ========== Tenant Scroll ========== */
.tenant-scroll-custom {
  margin-bottom: 20px;
}
.tenant-card-custom {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 8px;
  margin: 15px;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
.tenant-card-custom.show {
  opacity: 1;
  transform: translateY(0);
}

.tenant-header-custom {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.tenant-header-custom img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  object-fit: cover;
}
.tenant-products-custom {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}
.tenant-product-custom {
  min-width: 120px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.tenant-product-custom img {
  width: 100%;
  height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
}
.tenant-product-custom h6 {
  font-size: 0.9rem;
  margin: 5px 0;
}
.tenant-product-custom small {
  font-size: 0.8rem;
  color: var(--secondary-color);
}

/* ========== Bottom Nav ========== */
.bottom-nav-custom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--card-bg);
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}
.bottom-nav-custom a {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-btn {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--card-bg);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}
.login-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero {
  background: url("https://images.unsplash.com/photo-1600891964599-f61ba0e24092?auto=format&fit=crop&w=1350&q=80")
    center/cover no-repeat;
  height: 180px;
  border-radius: var(--radius);
  margin: 50px 15px 15px 15px;
  display: flex;
  align-items: flex-end;
  padding: 15px 20px;
  color: var(--card-bg);
  position: relative;
  overflow: hidden;
}
.hero h2,
.hero p {
  margin: 0;
  font-weight: 600;
}
.hero p {
  font-weight: 500;
}

.saldo-card {
  margin: 0 15px 15px 15px;
  padding: 12px 15px;
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.menu-scroll,
.rekomendasi-scroll,
.tenant-products {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-left: 15px;
  padding-bottom: 10px;
}

.menu-card,
.rekomendasi-card,
.tenant-product {
  width: 140px; /* fixed width */
  height: 200px; /* fixed height */
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  text-align: center;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* agar judul & rating berada di bawah */
}

.menu-card img,
.rekomendasi-card img,
.tenant-product img {
  width: 100%;
  height: 100px; /* tinggi tetap */
  border-radius: 10px;
  object-fit: cover; /* gambar tetap proporsional & terpotong jika perlu */
}

.menu-card h6,
.rekomendasi-card strong,
.tenant-product h6 {
  font-size: 0.95rem;
  margin: 5px 0 0 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis; /* potong teks panjang */
  white-space: nowrap;
}

.menu-card small,
.tenant-product small {
  font-size: 0.85rem;
  color: var(--secondary-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating {
  font-size: 0.85rem;
  color: var(--rating-color);
}
a {
  text-decoration: none; /* hilangkan underline */
  color: inherit; /* pakai warna teks card */
}

/* Hover efek halus */
a:hover {
  transform: translateY(-3px);
  transition: transform 0.2s ease;
}

.tenant-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 8px;
  margin: 15px;
}
.tenant-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tenant-card-header img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  object-fit: cover;
}
.tenant-card-header h6 {
  margin: 0;
  font-size: 1rem;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--card-bg);
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}
.bottom-nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.saldo-display {
  display: flex;
  align-items: center;
  gap: 8px; /* jarak antara saldo dan tombol mata */
}

.eye-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #333;
}

.eye-btn:focus {
  outline: none;
}

.menu-card.menu-disabled {
  pointer-events: none; /* Biar nggak bisa diklik */
  opacity: 0.5; /* Transparan */
  filter: grayscale(100%); /* Jadi abu-abu */
}

.badge-unavailable {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
  font-size: 12px;
  background: #dc3545;
  color: #fff;
  border-radius: 4px;
}

.cart-floating {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 1050;
}
#cartBox {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  max-height: 60vh;
  overflow-y: auto;
  background: #fff;
  z-index: 1050;
}

/* Default terang */
body[data-theme="light"] {
  --bg-color: #ffffff;
  --text-color: #212529;
  --card-bg: #ffffff;
  --table-bg: #f8f9fa;
}

/* Mode gelap */
body[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #f1f1f1;
  --card-bg: #1f1f1f;
  --table-bg: #2a2a2a;
}

body[data-theme="dark"] .bottom-navbar {
  background-color: black;
}

body[data-theme="light"] .bottom-navbar {
  background-color: white;
}

.hero h2,
p {
  color: white;
}

body[data-theme="dark"] .logo-text {
  color: white;
}

body[data-theme="light"] .logo-text {
  color: #000000; /* teks logo hitam */
}

/* Terapkan ke elemen */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.card {
  background-color: var(--card-bg);
  color: var(--text-color);
}

.table {
  background-color: var(--table-bg);
  color: var(--text-color);
}
.table th,
.table td {
  border-color: #6c757d;
}

.bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.bottom-navbar a {
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.setting-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin: 15px 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUp 0.5s forwards;
  transition: var(--transition);
}

.setting-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.setting-icon {
  font-size: 1.8rem;
  color: var(--primary-color);
  width: 40px;
  text-align: center;
}

.setting-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-info h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.setting-info span {
  font-size: 0.85rem;
  color: var(--secondary-color);
}

.collapse-body {
  background: #f8f9fa;
  padding: 12px;
  border-radius: var(--radius);
  margin-top: 6px;
  font-size: 0.9rem;
  color: #495057;
}

.collapse-body ol {
  padding-left: 20px;
}

.collapse-body li {
  margin-bottom: 8px;
}

.menus-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  margin: 20px 10px;
  padding: 20px;
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menus-card h6 {
  font-weight: 500;
  margin-bottom: 3px;
  color: var(--secondary-color);
}

.menus-card h5 {
  font-weight: 600;
  margin-bottom: 15px;
}

.carousel-inner img {
  width: 100%;
  height: 250px; /* tinggi tetap semua gambar */
  object-fit: cover; /* agar proporsinya tetap */
  border-radius: var(--radius);
}

.menu-description {
  margin: 12px 0;
  font-size: 0.95rem;
  color: var(--secondary-color);
  line-height: 1.5;
}

.price-section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 0.95rem;
}

.qty-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.qty-section input {
  width: 70px;
  text-align: center;
  border-radius: var(--radius);
}

.note-section {
  margin-bottom: 15px;
}

.note-section label {
  font-weight: 500;
  margin-bottom: 5px;
  display: block;
}

.note-section textarea {
  width: 100%;
  min-height: 60px;
  border-radius: var(--radius);
  padding: 8px;
  resize: vertical;
  border: 1px solid #ccc;
}

.btn-add-cart {
  width: 100%;
  font-weight: 500;
  margin-bottom: 20px;
}

@media (max-width: 400px) {
  .carousel-inner img {
    max-height: 220px;
  }
  .menus-card h5 {
    font-size: 1.1rem;
  }
}

.order-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin: 15px 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-header {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
}

.order-status {
  display: inline-block;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 6px;
}

.status-proses {
  background-color: #ffc107;
}
.status-antrian {
  background-color: #0dcaf0;
}
.status-siap {
  background-color: #198754;
}
.status-batal {
  background-color: #dc3545;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-item-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.order-total {
  font-weight: 600;
  text-align: right;
  font-size: 0.95rem;
}

.btn-action {
  margin-top: 8px;
  width: 100%;
  font-weight: 500;
}

.checkout-card {
  max-width: 600px;
  margin: 50px auto;
  padding: 20px;
}
.item-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
}
.btn-pay {
  width: 100%;
}

.chat-container {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 90vh;
}
.chat-header {
  background: #0d6efd;
  color: #fff;
  padding: 15px;
  border-radius: 12px 12px 0 0;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}
.chat-footer {
  padding: 10px 15px;
  border-top: 1px solid #dee2e6;
}
.message {
  margin: 8px 0;
}
.user {
  text-align: right;
}
.user .msg {
  display: inline-block;
  background: #0d6efd;
  color: #fff;
  padding: 8px 12px;
  border-radius: 15px;
  max-width: 75%;
}
.bot .msg {
  display: inline-block;
  background: #e9ecef;
  padding: 8px 12px;
  border-radius: 15px;
  max-width: 75%;
}
