/* TOPUP+ public frontend light/dark theme override
   Safe patch: load AFTER app.css. Admin is untouched. */

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --theme-page:#020817;
  --theme-page-2:#061126;
  --theme-surface:#07142d;
  --theme-surface-2:#091831;
  --theme-surface-3:#0b1e3e;
  --theme-line:#1d315b;
  --theme-line-soft:rgba(148,163,184,.13);
  --theme-text:#f7faff;
  --theme-text-2:#c4d2ea;
  --theme-muted:#8fa4c8;
  --theme-input:#0a1732;
  --theme-shadow:0 16px 44px rgba(0,0,0,.24);
}

html[data-theme="light"] {
  color-scheme: light;
  --theme-page:#f4f7fb;
  --theme-page-2:#edf3fa;
  --theme-surface:#ffffff;
  --theme-surface-2:#f8fbff;
  --theme-surface-3:#eef5ff;
  --theme-line:#d7e2ef;
  --theme-line-soft:#e7eef6;
  --theme-text:#142033;
  --theme-text-2:#42516a;
  --theme-muted:#74839a;
  --theme-input:#f8fbff;
  --theme-shadow:0 12px 34px rgba(31,57,91,.08);
}

/* ---------- global ---------- */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% -15%, rgba(22,136,255,.09), transparent 34%),
    var(--theme-page) !important;
  color:var(--theme-text) !important;
}

