/*
 * /css/dark_theme_fixes.css
 * VMEREGI — точкові виправлення темної теми для legacy/модульних сторінок.
 * Підключається останнім серед глобальних CSS, щоб не ламати світлу тему.
 */

/* ===== Bootstrap / legacy light surfaces ===== */
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .text-bg-light,
html[data-theme="dark"] .alert-light{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background-color:var(--vm-surface-strong)!important;
}

html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .popover{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface)!important;
}
html[data-theme="dark"] .accordion-button:not(.collapsed){
  color:var(--vm-primary-strong)!important;
  background:var(--vm-primary-soft)!important;
  box-shadow:inset 0 calc(-1 * var(--bs-border-width)) 0 var(--vm-border)!important;
}
html[data-theme="dark"] .accordion-button::after{filter:brightness(0) invert(1) opacity(.75)}

html[data-theme="dark"] .btn-outline-dark{
  --bs-btn-color:var(--vm-text);
  --bs-btn-border-color:var(--vm-border-strong);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg:var(--vm-primary);
  --bs-btn-hover-border-color:var(--vm-primary);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg:var(--vm-primary);
  --bs-btn-active-border-color:var(--vm-primary);
  color:var(--vm-text)!important;
  border-color:var(--vm-border-strong)!important;
  background:var(--vm-surface)!important;
}
html[data-theme="dark"] .btn-outline-dark:hover,
html[data-theme="dark"] .btn-outline-dark:focus{
  color:#fff!important;
  border-color:var(--vm-primary)!important;
  background:var(--vm-primary)!important;
}

html[data-theme="dark"] .page-link{
  color:var(--vm-text-soft);
  border-color:var(--vm-border);
  background:var(--vm-surface);
}
html[data-theme="dark"] .page-link:hover,
html[data-theme="dark"] .page-link:focus{
  color:var(--vm-primary-strong);
  background:var(--vm-primary-soft);
}
html[data-theme="dark"] .page-item.disabled .page-link{color:var(--vm-muted);background:var(--vm-surface-soft)}

/* ===== Каталог груп /group.php ===== */
html[data-theme="dark"] body.vm-public-body .list-group.shadow-sm,
html[data-theme="dark"] body.vm-public-body .list-group-flush{
  border-color:var(--vm-border)!important;
  background:transparent!important;
}
html[data-theme="dark"] body.vm-public-body .list-group-item .badge.bg-light,
html[data-theme="dark"] body.vm-public-body .list-group-item .badge.text-bg-light{
  color:var(--vm-text-soft)!important;
  border-color:var(--vm-border-strong)!important;
  background:var(--vm-surface-strong)!important;
}

/* ===== Профіль / фотоальбоми ===== */
html[data-theme="dark"] .vm-profile-page .profile-album-card{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-soft)!important;
  box-shadow:var(--vm-shadow-xs)!important;
}
html[data-theme="dark"] .vm-profile-page .profile-album-create-card{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-soft)!important;
}
html[data-theme="dark"] .vm-profile-page .profile-album-title,
html[data-theme="dark"] .vm-profile-page .profile-album-title a{
  color:var(--vm-text)!important;
}
html[data-theme="dark"] .vm-profile-page .profile-album-desc{
  color:var(--vm-text-soft)!important;
}
html[data-theme="dark"] .vm-profile-page .profile-album-empty{
  color:var(--vm-muted)!important;
  border-color:var(--vm-border-strong)!important;
  background:var(--vm-surface-soft)!important;
}
html[data-theme="dark"] .vm-profile-page .profile-album-cover-placeholder{
  color:var(--vm-muted)!important;
  background:linear-gradient(135deg,var(--vm-surface-strong),var(--vm-surface-soft))!important;
}
html[data-theme="dark"] .vm-profile-page .profile-album-meta .badge{
  color:var(--vm-text-soft)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-strong)!important;
}

