* {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

html {
  scroll-behavior: smooth; /* biar animasinya smooth */
}

/* Global Styles */
body {
  background-color: var(--bg-color);
  color: #ffffff;
  font-family: "poppins", sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
  height: 100vh;
  flex-direction: column;
}

.container {
  width: 40%;
  padding: 0 20px 20px 20px;
  box-sizing: border-box;
  align-items: center;
}

/* testing */
.banner-container {
  width: 50%;
  padding: 0 20px 20px 20px;
  box-sizing: border-box;
  align-items: center;
}

.logo {
  max-width: 100px;
  height: auto;
  cursor: pointer;
}

.theme-toggle {
  position: relative;
  display: inline-block;
  width: 61px;
  height: 35px;
  border-radius: 5px;
  margin-bottom: 0px;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  background-color: var(--bg-color);
  border-radius: 10px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  box-sizing: border-box;
  border: 1px solid var(--bg-color);
}

.slider .sun {
  color: var(--btn-bg);
  font-size: 16px;
  z-index: 2;
  transition: color 0.3s;
}

.slider .moon {
  color: #d0d6dd;
  font-size: 16px;
  z-index: 2;
  transition: color 0.3s;
}

.toggle-ball {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background-color: var(--container-bg);
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 1;
  border: 1px solid var(--container-bg);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

/* Saat switch aktif (checkbox dicentang) */
.theme-toggle input:checked + .slider {
  background-color: var(--bg-color);
}

.theme-toggle input:checked + .slider .sun {
  color: #d0d6dd;
}

.theme-toggle input:checked + .slider .moon {
  color: var(--btn-bg);
}

.theme-toggle input:checked + .slider .toggle-ball {
  transform: translateX(27px);
}

/* toogle theme */

.sticky-header {
  position: fixed;
  top: 0;
  padding: 10px 20px 10px 20px;
  background-color: var(--btn-bg);
  /* background: linear-gradient(to right, #8b5cf6, #7c3aed); */
  z-index: 1000;
  width: 40%;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Judul kiri, toggle kanan */
  transition: background-color 0.3s ease;
  box-sizing: border-box; /* ⬅️ Tambahkan ini */
  /* border-radius: 0 0 10px 10px; */
}

.sticky-header h1 {
  margin: 0;
  font-size: 20px;
  color: var(--btn-bg);
}

.theme-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  align-items: center;
}

#peopleTable {
  display: none;
}

.banner {
  width: 100%;
}

.summary-container {
  display: none; /* Sembunyikan secara default */
}

/* text information */
.card-container p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
}

p {
  font-size: 12px;
  margin: 0px;
}

.heading {
  text-align: center;
  margin-bottom: 5px;
  margin-top: 20px;
}
.subtitle {
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
}

h1 {
  font-size: 16px;
  color: var(--text-color);
}

h2,
h3 {
  color: var(--text-color);
  margin-bottom: 20px 0;
}

h2 {
  padding-bottom: 8px;
  margin-bottom: 16px;
  font-size: 16px;
}

h3 {
  font-size: 14px;
}

/* Form Elements */
label {
  display: block;
  text-align: left;
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 6px;
  font-size: 14px;
}

#input-section label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

input,
select,
.discount-type,
textarea,
#input-section input,
#input-section select,
#input-section .avatar-container,
#savingMethod {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--table-border-color);
  border-radius: 10px;
  font-size: 16px;
  color: var(--text-color);
  background-color: var(--input-bg);
}

#bankForm input,
#ewalletForm input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--table-border-color);
  border-radius: 6px;
  font-size: 16px;
  color: var(--text-color);
  background-color: var(--input-bg);
}

select {
  padding-right: 30px; /* Tambahkan ruang untuk icon panah */
  color: var(--text-color);
  appearance: none; /* Hilangkan default dropdown (opsional) */
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

/* For better browser support */
input::placeholder,
textarea::placeholder {
  color: #aaa;
  font-size: 14px;
}

input:focus,
button:focus select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.card-container {
  border-radius: 10px;
  padding: 15px;
  align-items: center;
  margin-top: 10px;
  width: 100%;
  white-space: nowrap; /* Prevent text from wrapping */
  background-color: var(--container-bg);
  /* border: 1px solid var(--table-border-color); */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

/* AVATAR */
/* Buat avatar-container tampil seperti field */
.avatar-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 48px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.avatar-container::-webkit-scrollbar {
  display: none;
}

/* Tambahkan padding agar sejajar dengan input */
.avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0px 0px;
  position: relative;
}

/* Avatar bulat */
.avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.2s ease;
}