html[data-theme="light"] .app-backdrop {
  background:
    radial-gradient(circle at 8% 20%, rgba(124,77,255,.07), transparent 23%),
    radial-gradient(circle at 92% 25%, rgba(32,216,255,.07), transparent 24%),
    linear-gradient(180deg,#f8fbff 0%,#f3f7fc 55%,#eef4fb 100%) !important;
}
html[data-theme="light"] .app-backdrop::before {
  background-image:
    linear-gradient(rgba(83,119,167,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(83,119,167,.035) 1px,transparent 1px) !important;
}
html[data-theme="light"] .app-backdrop::after {
  background:radial-gradient(circle,rgba(91,105,255,.07),transparent 66%) !important;
}

/* ---------- header ---------- */
html[data-theme="light"] .site-header {
  background:rgba(255,255,255,.93) !important;
  border-bottom-color:#e2eaf4 !important;
  box-shadow:0 4px 18px rgba(25,48,79,.045);
}
html[data-theme="light"] .brand-text { color:#142033 !important; }
html[data-theme="light"] .nav-link { color:#46556d !important; }
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.is-active { color:#0f172a !important; }
html[data-theme="light"] .header-icon,
html[data-theme="light"] .theme-toggle-button,
html[data-theme="light"] .login-button,
html[data-theme="light"] .user-chip {
  background:#fff !important;
  border-color:#d6e1ef !important;
  color:#253247 !important;
  box-shadow:0 5px 15px rgba(31,57,91,.05);
}
html[data-theme="light"] .header-icon:hover,
html[data-theme="light"] .theme-toggle-button:hover,
html[data-theme="light"] .login-button:hover,
html[data-theme="light"] .user-chip:hover {
  background:#f4f8fd !important;
  border-color:#9fc3ec !important;
}
html[data-theme="light"] .user-chip-meta b { color:#142033 !important; }
html[data-theme="light"] .user-chip-meta small { color:#0786cf !important; }
html[data-theme="light"] .user-chevron { color:#5f718a !important; }

/* ---------- dropdowns ---------- */
html[data-theme="light"] .user-popover,
html[data-theme="light"] .notification-popover {
  background:#fff !important;
  color:#142033 !important;
  border-color:#d7e2ef !important;
  box-shadow:0 24px 64px rgba(25,48,79,.16) !important;
}
html[data-theme="light"] .popover-head,
html[data-theme="light"] .popover-grid,
html[data-theme="light"] .notification-head { border-color:#e7eef6 !important; }
html[data-theme="light"] .popover-profile strong,
html[data-theme="light"] .notification-item b { color:#142033 !important; }
html[data-theme="light"] .popover-profile small,
html[data-theme="light"] .notification-item small,
html[data-theme="light"] .notification-item time { color:#74839a !important; }
html[data-theme="light"] .popover-balance {
  background:#f6f9fd !important;
  border-color:#e0e9f4 !important;
}
html[data-theme="light"] .popover-grid a { color:#42516a !important; }
html[data-theme="light"] .popover-grid a:hover,
html[data-theme="light"] .notification-item:hover { background:#f2f7fd !important; color:#142033 !important; }
html[data-theme="light"] .popover-grid i { background:#eef4ff !important; color:#3e6ed8 !important; }

/* ---------- keep hero/banner cinematic ---------- */
html[data-theme="light"] .hero-slider {
  border-color:#c8d7e9 !important;
  box-shadow:0 16px 42px rgba(31,57,91,.12) !important;
}
html[data-theme="light"] .hero-slide-content,
html[data-theme="light"] .hero-slide-content h1,
html[data-theme="light"] .hero-slide-content p,
html[data-theme="light"] .hero-points { color:#fff !important; }
html[data-theme="light"] .hero-slide-content p { color:#e5eefb !important; }
html[data-theme="light"] .hero-arrow { background:rgba(6,18,42,.65) !important; color:#fff !important; }

/* ---------- homepage workspace ---------- */
html[data-theme="light"] .service-sidebar,
html[data-theme="light"] .checkout-card,
html[data-theme="light"] .info-card,
html[data-theme="light"] .page-panel,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .rank-card,
html[data-theme="light"] .support-card,
html[data-theme="light"] .leaderboard-panel,
html[data-theme="light"] .account-side-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .ticket-item,
html[data-theme="light"] .news-card,
html[data-theme="light"] .news-card-full,
html[data-theme="light"] .article-detail-card,
html[data-theme="light"] .related-news-card {
  background:#fff !important;
  color:#142033 !important;
  border-color:#d7e2ef !important;
  box-shadow:var(--theme-shadow) !important;
}

/* side service menu */
html[data-theme="light"] .service-link { color:#42516a !important; }
html[data-theme="light"] .service-link i { color:#526681 !important; }
html[data-theme="light"] .service-link:hover { background:#eef5ff !important; color:#142033 !important; box-shadow:inset 0 0 0 1px #bcd7f6 !important; }
html[data-theme="light"] .service-link.active {
  background:linear-gradient(90deg,#1d73e8,#3168e8) !important;
  color:#fff !important;
  box-shadow:0 8px 20px rgba(29,115,232,.18),inset 0 0 0 1px rgba(255,255,255,.16) !important;
}
html[data-theme="light"] .service-link.active i { color:#fff !important; }
html[data-theme="light"] .support-box {
  background:linear-gradient(180deg,#f5f9ff,#eef5ff) !important;
  border-color:#d3e2f3 !important;
  color:#142033 !important;
}
html[data-theme="light"] .support-box p { color:#74839a !important; }

/* selected game header stays dark/image-led */
html[data-theme="light"] .selected-game-head {
  border-bottom-color:#d7e2ef !important;
  background:#0b1937 !important;
}
html[data-theme="light"] .selected-meta,
html[data-theme="light"] .selected-meta h1,
html[data-theme="light"] .selected-meta h2 { color:#fff !important; }
html[data-theme="light"] .selected-meta p { color:#c6d4e9 !important; }
html[data-theme="light"] .help-chip { color:#fff !important; background:rgba(8,31,72,.76) !important; }

/* checkout body */
html[data-theme="light"] .checkout-form { color:#142033 !important; }
html[data-theme="light"] .checkout-step + .checkout-step { border-top-color:#e7eef6 !important; }
html[data-theme="light"] .step-heading b { color:#142033 !important; }
html[data-theme="light"] .player-input-wrap input,
html[data-theme="light"] .coupon-input-wrap input,
html[data-theme="light"] .form-input,
html[data-theme="light"] .form-textarea,
html[data-theme="light"] .form-select {
  background:#f8fbff !important;
  border-color:#ccd9e8 !important;
  color:#142033 !important;
}
html[data-theme="light"] .player-input-wrap input::placeholder,
html[data-theme="light"] .coupon-input-wrap input::placeholder,
html[data-theme="light"] .form-input::placeholder,
html[data-theme="light"] .form-textarea::placeholder { color:#98a6b9 !important; }
html[data-theme="light"] .player-input-wrap small { color:#75869e !important; }
html[data-theme="light"] .player-result {
  background:#f7faff !important;
  border-color:#d6e2f0 !important;
  color:#142033 !important;
}
html[data-theme="light"] .player-result small { color:#7c8ca2 !important; }

/* package tabs/cards */
html[data-theme="light"] .package-tabs button {
  background:#f7faff !important;
  border-color:#d5e1ef !important;
  color:#55667e !important;
}
html[data-theme="light"] .package-tabs button.active {
  background:#eaf4ff !important;
  border-color:#1688ff !important;
  color:#0677c9 !important;
}
html[data-theme="light"] .package-option {
  background:#f9fbfe !important;
  border-color:#d8e3ef !important;
  color:#142033 !important;
}
html[data-theme="light"] .package-option:hover {
  background:#f1f7ff !important;
  border-color:#9fc7ee !important;
  box-shadow:0 8px 18px rgba(31,57,91,.07);
}
html[data-theme="light"] .package-option.is-selected {
  background:linear-gradient(135deg,#eef8ff,#e8f4ff) !important;
  border-color:#16a6e9 !important;
  box-shadow:0 0 0 1px rgba(22,166,233,.16),0 10px 24px rgba(22,136,255,.08) !important;
}
/*html[data-theme="light"] .package-option small { color:#62758f !important; }*/
html[data-theme="light"] .package-option b { color:#142033 !important; }
html[data-theme="light"] .empty-inline { color:#74839a !important; border-color:#cbd8e7 !important; }

/* payment summary */
html[data-theme="light"] .checkout-summary {
  background:linear-gradient(135deg,#f9fbff,#f1f7ff) !important;
  border-color:#d3e0ef !important;
  color:#142033 !important;
}
html[data-theme="light"] .summary-product { border-right-color:#e2eaf4 !important; }
html[data-theme="light"] .summary-product small,
html[data-theme="light"] .summary-product span,
html[data-theme="light"] .summary-prices span { color:#718199 !important; }
html[data-theme="light"] .summary-product b,
html[data-theme="light"] .summary-prices b { color:#142033 !important; }
html[data-theme="light"] .summary-product-image {
  background:radial-gradient(circle,#e8f6ff,#edf4fc) !important;
  border-color:#bcd5ee !important;
}
html[data-theme="light"] .summary-total { border-top-color:#d8e3ef !important; }
html[data-theme="light"] .summary-total strong { color:#078bcf !important; }

/* right game picker + info */
html[data-theme="light"] .game-picker-card { background:#fff !important; }
html[data-theme="light"] .game-picker-title b,
html[data-theme="light"] .info-card-title b { color:#142033 !important; }
html[data-theme="light"] .game-picker-title small { color:#8190a5 !important; }
html[data-theme="light"] .game-picker-search {
  background:#f8fbff !important;
  border-color:#ccd9e8 !important;
}
html[data-theme="light"] .game-picker-search input { color:#142033 !important; }
html[data-theme="light"] .game-picker-search input::placeholder { color:#96a4b7 !important; }
html[data-theme="light"] .game-picker-option {
  background:#f9fbfe !important;
  border-color:#e0e8f2 !important;
  color:#142033 !important;
}
html[data-theme="light"] .game-picker-option:hover { background:#f0f6fd !important; border-color:#b7cde5 !important; }
html[data-theme="light"] .game-picker-option.is-selected {
  background:linear-gradient(90deg,#e9f5ff,#f6fbff) !important;
  border-color:#1688ff !important;
  box-shadow:inset 3px 0 0 #1688ff !important;
}
html[data-theme="light"] .game-picker-meta b { color:#142033 !important; }
html[data-theme="light"] .game-picker-meta small,
html[data-theme="light"] .game-picker-arrow,
html[data-theme="light"] .game-picker-empty { color:#74839a !important; }
html[data-theme="light"] .info-card p,
html[data-theme="light"] .info-card li span { color:#6d7e96 !important; }
html[data-theme="light"] .info-card li { color:#142033 !important; border-top-color:#e8eef6 !important; }
html[data-theme="light"] .info-card li b { color:#142033 !important; }

/* keep promo blocks vivid */
html[data-theme="light"] .offer-list > a,
html[data-theme="light"] .special-banner { color:#fff !important; }
html[data-theme="light"] .special-offers {
  background:#fff !important;
  border-color:#d7e2ef !important;
  color:#142033 !important;
  box-shadow:var(--theme-shadow);
}
html[data-theme="light"] .special-label { color:#142033 !important; }

/* home news */
html[data-theme="light"] .section-heading h3 { color:#142033 !important; }
html[data-theme="light"] .news-grid article {
  background:#fff !important;
  border-color:#d7e2ef !important;
  box-shadow:0 9px 24px rgba(31,57,91,.055);
  color:#142033 !important;
}
html[data-theme="light"] .news-grid article:hover { border-color:#9fc4ea !important; box-shadow:0 14px 30px rgba(31,57,91,.08); }
html[data-theme="light"] .news-grid article b { color:#142033 !important; }
html[data-theme="light"] .news-grid article p { color:#6d7e96 !important; }

/* ---------- generic inner pages ---------- */
html[data-theme="light"] .gaming-page,
html[data-theme="light"] .content-page,
html[data-theme="light"] .inner-page,
html[data-theme="light"] .compact-page,
html[data-theme="light"] .auth-page { color:#142033 !important; }

html[data-theme="light"] .page-hero {
  background:linear-gradient(120deg,#ffffff,#eef5ff 60%,#f1edff) !important;
  border-color:#d5e1ef !important;
  box-shadow:var(--theme-shadow);
}
html[data-theme="light"] .page-hero h1,
html[data-theme="light"] .page-hero h2 { color:#142033 !important; }
html[data-theme="light"] .page-hero p { color:#65758d !important; }
html[data-theme="light"] .breadcrumb { color:#7a899d !important; }
html[data-theme="light"] .breadcrumb b { color:#142033 !important; }

/* auth/account/rank/support */
html[data-theme="light"] .auth-card h1,
html[data-theme="light"] .page-panel-head h2,
html[data-theme="light"] .page-panel-head h3,
html[data-theme="light"] .rank-card h3,
html[data-theme="light"] .support-card h2,
html[data-theme="light"] .stat-card strong { color:#142033 !important; }
html[data-theme="light"] .auth-card > p,
html[data-theme="light"] .rank-card p,
html[data-theme="light"] .stat-card span,
html[data-theme="light"] .ticket-item small { color:#718199 !important; }
html[data-theme="light"] .account-nav {
  background:#fff !important;
  border-color:#d7e2ef !important;
  box-shadow:var(--theme-shadow);
}
html[data-theme="light"] .account-nav a { color:#53637a !important; }
html[data-theme="light"] .account-nav a:hover { background:#f1f6fc !important; color:#142033 !important; }
html[data-theme="light"] .account-nav a.active { background:#eaf4ff !important; color:#087dc5 !important; }
html[data-theme="light"] .data-table th { color:#53637a !important; background:#f6f9fd !important; }
html[data-theme="light"] .data-table th,
html[data-theme="light"] .data-table td { border-color:#e4ebf4 !important; }
html[data-theme="light"] .data-table tbody tr:hover { background:#f7faff !important; }

/* leaderboard */
html[data-theme="light"] .leaderboard-hero {
  border-color:#d5e1ef !important;
  box-shadow:var(--theme-shadow);
}
html[data-theme="light"] .leaderboard-content { color:#142033 !important; }
html[data-theme="light"] .rank-row { border-color:#e3ebf4 !important; color:#142033 !important; }
html[data-theme="light"] .rank-row:hover { background:#f6f9fd !important; }
html[data-theme="light"] .rank-row-id { color:#74839a !important; }

/* news listing/article */
html[data-theme="light"] .news-card-full {
  background:#fff !important;
  border-color:#d7e2ef !important;
  box-shadow:0 14px 36px rgba(31,57,91,.07) !important;
}
html[data-theme="light"] .news-card-full h2 a { color:#142033 !important; }
html[data-theme="light"] .news-card-full p,
html[data-theme="light"] .news-card-meta { color:#718199 !important; }
html[data-theme="light"] .news-card-media { background:radial-gradient(circle at 50% 30%,#e8f2ff,#dfeaf7) !important; }
html[data-theme="light"] .empty-state-card { background:#fff !important; border-color:#cad8e8 !important; color:#74839a !important; }
html[data-theme="light"] .article-breadcrumb { color:#74839a !important; }
html[data-theme="light"] .article-detail-card { background:#fff !important; }
html[data-theme="light"] .article-header h1 { color:#142033 !important; }
html[data-theme="light"] .article-meta { color:#718199 !important; }
html[data-theme="light"] .article-lead,
html[data-theme="light"] .article-content { color:#42516a !important; }
html[data-theme="light"] .article-content h2,
html[data-theme="light"] .article-content h3,
html[data-theme="light"] .article-content h4 { color:#142033 !important; }
html[data-theme="light"] .article-content pre { background:#f3f7fb !important; border-color:#d7e2ef !important; color:#233149 !important; }
html[data-theme="light"] .article-content blockquote { background:#eef8ff !important; color:#42516a !important; }
html[data-theme="light"] .related-news-card { background:#fff !important; }
html[data-theme="light"] .related-news-card > span { background:#eef4fb !important; }
html[data-theme="light"] .related-news-card b { color:#142033 !important; }
html[data-theme="light"] .related-news-card small { color:#74839a !important; }

/* =========================================================
   THEME TOGGLE - MATCH NOTIFICATION BUTTON
   ========================================================= */

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-button {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    flex: 0 0 40px !important;
    line-height: 1 !important;
    font-size: 0 !important;
    cursor: pointer;
}

.theme-toggle-button .theme-icon {
    position: absolute;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    display: block;
    transition:
        opacity .2s ease,
        transform .25s ease;
}

html[data-theme="light"] .theme-icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(.7);
    pointer-events: none;
}

html[data-theme="light"] .theme-icon-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(.7);
    pointer-events: none;
}

/* Đồng bộ chính xác với icon thông báo */
.theme-toggle-button,
.header-icon {
    box-sizing: border-box !important;
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

/* ---------- footer ---------- */
html[data-theme="light"] .site-footer {
  border-top-color:#d8e6f2 !important;
  background:
    radial-gradient(circle at 5% 10%,rgba(72,132,255,.08),transparent 30%),
    radial-gradient(circle at 83% 0%,rgba(0,188,200,.07),transparent 28%),
    linear-gradient(115deg,#eef7ff 0%,#edf9f7 48%,#e7f2fb 100%) !important;
  color:#53657c !important;
}
html[data-theme="light"] .footer-atmosphere { background:radial-gradient(circle,rgba(85,143,255,.08),transparent 68%) !important; }
html[data-theme="light"] .footer-inner.footer-grid { color:#5f7086 !important; }
html[data-theme="light"] .footer-brand,
html[data-theme="light"] .footer-brand strong,
html[data-theme="light"] .footer-column > b,
html[data-theme="light"] .footer-contact-block > b,
html[data-theme="light"] .footer-trust-card strong { color:#142033 !important; }
html[data-theme="light"] .footer-brand-block > p,
html[data-theme="light"] .footer-column a,
html[data-theme="light"] .footer-contact-line small,
html[data-theme="light"] .footer-contact-line strong,
html[data-theme="light"] .footer-contact-line a,
html[data-theme="light"] .footer-trust-card p { color:#617288 !important; }
html[data-theme="light"] .footer-socials a,
html[data-theme="light"] .footer-trust-chips span {
  background:rgba(255,255,255,.72) !important;
  border-color:#d7e2ef !important;
  color:#42516a !important;
}
html[data-theme="light"] .footer-trust-block { border-left-color:#d8e3ed !important; }
html[data-theme="light"] .footer-trust-card {
  background:rgba(255,255,255,.72) !important;
  border-color:#cde4e3 !important;
}
html[data-theme="light"] .footer-contact-line > span { background:#e4f4f7 !important; color:#0692ae !important; }
html[data-theme="light"] .footer-bottom { border-top-color:#d6e2ec !important; color:#7a899b !important; }

/* ---------- native controls ---------- */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { color-scheme:light; }

/* ---------- smoother theme switch, avoid * to keep performance ---------- */
body,.site-header,.site-footer,.service-sidebar,.checkout-card,.info-card,.page-panel,.auth-card,.rank-card,.support-card,.leaderboard-panel,.account-nav,.account-side-card,.stat-card,.ticket-item,.news-card,.news-card-full,.article-detail-card,.related-news-card,.game-picker-option,.package-option,.checkout-summary,input,textarea,select,.user-popover,.notification-popover {
  transition:background-color .22s ease,border-color .22s ease,color .18s ease,box-shadow .22s ease !important;
}

@media (max-width:760px) {
  html[data-theme="light"] .site-header { background:rgba(255,255,255,.97) !important; }
  html[data-theme="light"] .footer-trust-block { border-left:0 !important; }
}