/* ===== Ігри та розваги ===== */
html[data-theme="dark"] .vm-game-tile,
html[data-theme="dark"] .vm-quiz-category,
html[data-theme="dark"] .vm-quiz-answer,
html[data-theme="dark"] .vm-task,
html[data-theme="dark"] .vm-badge-card,
html[data-theme="dark"] .vm-card,
html[data-theme="dark"] .rw-bet-card,
html[data-theme="dark"] .rw-history-card,
html[data-theme="dark"] .rw-balance-bar{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-soft)!important;
  box-shadow:var(--vm-shadow-xs)!important;
}
html[data-theme="dark"] .vm-game-tile:hover,
html[data-theme="dark"] .vm-quiz-category:hover,
html[data-theme="dark"] .vm-quiz-answer:hover{
  color:var(--vm-text)!important;
  border-color:var(--vm-border-strong)!important;
  background:var(--vm-surface-strong)!important;
  box-shadow:var(--vm-shadow-sm)!important;
}
html[data-theme="dark"] .vm-game-tile-icon,
html[data-theme="dark"] .vm-task-icon,
html[data-theme="dark"] .vm-leader-rank{
  color:var(--vm-primary-strong)!important;
  background:var(--vm-primary-soft)!important;
}
html[data-theme="dark"] .vm-leader-row,
html[data-theme="dark"] .vm-ach-summary-item,
html[data-theme="dark"] .vm-game-message{
  color:var(--vm-text-soft)!important;
  background:var(--vm-surface-soft)!important;
}
html[data-theme="dark"] .vm-leader-score,
html[data-theme="dark"] .vm-ach-summary-item strong{color:var(--vm-primary-strong)!important}
html[data-theme="dark"] .vm-wordle-cell{
  color:var(--vm-text)!important;
  border-color:var(--vm-border-strong)!important;
  background:var(--vm-surface)!important;
}
html[data-theme="dark"] .vm-wordle-key{
  color:var(--vm-text)!important;
  background:var(--vm-surface-strong)!important;
}
html[data-theme="dark"] .vm-2048-cell{
  color:var(--vm-text-soft);
  background:var(--vm-surface-strong);
}
html[data-theme="dark"] .vm-2048-cell[data-value="2"]{background:var(--vm-surface-soft)}
html[data-theme="dark"] .vm-2048-cell[data-value="4"]{background:color-mix(in srgb,var(--vm-primary) 18%,var(--vm-surface))}
html[data-theme="dark"] .vm-2048-cell[data-value="8"]{color:#dbeafe;background:color-mix(in srgb,#2563eb 34%,var(--vm-surface))}
html[data-theme="dark"] .vm-2048-cell[data-value="16"]{color:#eff6ff;background:color-mix(in srgb,#3b82f6 52%,var(--vm-surface))}
html[data-theme="dark"] .vm-result-circle:after{background:var(--vm-surface)!important}
html[data-theme="dark"] .vm-result-circle strong{color:var(--vm-primary-strong)!important}
html[data-theme="dark"] .vm-task.is-done{
  border-color:color-mix(in srgb,var(--vm-success) 45%,var(--vm-border))!important;
  background:color-mix(in srgb,var(--vm-success) 10%,var(--vm-surface))!important;
}
html[data-theme="dark"] .rw-balance-label,
html[data-theme="dark"] .rw-balance-unit,
html[data-theme="dark"] .rw-topup-hint{color:var(--vm-muted)!important}

/* ===== Рекламний центр ===== */
html[data-theme="dark"] body.vm-public-body .rc-hero{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:
    radial-gradient(circle at 12% 0%,rgba(139,141,251,.14),transparent 23rem),
    linear-gradient(135deg,var(--vm-surface-strong),var(--vm-surface))!important;
  box-shadow:var(--vm-shadow-sm)!important;
}
html[data-theme="dark"] body.vm-public-body .rc-stat,
html[data-theme="dark"] body.vm-public-body .rc-campaign,
html[data-theme="dark"] body.vm-public-body .rc-card,
html[data-theme="dark"] body.vm-public-body .rc-box,
html[data-theme="dark"] body.vm-public-body .rc-metric,
html[data-theme="dark"] body.vm-public-body .rc-preview-stat,
html[data-theme="dark"] body.vm-public-body .rc-pay-stat,
html[data-theme="dark"] body.vm-public-body .rc-tip-item,
html[data-theme="dark"] body.vm-public-body .rc-note{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface)!important;
  box-shadow:var(--vm-shadow-xs)!important;
}
html[data-theme="dark"] body.vm-public-body .rc-subbox,
html[data-theme="dark"] body.vm-public-body .rc-balance-chip,
html[data-theme="dark"] body.vm-public-body .rc-chip,
html[data-theme="dark"] body.vm-public-body .rc-guide-num{
  color:var(--vm-text-soft)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-soft)!important;
}
html[data-theme="dark"] body.vm-public-body .rc-help,
html[data-theme="dark"] body.vm-public-body .rc-metric .label,
html[data-theme="dark"] body.vm-public-body .rc-mini-note,
html[data-theme="dark"] body.vm-public-body .rc-tip-text,
html[data-theme="dark"] body.vm-public-body .rc-list-meta{
  color:var(--vm-muted)!important;
}
html[data-theme="dark"] body.vm-public-body .rc-section-title,
html[data-theme="dark"] body.vm-public-body .rc-tip-title{
  color:var(--vm-text)!important;
}
html[data-theme="dark"] body.vm-public-body .rc-kpi-positive,
html[data-theme="dark"] body.vm-public-body .rc-stat-positive{color:var(--vm-success)!important}
html[data-theme="dark"] body.vm-public-body .rc-thumb{border-color:var(--vm-border)!important;background:var(--vm-surface-soft)!important}
html[data-theme="dark"] body.vm-public-body .rc-table-wrap{border-color:var(--vm-border)!important;background:var(--vm-surface)!important}

