/* =========================
   Biến màu chủ đạo
   ========================= */
/* ===================== THEME LIGHT  ===================== */
:root {
  /* Light (GIỮ) */
  --bg: #ffffff;
  --bg-1: linear-gradient(to left, #f96204f1, #e8a30ef6);
  --bg-2: #f94504;
  --bg-block: #dbdbdb;
  --border-block: #565656;
  --text: #0f172a; /* slate-900 */
  --small: #454a4e;
  --title: #1e293b; /* slate-800 */
  --content: #334155; /* slate-700 */
  --placeholder: #94a3b8; /* slate-400 */
  --muted: #64748b; /* slate-500 */
  --card: #f8fafc; /* slate-50 */
  --border: #e5e7eb; /* gray-200 */
  --hover: #f1f5f9; /* slate-100 */
  --mobile-menu: #000;

  /* Footer (GIỮ) */
  --footer-text: #fff;
  --footer-text-dim: #e4e4e4;
  --footer-line: rgba(255, 255, 255, 0.45);

  /* Brand & States (GIỮ) */
  --primary: #2563eb; /* blue-600 */
  --primary-contrast: #ffffff;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Shadow (GIỮ) */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);

  /* ====== BỔ SUNG: sắc độ chữ, link, overlay, divider ====== */
  --text-soft: #1f2937; /* body text mặc định */
  --text-dim: #475569; /* phụ hơn muted */
  --link: #2563eb;
  --link-hover: #1e40af;

  --overlay: rgba(0, 0, 0, 0.48); /* modal/aside */
  --divider: #eef2f6; /* đường kẻ nhạt */

  /* ====== BỔ SUNG: Button/Input/Focus ====== */
  --btn-bg: var(--primary);
  --btn-bg-hover: #1d4ed8;
  --btn-text: var(--primary-contrast);
  --btn-muted-bg: #e2e8f0; /* button phụ */
  --btn-muted-hover: #cbd5e1;
  --btn-muted-text: #0f172a;

  --input-bg: #ffffff;
  --input-text: var(--text);
  --input-border: #d1d5db;
  --input-placeholder: var(--placeholder);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);

  /* ====== BỔ SUNG: Card/Menu/Navbar/Chip ====== */
  --card-hover: #f3f6fa;
  --menu-bg: #ffffff;
  --menu-item-hover: #f3f4f6;
  --navbar-bg: #ffffffaa; /* có alpha để làm blur */
  --navbar-border: #e5e7eb;
  --chip-bg: #f1f5f9;
  --chip-text: #0f172a;

  /* ====== TOPUP CARD (LIGHT) ====== */
  --topup-card-bg: var(--card);
  --topup-card-border: var(--border);
  --topup-item-bg: #ffffff;
  --topup-item-hover-bg: #f9fafb;
  --topup-item-selected-bg: #fff7ed; /* cam nhạt */
  --topup-chip-bg: #f96204;
  --topup-chip-text: #ffffff;

  --redeem-tab-bg: #ffd8c9; /* cam nhạt */
  --redeem-tab-text: #444; /* chữ slate */
  --redeem-tab-active-bg: #ff6a1a; /* cam đậm */
  --redeem-tab-active-text: #fff; /* chữ trắng */
}

