/*
 * TiziShop — Dark contrast fixes (2026-11).
 * Load after 15-tizishop-account.css. Visual changes only: no API/order/auth logic.
 * Centralized fixes for legacy light-only utility variants and purchase history.
 */

/* Tailwind translucent light surfaces that were missing from the dark theme.
   Do not target white/20 badges, white QR images, or colorful action buttons. */
body.tizi-dark :is(
  [class~="bg-slate-50/70"],
  [class~="bg-indigo-50/40"],
  [class~="bg-indigo-50/50"],
  [class~="bg-indigo-50/60"],
  [class~="bg-indigo-50/70"],
  [class~="bg-violet-50/70"]
) {
  background-color: #20232b;
  border-color: #373c48;
}

/* Legacy palette used for notices and instructions in more than one tab. */
body.tizi-dark [class~="text-indigo-800"],
body.tizi-dark [class~="text-indigo-900"],
body.tizi-dark [class~="text-violet-800"] { color: #e2e8f0; }
body.tizi-dark [class~="text-emerald-800"] { color: #79e8b4; }
body.tizi-dark [class~="text-amber-800"] { color: #f4cb79; }

/* Hover utilities must not turn dark buttons white when pointed at. */
body.tizi-dark [class~="hover:bg-slate-100"]:hover,
body.tizi-dark [class~="hover:bg-slate-200"]:hover,
body.tizi-dark [class~="hover:bg-indigo-50"]:hover,
body.tizi-dark [class~="hover:bg-indigo-100"]:hover {
  background-color: #2b2d38;
}
body.tizi-dark #tab-deposit .deposit-method:not(.is-selected) { color: #b5becd; }

/* ========== LỊCH SỬ MUA HÀNG ========== */
body.tizi-dark #tab-history .order-compact-card {
  background: #1b1d23;
  border: 1px solid #363a46;
  color: #e8ebf3;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .15);
}
body.tizi-dark #tab-history .order-compact-card:hover {
  background: #20232a;
  border-color: #4b5563;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
body.tizi-dark #tab-history .order-compact-card h4 { color: #f5f6fb; }
body.tizi-dark #tab-history .order-compact-card [class~="border-slate-100"] {
  border-color: #373b47;
}
body.tizi-dark #tab-history .order-compact-code {
  background: #222631;
  color: #f8fafc;
  border: 1px solid #383e4e;
}
body.tizi-dark #tab-history .order-compact-status {
  background: #143328;
  border: 1px solid #2f694f;
  color: #7be8b4;
}
body.tizi-dark #tab-history .order-compact-detail {
  background: #2563eb;
  border: 1px solid #3b82f6;
  color: #fff;
}
body.tizi-dark #tab-history .order-compact-detail:hover { background: #1d4ed8; }
body.tizi-dark #tab-history .order-compact-detail:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 3px;
}
body.tizi-dark #tab-history .order-compact-card [class~="text-indigo-600"] {
  color: #34d399;
}

/* ========== POPUP ACC / KEY (AFTER CHECKOUT AND FROM HISTORY) ========== */
body.tizi-dark #orderDeliveryModal {
  background: rgba(3, 4, 8, .82);
}
body.tizi-dark #orderDeliveryModal > .delivery-result {
  background: #16181e;
  color: #e9ebf4;
  border: 1px solid #373c49;
  box-shadow: 0 26px 85px rgba(0, 0, 0, .55);
}
body.tizi-dark #orderDeliveryModal > .delivery-result > div:first-child {
  background: linear-gradient(110deg, #1b222c, #161920 85%);
  border-bottom: 1px solid #2f3644;
  color: #f8fafc;
}
body.tizi-dark #orderDeliveryModal #deliveryOrderCode { color: #cbd5e1; }
body.tizi-dark #orderDeliveryModal [class~="bg-indigo-50/70"] {
  background: #20232d;
  border-color: #373c4b;
}
body.tizi-dark #orderDeliveryModal #deliveryProductName,
body.tizi-dark #orderDeliveryModal #deliveryInfoHeading {
  color: #f3f4f9;
}
body.tizi-dark #orderDeliveryModal #deliveryOrderSummary,
body.tizi-dark #orderDeliveryModal #deliveryItemCount {
  color: #34d399;
}
body.tizi-dark #orderDeliveryModal #deliveryItemsList > div {
  background: #1d2028;
  border: 1px solid #383e4d;
  color: #e2e7f0;
}
body.tizi-dark #orderDeliveryModal #deliveryItemsList > [class~="bg-amber-50"] {
  background: #302719;
  border-color: #665034;
  color: #f4ce85;
}
body.tizi-dark #orderDeliveryModal #deliveryItemsList [class~="text-slate-500"] {
  color: #b1b9cb;
}
body.tizi-dark #orderDeliveryModal #deliveryItemsList [class~="text-indigo-600"] {
  color: #e2e8f0;
}
body.tizi-dark #orderDeliveryModal #deliveryItemsList [class~="hover:text-indigo-800"]:hover {
  color: #ffffff;
}
body.tizi-dark #orderDeliveryModal .delivery-code {
  padding: 11px 12px;
  border: 1px solid #42485a;
  border-radius: 10px;
  background: #11141b;
  color: #f5f6fc;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}
body.tizi-dark #orderDeliveryModal .delivery-code::selection {
  background: #2563eb;
  color: #fff;
}
body.tizi-dark #orderDeliveryModal #copyAllDeliveredButton {
  background: #059669;
  border: 1px solid #10b981;
  color: #fff;
}
body.tizi-dark #orderDeliveryModal [class~="bg-slate-100"] {
  background: #2b2e38;
  border: 1px solid #464a58;
  color: #e2e6f0;
}
body.tizi-dark #orderDeliveryModal [class~="bg-slate-100"]:hover {
  background: #363a47;
}
body.tizi-dark #orderDeliveryModal .delivery-result > div:last-child > p:last-child {
  color: #a3acbb;
}

/* Same legible inventory/credential surface in the Admin order detail. */
body.tizi-dark #adminOrderDetailModal .admin-delivery-value {
  padding: 10px 12px;
  background: #11141b;
  border: 1px solid #42485a;
  border-radius: 10px;
  color: #f4f5fb;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: text;
}

/* Keyboard focus remains visible in dark dialogs. */
body.tizi-dark #orderDeliveryModal button:focus-visible,
body.tizi-dark #adminOrderDetailModal button:focus-visible {
  outline: 2px solid #b5a8ff;
  outline-offset: 3px;
}
@media (max-width: 640px) {
  body.tizi-dark #orderDeliveryModal .delivery-code { font-size: 12px; }
}