/* ===== Адмінка: legacy модулі з власними світлими стилями ===== */
html[data-theme="dark"] body.vm-admin-body .restr-card,
html[data-theme="dark"] body.vm-admin-body .restr-block,
html[data-theme="dark"] body.vm-admin-body .restr-ban-card,
html[data-theme="dark"] body.vm-admin-body .admin-users-card,
html[data-theme="dark"] body.vm-admin-body .admin-users-filters,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-list,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-card,
html[data-theme="dark"] body.vm-admin-body .sec-pill,
html[data-theme="dark"] body.vm-admin-body .sec-stat,
html[data-theme="dark"] body.vm-admin-body .quick-links a,
html[data-theme="dark"] body.vm-admin-body .pager a,
html[data-theme="dark"] body.vm-admin-body .pager span{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface)!important;
  box-shadow:var(--vm-shadow-xs)!important;
}
html[data-theme="dark"] body.vm-admin-body .restr-user-name,
html[data-theme="dark"] body.vm-admin-body .restr-list-name,
html[data-theme="dark"] body.vm-admin-body .admin-users-id,
html[data-theme="dark"] body.vm-admin-body .admin-users-identity-main,
html[data-theme="dark"] body.vm-admin-body .admin-users-number-value,
html[data-theme="dark"] body.vm-admin-body .admin-users-created-date,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-id-value,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-name,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-value{
  color:var(--vm-text)!important;
}
html[data-theme="dark"] body.vm-admin-body .restr-user-meta,
html[data-theme="dark"] body.vm-admin-body .restr-block-note,
html[data-theme="dark"] body.vm-admin-body .restr-input-label,
html[data-theme="dark"] body.vm-admin-body .restr-list-meta,
html[data-theme="dark"] body.vm-admin-body .restr-list-reason,
html[data-theme="dark"] body.vm-admin-body .admin-users-identity-email,
html[data-theme="dark"] body.vm-admin-body .admin-users-meta-label,
html[data-theme="dark"] body.vm-admin-body .admin-users-created-time,
html[data-theme="dark"] body.vm-admin-body .admin-users-antispam-reason,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-id-label,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-email,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-label,
html[data-theme="dark"] body.vm-admin-body .sec-stat .lbl{
  color:var(--vm-muted)!important;
}
html[data-theme="dark"] body.vm-admin-body .admin-users-table thead th{
  color:var(--vm-muted)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-soft)!important;
}
html[data-theme="dark"] body.vm-admin-body .admin-users-table tbody td{border-color:var(--vm-border)!important}
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-id,
html[data-theme="dark"] body.vm-admin-body .admin-users-mobile-box,
html[data-theme="dark"] body.vm-admin-body .sec-box{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface-soft)!important;
}
html[data-theme="dark"] body.vm-admin-body .restr-search-item,
html[data-theme="dark"] body.vm-admin-body .restr-list-item{border-color:var(--vm-border)!important}
html[data-theme="dark"] body.vm-admin-body .restr-user-ava,
html[data-theme="dark"] body.vm-admin-body .restr-search-ava,
html[data-theme="dark"] body.vm-admin-body .restr-list-ava{background:var(--vm-surface-strong)!important}

/* Адмінські поля/таблиці, які Bootstrap або локальний CSS лишав світлими. */
html[data-theme="dark"] body.vm-admin-body .form-control,
html[data-theme="dark"] body.vm-admin-body .form-select,
html[data-theme="dark"] body.vm-admin-body .input-group-text{
  color:var(--vm-text)!important;
  border-color:var(--vm-border)!important;
  background:var(--vm-surface)!important;
}
html[data-theme="dark"] body.vm-admin-body .form-control::placeholder{color:var(--vm-muted)!important}
html[data-theme="dark"] body.vm-admin-body .table-responsive{border-color:var(--vm-border)!important;background:var(--vm-surface)!important}

/* ===== Security center: readable device metadata ===== */
html[data-theme="dark"] .vm-device-card__details{
  color:var(--vm-text-soft);
}
html[data-theme="dark"] .vm-device-card__details code{
  color:var(--vm-primary-strong);
  border-color:var(--vm-border);
  background:var(--vm-surface-strong);
}