/* ===================== THEME DARK ===================== */
html[data-theme="dark"] {
  /* Dark (GIỮ) */
  --bg: #110b20; /* nền tối dịu */
  --bg-1: #3c4043;
  --bg-2: #f96204;
  --bg-block: #6e6e6e;
  --border-block: #d9e2ff;
  --text: #e5e7eb; /* chữ sáng */
  --small: #b4babf;
  --title: #f1f5f9; /* slate-100 */
  --content: #cad1d9; /* slate-300 */
  --placeholder: #c0c0c0df; /* slate-400 */
  --muted: #94a3b8; /* slate-400 */
  --card: #3c4043; /* panel */
  --border: #1f2937; /* gray-800 */
  --hover: #0f172a;
  --mobile-menu: #ffffff;

  --primary: #3b82f6; /* tăng sáng một chút */
  --primary-contrast: #0b1020;

  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);

  /* ====== BỔ SUNG: sắc độ chữ, link, overlay, divider ====== */
  --text-soft: #e5e7eb; /* body text */
  --text-dim: #cbd5e1; /* nhẹ hơn text */
  --link: #60a5fa;
  --link-hover: #93c5fd;

  --overlay: rgba(0, 0, 0, 0.72);
  --divider: #2b2f3a;

  /* ====== BỔ SUNG: Button/Input/Focus ====== */
  --btn-bg: var(--primary);
  --btn-bg-hover: #60a5fa;
  --btn-text: #0b1020;
  --btn-muted-bg: #4b5563;
  --btn-muted-hover: #6b7280;
  --btn-muted-text: #f3f4f6;

  --input-bg: #1f2330;
  --input-text: #e5e7eb;
  --input-border: #2f3643;
  --input-placeholder: #a3aab7;
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.35);

  /* ====== BỔ SUNG: Card/Menu/Navbar/Chip ====== */
  --card-hover: #374151;
  --menu-bg: #2a2f3a;
  --menu-item-hover: #2f3643;
  --navbar-bg: #151827cc; /* có alpha */
  --navbar-border: #2a2f3a;
  --chip-bg: #283041;
  --chip-text: #e5e7eb;

  /* ====== BỔ SUNG: States (đồng bộ với Light nhưng cân xám-đen) ====== */
  --success: #22c55e;
  --warning: #fbbf24;
  --danger: #ef4444;

  /* ====== BỔ SUNG: Footer (đối ứng với Light) ====== */
  --footer-text: #e8eaf0;
  --footer-text-dim: #c3c9d6;
  --footer-line: rgba(255, 255, 255, 0.2);

  /* ====== TOPUP CARD (DARK) ====== */
  --topup-card-bg: #1f2430;
  --topup-card-border: #2b3240;
  --topup-item-bg: #111827;
  --topup-item-hover-bg: #1f2937;
  --topup-item-selected-bg: rgba(249, 98, 4, 0.16);
  --topup-chip-bg: #f96204;
  --topup-chip-text: #ffffff;

  --redeem-tab-bg: #4b3f3a; /* nâu cam nhạt tối */
  --redeem-tab-text: #d9d9d9; /* chữ sáng */
  --redeem-tab-active-bg: #ff6a1a; /* cam đậm như Light */
  --redeem-tab-active-text: #0b1020; /* chữ đậm (giống button primary dark) */
}

/* =========================
   Nút Bấm
   ========================= */
/* From Uiverse.io by Galahhad */
.theme-switch {
  --toggle-size: 12px;
  /* the size is adjusted using font-size,
     this is not transform scale,
     so you can choose any size */
  --container-width: 5.625em;
  --container-height: 2.5em;
  --container-radius: 6.25em;
  /* radius 0 - minecraft mode :) */
  --container-light-bg: #3d7eae;
  --container-night-bg: #1d1f2c;
  --circle-container-diameter: 3.375em;
  --sun-moon-diameter: 2.125em;
  --sun-bg: #ecca2f;
  --moon-bg: #c4c9d1;
  --spot-color: #959db1;
  --circle-container-offset: calc(
    (var(--circle-container-diameter) - var(--container-height)) / 2 * -1
  );
  --stars-color: #fff;
  --clouds-color: #f3fdff;
  --back-clouds-color: #aacadf;
  --transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  --circle-transition: 0.3s cubic-bezier(0, -0.02, 0.35, 1.17);
}

.theme-switch,
.theme-switch *,
.theme-switch *::before,
.theme-switch *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-size: var(--toggle-size);
}

.theme-switch__container {
  width: var(--container-width);
  height: var(--container-height);
  background-color: var(--container-light-bg);
  border-radius: var(--container-radius);
  overflow: hidden;
  cursor: pointer;
  -webkit-box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25),
    0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  box-shadow: 0em -0.062em 0.062em rgba(0, 0, 0, 0.25),
    0em 0.062em 0.125em rgba(255, 255, 255, 0.94);
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  position: relative;
}

.theme-switch__container::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  -webkit-box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset,
    0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
  box-shadow: 0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset,
    0em 0.05em 0.187em rgba(0, 0, 0, 0.25) inset;
  border-radius: var(--container-radius);
}

.theme-switch__checkbox {
  display: none;
}