.avatar.selected {
  outline: 3px solid #4caf50;
  transform: scale(1.1);
}

.avatar-name {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-color);
  text-align: center;
  max-width: 70px;
  word-wrap: break-word;
}

/* TABEL PEOPLE */
.people-table {
  width: 100%;
  border-collapse: collapse;
}

.people-table th,
.people-table td {
  text-align: center;
}

.remove-btn {
  background-color: #e74c3c;
  border: none;
  color: white;
  padding: 4px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.remove-btn:hover {
  background-color: #c0392b;
}

.empty-text {
  color: #aaa;
  font-size: 0.9rem;
  font-size: 14px;
}
p {
  color: var(--text-color);
}

.header-section {
  background-color: var(--btn-bg);
  height: 100px;
  width: 100%;
  top: 0;
  border-radius: 0 0 30px 30px;
  padding: 20px;
}

.title-section {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 10px;
  font-weight: 600;
}

textarea {
  font-family: poppins;
}

.credit {
  font-size: 11px;
  color: var(--text-color-desc);
  text-align: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* FROM TABLE.CSS */

.table-container {
  align-items: center;
  overflow-x: auto; /* Enable horizontal scrolling */
  width: 100%;
  white-space: nowrap; /* Prevent text from wrapping */
  background-color: var(--container-bg);
  border-radius: 8px; /* Agar tetap membulat meski scroll */
  padding: 0; /* Hindari padding yang bisa mengganggu scroll */
  margin-top: 10px;
  border: 1px solid var(--table-border-color);
}

#expense-table {
  width: 100%; /* Ensure the table takes full width */
  border-collapse: collapse;
  overflow: hidden; /* Ini penting untuk buat radius kelihatan */
  border-radius: 12px;
}

.table-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

table {
  width: 100%;
  /* margin-top: 10px; */
  border-collapse: collapse;
  overflow: hidden;
  text-align: center;
  border-radius: 8px;
}

thead {
  border-radius: 12px;
}

th,
td {
  text-align: left;
  font-size: 14px;
}

th {
  background-color: var(--infobox-info-bg);
  text-align: center;
  padding: 10px 16px 10px 16px;
  color: var(--text-color);
  font-weight: 600;
}

td {
  background-color: var(--table-body-bg);
  color: var(--text-color);
  padding: 5px 10px 5px 10px;
  text-align: left;
}

.scrollable-table-container {
  overflow-y: auto;
  border-radius: 12px;
}

/* user table */
.action-column {
  width: 20%;
}

.no-clumn {
  width: 10%;
}

.title-empty-state {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
}

.desc-empty-state {
  font-size: 12px;
  color: var(--text-color-desc);
  margin-bottom: 10px;
}

.banner-container {
  position: relative;
  width: 100%;
  border-radius: 15px;
  align-items: center;
  margin-top: -80px;
  display: flex;
  aspect-ratio: 1080 / 339;
  overflow: hidden;
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  z-index: 0;
  transition: opacity 1s ease-in-out;
  border-radius: 15px;
  /* pointer-events: none; */
  cursor: pointer;
}

.banner-slide.active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.section-input-bill {
  margin-top: 10px;
}

.hidden {
  display: none;
}

.preview-container {
  background-color: var(--bg-color);
  margin: 0;
  border-radius: 10px;
  padding: 15px;
  align-items: center;
  margin-top: 10px;
  width: 100%;
  white-space: nowrap;
  background-color: var(--container-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.preview-splitbill {
  scrollbar-width: none;
}

.preview-splitbill::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.card-login,
.donate-section {
  margin-top: 20px;
  width: 100%;
  position: relative;
  overflow: hidden;

  align-items: center;
  gap: 5px;
  background: var(--progress-bg);
  border: 1px solid var(--progress-border);
  border-radius: 10px;
  padding: 0px;
  cursor: pointer;
}

.donate-section {
  cursor: default;
  background: var(--infobox-info-bg);
  border: 1px solid var(--infobox-info-border-color);
  align-items: center;
}

.user-info {
  display: flex;
  padding: 12px;
  gap: 16px;
  align-items: center;
}

.user-info h2 {
  font-weight: 600;
  color: var(--text-color);
  font-size: 14px;
  margin: 0;
  padding: 0;
}

.user-info p {
  color: var(--text-color);
  font-size: 10px;
  margin: 0;
}

.icon {
  display: flex;
  align-items: center;
  color: var(--progress-border);
  font-size: 20px;
}

.icon img {
  width: 36px;
  /* padding: 0 10px; */
  object-fit: contain;
}

.banner-donate-container {
  padding: 0 10px;
  margin-top: 60px;
}

.banner-donate,
.banner-feedback {
  width: 100%;
  border-radius: 15px;
}
.banner-feedback {
  cursor: pointer;
}

.copy-btn {
  border: 1px solid var(--table-border-color);
  border-radius: 10px;
  background-color: var(--container-bg);
  padding: 4px 8px;
  color: var(--btn-bg);
  font-size: 16px;
  cursor: pointer;
}

.copy-btn:hover {
  border: 1px solid var(--btn-bg);
}

.payment-method-donate {
  display: flex;
  align-items: center;
  gap: 10px;
}

.donate-btn {
  border: 1px solid #8d78f0;
  border-radius: 12px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.merchandising-banner {
  width: 100%;
  border-radius: 16px;
  overflow-x: auto;
}

.donate-section-banner {
  border: 1px solid var(--donate-border-color);
  background: var(--donate-bg-gradient);
  background-blend-mode: screen;

  padding: 10px;
  border-radius: 14px;
  cursor: pointer;
}
.donate-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.donate-info p {
  font-size: 10px;
}

.navigate-donate-page i {
  color: #ff7f7e;
}

/* Additional Expense form */
.additional-expense-item-container {
  border-bottom: 1px dashed var(--table-border-color);
  margin-bottom: 16px;
}

.add-additional-expense {
  width: auto;
  min-width: 50px;
  max-width: 50px;
  padding: 12px;
}

.additional-expense-item-container:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.additional-expense {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.additional-expense-item {
  display: flex;
  gap: 10px;
}

.additional-expense-item .delete-btn {
  margin: 0;
  margin-bottom: 15px;
  max-width: 50px;
}

.additional-expense-item .delete-btn i {
  font-size: 16px;
}

/* Merchandising Popup Styles */
#merchandisingPopup {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#merchandisingPopup.show {
  opacity: 1;
  visibility: visible;
}

#merchandisingPopup.hide {
  opacity: 0;
}

#merchandisingPopup .popup-content {
  transform: scale(0.8) translateY(-20px);
  transition: transform 0.3s ease;
}

#merchandisingPopup.show .popup-content {
  transform: scale(1) translateY(0);
}

#merchandisingPopup.hide .popup-content {
  transform: scale(0.8) translateY(-20px);
}