.theme-switch__circle-container {
  width: var(--circle-container-diameter);
  height: var(--circle-container-diameter);
  background-color: rgba(255, 255, 255, 0.1);
  position: absolute;
  left: var(--circle-container-offset);
  top: var(--circle-container-offset);
  border-radius: var(--container-radius);
  -webkit-box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    0 0 0 0.625em rgba(255, 255, 255, 0.1),
    0 0 0 1.25em rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    inset 0 0 0 3.375em rgba(255, 255, 255, 0.1),
    0 0 0 0.625em rgba(255, 255, 255, 0.1),
    0 0 0 1.25em rgba(255, 255, 255, 0.1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-transition: var(--circle-transition);
  -o-transition: var(--circle-transition);
  transition: var(--circle-transition);
  pointer-events: none;
}

.theme-switch__sun-moon-container {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  width: var(--sun-moon-diameter);
  height: var(--sun-moon-diameter);
  margin: auto;
  border-radius: var(--container-radius);
  background-color: var(--sun-bg);
  -webkit-box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61)
      inset,
    0em -0.062em 0.062em 0em #a1872a inset;
  box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset,
    0em -0.062em 0.062em 0em #a1872a inset;
  -webkit-filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25))
    drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
  filter: drop-shadow(0.062em 0.125em 0.125em rgba(0, 0, 0, 0.25))
    drop-shadow(0em 0.062em 0.125em rgba(0, 0, 0, 0.25));
  overflow: hidden;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
}

.theme-switch__moon {
  -webkit-transform: translateX(100%);
  -ms-transform: translateX(100%);
  transform: translateX(100%);
  width: 100%;
  height: 100%;
  background-color: var(--moon-bg);
  border-radius: inherit;
  -webkit-box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61)
      inset,
    0em -0.062em 0.062em 0em #969696 inset;
  box-shadow: 0.062em 0.062em 0.062em 0em rgba(254, 255, 239, 0.61) inset,
    0em -0.062em 0.062em 0em #969696 inset;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  position: relative;
}

.theme-switch__spot {
  position: absolute;
  top: 0.75em;
  left: 0.312em;
  width: 0.75em;
  height: 0.75em;
  border-radius: var(--container-radius);
  background-color: var(--spot-color);
  -webkit-box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
  box-shadow: 0em 0.0312em 0.062em rgba(0, 0, 0, 0.25) inset;
}

.theme-switch__spot:nth-of-type(2) {
  width: 0.375em;
  height: 0.375em;
  top: 0.937em;
  left: 1.375em;
}

.theme-switch__spot:nth-last-of-type(3) {
  width: 0.25em;
  height: 0.25em;
  top: 0.312em;
  left: 0.812em;
}

.theme-switch__clouds {
  width: 1.25em;
  height: 1.25em;
  background-color: var(--clouds-color);
  border-radius: var(--container-radius);
  position: absolute;
  bottom: -0.625em;
  left: 0.312em;
  -webkit-box-shadow: 0.937em 0.312em var(--clouds-color),
    -0.312em -0.312em var(--back-clouds-color),
    1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color),
    2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color),
    2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color),
    3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color),
    4.5em -0.312em var(--clouds-color),
    3.375em -0.437em var(--back-clouds-color),
    4.625em -1.75em 0 0.437em var(--clouds-color),
    4em -0.625em var(--back-clouds-color),
    4.125em -2.125em 0 0.437em var(--back-clouds-color);
  box-shadow: 0.937em 0.312em var(--clouds-color),
    -0.312em -0.312em var(--back-clouds-color),
    1.437em 0.375em var(--clouds-color), 0.5em -0.125em var(--back-clouds-color),
    2.187em 0 var(--clouds-color), 1.25em -0.062em var(--back-clouds-color),
    2.937em 0.312em var(--clouds-color), 2em -0.312em var(--back-clouds-color),
    3.625em -0.062em var(--clouds-color), 2.625em 0em var(--back-clouds-color),
    4.5em -0.312em var(--clouds-color),
    3.375em -0.437em var(--back-clouds-color),
    4.625em -1.75em 0 0.437em var(--clouds-color),
    4em -0.625em var(--back-clouds-color),
    4.125em -2.125em 0 0.437em var(--back-clouds-color);
  -webkit-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  -o-transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
  transition: 0.5s cubic-bezier(0, -0.02, 0.4, 1.25);
}

.theme-switch__stars-container {
  position: absolute;
  color: var(--stars-color);
  top: -100%;
  left: 0.312em;
  width: 2.75em;
  height: auto;
  -webkit-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
}

/* actions */