.merchandising-content {
  text-align: center;
}

.merchandising-content ul {
  text-align: left;
  padding-left: 20px;
  margin-bottom: 20px;
}

.merchandising-content li {
  color: var(--text-color);
  font-size: 12px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.merchandising-cta {
  color: var(--btn-bg);
  font-weight: 600;
  font-size: 12px;
  margin: 0;
  padding: 10px 15px;
  background: var(--infobox-info-bg);
  border-radius: 8px;
  border: 1px solid var(--infobox-info-border-color);
  margin-top: 20px;
  cursor: pointer;
}

.merchandising-banner-img {
  width: 100%;
  border-radius: 12px 12px 0 0;
}

#merchandisingPopup .close-btn-bottom-sheet {
  position: absolute;
  top: -40px;
  right: 0px;
}

#merchandisingPopup .popup-header {
  padding: 0;
  background-color: transparent;
}

/* Proportional Label */
.proportional-label {
  color: #1976d2;
  font-size: 10px;
  padding: 1px 4px;
  background-color: rgba(25, 118, 210, 0.1);
  display: inline-block;
  display: inline-block;
  border-radius: 5px;
  margin-left: 4px;
}

/* PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  background: var(--gradient-color);
  color: white;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
  transition: transform 0.3s ease-in-out;
  box-sizing: border-box;
}

.pwa-install-banner.hidden {
  transform: translateX(-50%) translateY(-100%);
}

.pwa-banner-close {
  background: none;
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  border-radius: 20px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  width: auto;
}

.pwa-banner-close:hover,
.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.pwa-banner-content {
  flex: 1;
  text-align: center;
  margin: 0 15px;
}

.pwa-banner-text {
  font-size: 11px;
  margin: 0;
  color: white;
  text-align: left;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.pwa-install-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 2px 16px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  width: auto;
}

.pwa-install-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.pwa-install-btn:active {
  transform: translateY(0);
}

/* Adjust header position when banner is visible */
body.pwa-banner-visible .sticky-header,
.header-section {
  top: 44px;
}

body.pwa-banner-visible .header-section {
  margin-top: 44px;
}