.theme-switch__checkbox:checked + .theme-switch__container {
  background-color: var(--container-night-bg);
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__circle-container {
  left: calc(
    100% - var(--circle-container-offset) - var(--circle-container-diameter)
  );
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__circle-container:hover {
  left: calc(
    100% - var(--circle-container-offset) - var(--circle-container-diameter) -
      0.187em
  );
}

.theme-switch__circle-container:hover {
  left: calc(var(--circle-container-offset) + 0.187em);
}

.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__moon {
  -webkit-transform: translate(0);
  -ms-transform: translate(0);
  transform: translate(0);
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__clouds {
  bottom: -4.062em;
}

.theme-switch__checkbox:checked
  + .theme-switch__container
  .theme-switch__stars-container {
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
}

/* =========================
   Áp dụng toàn cục
   ========================= */
html,
body {
  background: var(--bg);
}
.select2-selection--single {
  background: var(--bg) !important;
}
a:hover {
  opacity: 0.9;
}

/* Card, panel, header… */
.card,
.card-panel,
.card-body,
.dropdown-menu,
.modal-content,
.table,
.sidebar,
.list-group,
.alert,
.mobile-menu-sidebar.active,
.input-group-text {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

/* Bo viền & bóng đổ mềm */
.card,
.card-panel,
.dropdown-menu,
.modal-content {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Header của card có nền nhạt */
.card-header,
.card-header-accent,
.card-header-history,
.card-header-withdraw,
.card-header-withdrawAmount {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* Thanh điều hướng / sidebar item */
.mobile-menu-sidebar.active,
.mobile-menu-item,
.mobile-menu-item i,
.version,
.select2-selection__rendered,
h3,
.sidebar a,
.nav-link,
.dropdown-item {
  color: var(--text) !important;
}

.sidebar a:hover,
.nav-link:hover,
.dropdown-item:hover {
  background: var(--hover);
  color: var(--text);
}

/* Form controls */
.form-control,
.custom-select,
textarea,
input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"] {
  background: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.form-control:focus,
.custom-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
  background: var(--bg);
  color: var(--text);
}

/* Buttons – chỉ chỉnh màu chính, các btn khác giữ nguyên */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}
.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--primary-contrast);
}

/* Badges (ví dụ .badge-info đang dùng hiển thị số dư) */
.badge-info {
  background: var(--primary);
  color: var(--primary-contrast);
  border: 1px solid var(--primary);
}

/* Bảng & hàng */
.table thead th {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.table td,
.table th {
  border-top: 1px solid var(--border);
}
.table tr:hover {
  background: var(--hover);
}

/* Modal backdrop */
.modal-backdrop.show {
  background: #000;
  opacity: 0.5;
}

/* Tooltip / Popover (nếu có) */
.tooltip-inner,
.popover,
.card-body-setting {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Inputs group text */
.input-group-text {
  border-color: var(--border);
}

/* Divider / hr */
hr {
  border-color: var(--border);
}

/* Scrollbar (WebKit) */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--card);
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Transition mượt khi đổi theme */
body,
.card,
.card-panel,
.navbar,
.dropdown-menu,
.modal-content,
.form-control,
.table,
.sidebar,
.input-group-text {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Icon mặc định theo text (Font Awesome/Icofont) */
i,
.icofont {
  color: inherit;
}

.category-horizontal-container::after {
  background: linear-gradient(to left, var(--bg), transparent) !important;
}

/* 404 */
.page-404,
.title-404 {
  color: var(--text);
}

.mobile-menu-toggle span {
  background-color: var(--mobile-menu);
  transition: background-color 1s ease;
}

.header-name-ecom {
  background-color: var(--bg);
  color: var(--text);
}

.col-lg-12 {
  /* background-color: var(--bg); */
}

input::-webkit-input-placeholder {
  color: var(--placeholder) !important; /* Màu chữ placeholder */
  opacity: 0.6; /* Đảm bảo không bị mờ quá */
}

.block-5-item,
.card-change-info {
  background: var(--card) !important;
  color: var(--text);
}

.product-shopee,
.product-lazada {
  background: var(--card) !important;
}

.block {
  background-color: var(--bg-block) !important;
}

.title {
  color: var(--title) !important;
}
.text {
  color: var(--text) !important;
}
.content {
  color: var(--content) !important;
}
.small {
  color: var(--small) !important;
}
/* ====== Google button ====== */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 700;
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn-google:hover {
  background: #f8fafc;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.btn-google:active {
  transform: scale(0.99);
}
.btn-google .g-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}
.card-change-info {
  background: #3c404300 !important;
}
