/* ============================================================
   ANTHONY IT SOLUTIONS, Thème clair/sombre
   ============================================================ */

/* Interrupteur thème clair / sombre, header public */
.ais-theme-switch {
  --ais-ts-w: 52px;
  --ais-ts-h: 32px;
  --ais-ts-pad: 3px;
  --ais-ts-border: 1px;
  --ais-ts-thumb: calc(var(--ais-ts-h) - var(--ais-ts-pad) * 2 - var(--ais-ts-border) * 2);
  --ais-ts-track: #eef2f7;
  --ais-ts-track-border: #e2e8f0;
  --ais-ts-icon: #94a3b8;
  --ais-ts-icon-active: #163a72;
  --ais-ts-thumb-bg: #ffffff;
  --ais-ts-thumb-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);

  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  line-height: 0;
}

.ais-theme-switch:focus {
  outline: none;
}

.ais-theme-switch:focus-visible .ais-theme-switch__track {
  box-shadow: 0 0 0 3px rgba(22, 58, 114, 0.22);
}

.ais-theme-switch__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: var(--ais-ts-w);
  height: var(--ais-ts-h);
  padding: var(--ais-ts-pad);
  border-radius: 999px;
  background: var(--ais-ts-track);
  border: 1px solid var(--ais-ts-track-border);
  box-sizing: border-box;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.2s ease;
}

.ais-theme-switch__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--ais-ts-icon);
  transition: color 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.ais-theme-switch__icon--sun {
  transform: scale(0.92);
}

.ais-theme-switch__icon--moon {
  transform: scale(0.92);
}

.ais-theme-switch__thumb {
  position: absolute;
  top: 50%;
  left: var(--ais-ts-pad);
  width: var(--ais-ts-thumb);
  height: var(--ais-ts-thumb);
  margin-top: calc(var(--ais-ts-thumb) / -2);
  border-radius: 50%;
  background: var(--ais-ts-thumb-bg);
  box-shadow: var(--ais-ts-thumb-shadow);
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), right 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease, box-shadow 0.25s ease;
  pointer-events: none;
  z-index: 0;
}

/* Mode clair actif : thumb à gauche, soleil accentué */
.ais-theme-switch[aria-checked="false"] .ais-theme-switch__icon--sun {
  color: var(--ais-ts-icon-active);
  transform: scale(1);
}

.ais-theme-switch[aria-checked="false"] .ais-theme-switch__thumb {
  left: var(--ais-ts-pad);
  right: auto;
}

/* Mode sombre actif : thumb à droite, lune accentuée */
.ais-theme-switch[aria-checked="true"] .ais-theme-switch__icon--moon {
  color: #60a5fa;
  transform: scale(1);
}

.ais-theme-switch[aria-checked="true"] .ais-theme-switch__thumb {
  left: auto;
  right: var(--ais-ts-pad);
}

.ais-theme-switch[aria-checked="true"] .ais-theme-switch__track {
  --ais-ts-track: #1e293b;
  --ais-ts-track-border: rgba(255, 255, 255, 0.1);
  --ais-ts-thumb-bg: #334155;
  --ais-ts-thumb-shadow: 0 1px 4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Dark mode global (page déjà en thème sombre) */
[data-style="dark"] .ais-theme-switch {
  --ais-ts-track: rgba(255, 255, 255, 0.07);
  --ais-ts-track-border: rgba(255, 255, 255, 0.1);
  --ais-ts-icon: rgba(148, 163, 184, 0.75);
  --ais-ts-icon-active: #93c5fd;
  --ais-ts-thumb-bg: #475569;
  --ais-ts-thumb-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-style="dark"] .ais-theme-switch:focus-visible .ais-theme-switch__track {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

[data-style="dark"] .ais-theme-switch[aria-checked="false"] .ais-theme-switch__icon--sun {
  color: #fbbf24;
}

[data-style="dark"] .ais-theme-switch[aria-checked="true"] .ais-theme-switch__icon--moon {
  color: #93c5fd;
}

[data-style="dark"] .ais-theme-switch[aria-checked="true"] .ais-theme-switch__track {
  --ais-ts-track: rgba(22, 58, 114, 0.18);
  --ais-ts-track-border: rgba(96, 165, 250, 0.22);
  --ais-ts-thumb-bg: #1e3a5f;
}

/* Topbar : discret sur fond bleu */
.ais-topbar .ais-theme-switch {
  --ais-ts-w: 46px;
  --ais-ts-h: 24px;
  --ais-ts-pad: 2px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.ais-topbar .ais-theme-switch:hover {
  opacity: 1;
}

[data-style="light"] .ais-topbar .ais-theme-switch {
  --ais-ts-track: rgba(255, 255, 255, 0.08);
  --ais-ts-track-border: rgba(255, 255, 255, 0.12);
  --ais-ts-icon: rgba(255, 255, 255, 0.32);
  --ais-ts-icon-active: rgba(255, 255, 255, 0.58);
  --ais-ts-thumb-bg: rgba(255, 255, 255, 0.92);
  --ais-ts-thumb-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

[data-style="light"] .ais-topbar .ais-theme-switch[aria-checked="false"] .ais-theme-switch__icon--sun {
  color: #fde68a;
}

[data-style="light"] .ais-topbar .ais-theme-switch[aria-checked="true"] .ais-theme-switch__icon--moon {
  color: #b8cce8;
}

/* Topbar : discret en mode clair (fond bleu foncé) */
.ais-topbar .ais-theme-switch {
  --ais-ts-w: 46px;
  --ais-ts-h: 24px;
  --ais-ts-pad: 2px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.ais-topbar .ais-theme-switch:hover {
  opacity: 1;
}

[data-style="light"] .ais-topbar .ais-theme-switch {
  --ais-ts-track: rgba(255, 255, 255, 0.08);
  --ais-ts-track-border: rgba(255, 255, 255, 0.12);
  --ais-ts-icon: rgba(255, 255, 255, 0.32);
  --ais-ts-icon-active: rgba(255, 255, 255, 0.58);
  --ais-ts-thumb-bg: rgba(255, 255, 255, 0.18);
  --ais-ts-thumb-shadow: none;
}

[data-style="light"] .ais-topbar .ais-theme-switch .ais-theme-switch__icon {
  font-size: 0.72rem;
}

[data-style="light"] .ais-topbar .ais-theme-switch[aria-checked="false"] .ais-theme-switch__icon--sun {
  color: rgba(255, 255, 255, 0.55);
  transform: scale(0.96);
}

[data-style="light"] .ais-topbar .ais-theme-switch[aria-checked="true"] .ais-theme-switch__icon--moon {
  color: rgba(255, 255, 255, 0.5);
  transform: scale(0.96);
}

[data-style="light"] .ais-topbar .ais-theme-switch[aria-checked="true"] .ais-theme-switch__track {
  --ais-ts-track: rgba(255, 255, 255, 0.12);
  --ais-ts-track-border: rgba(255, 255, 255, 0.16);
  --ais-ts-thumb-bg: rgba(255, 255, 255, 0.24);
}

[data-style="light"] .ais-topbar .ais-theme-switch:focus-visible .ais-theme-switch__track {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}
/* ============================================================
   Mode sombre global, header AIS, vitrine, espace client
   Actif via [data-style="dark"] sur <html>
   ============================================================ */

[data-style="dark"] {
  --ais-text-muted: #b4bfd0;
  --ais-text-secondary: #cbd5e1;
  --ais-icon-muted: #a8b4c8;
}

/* --- Exceptions au style global « p gris » (header.php) --- */
[data-style="dark"] .ca-hero,
[data-style="dark"] .ca-hero h1,
[data-style="dark"] .ca-hero .ca-hero-kicker {
  color: #fff !important;
}
[data-style="dark"] .ca-hero p {
  color: rgba(255, 255, 255, 0.82) !important;
}
[data-style="dark"] .ais-topbar,
[data-style="dark"] .ais-topbar a,
[data-style="dark"] .welcome-banner,
[data-style="dark"] .welcome-banner p,
[data-style="dark"] .welcome-banner h1,
[data-style="dark"] .welcome-banner h2 {
  color: inherit;
}
[data-style="dark"] footer h6.text-black,
[data-style="dark"] footer .text-black.small {
  color: #f1f5f9 !important;
}

/* ═══ Header AIS ═══ */
[data-style="dark"] .ais-topbar,
[data-style="dark"] .ais-topbar-fill {
  background: #0f2749;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
[data-style="dark"] .ais-topbar a,
[data-style="dark"] .ais-brand,
[data-style="dark"] .ais-topbar-utils > a {
  color: rgba(255, 255, 255, 0.92) !important;
}

[data-style="dark"] .ais-mainnav {
  background: #111827 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-style="dark"] body.page-home .ais-mainnav {
  background: rgba(17, 24, 39, 0.98) !important;
  backdrop-filter: blur(8px);
}

[data-style="dark"] .ais-menu > li > a {
  color: #e2e8f0 !important;
}
[data-style="dark"] .ais-menu > li > a:hover,
[data-style="dark"] .ais-menu > li.active > a {
  color: #60a5fa !important;
  border-bottom-color: #60a5fa;
}

[data-style="dark"] .ais-dropdown {
  background: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45) !important;
}
[data-style="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) a,
[data-style="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) button.ais-dropdown__action,
[data-theme="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) a,
[data-theme="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) button.ais-dropdown__action {
  color: #e2e8f0 !important;
}
[data-style="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) a:hover,
[data-style="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) button.ais-dropdown__action:hover,
[data-theme="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) a:hover,
[data-theme="dark"] .ais-dropdown:not(.ais-dropdown--games-nav) li:not(.ais-dropdown__head):not(.ais-dropdown__sep):not(.ais-games-nav__shell) button.ais-dropdown__action:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
}
[data-style="dark"] .ais-dropdown__text strong,
[data-style="dark"] .ais-dropdown li a strong,
[data-theme="dark"] .ais-dropdown__text strong,
[data-theme="dark"] .ais-dropdown li a strong {
  color: #f1f5f9 !important;
}
[data-style="dark"] .ais-dropdown__text small,
[data-style="dark"] .ais-dropdown li a small,
[data-theme="dark"] .ais-dropdown__text small,
[data-theme="dark"] .ais-dropdown li a small {
  color: #94a3b8 !important;
}
[data-style="dark"] .ais-dropdown li a i {
  color: #60a5fa;
}

[data-style="dark"] .ais-account-menu {
  background: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.5) !important;
}
[data-style="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) a,
[data-style="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) button.ais-dropdown__action,
[data-theme="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) a,
[data-theme="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) button.ais-dropdown__action {
  color: #e2e8f0 !important;
}
[data-style="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) a:hover,
[data-style="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) button.ais-dropdown__action:hover,
[data-theme="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) a:hover,
[data-theme="dark"] .ais-account-menu li:not(.ais-dropdown__head):not(.ais-dropdown__sep) button.ais-dropdown__action:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc !important;
}
[data-style="dark"] .ais-account-menu li a strong,
[data-theme="dark"] .ais-account-menu li a strong {
  color: #f1f5f9 !important;
}
[data-style="dark"] .ais-account-menu li a small,
[data-theme="dark"] .ais-account-menu li a small {
  color: #94a3b8 !important;
}
[data-style="dark"] .ais-account-menu li a.text-danger {
  color: #f87171 !important;
}
[data-style="dark"] .ais-account-menu li a.text-danger:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
}
[data-style="dark"] .ais-account-menu hr {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-style="dark"] .ais-mobile-toggle {
  color: #e2e8f0 !important;
}

@media (max-width: 991.98px) {
  [data-style="dark"] .ais-menu {
    background: #111827 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  [data-style="dark"] .ais-menu > li > a {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
  [data-style="dark"] .ais-dropdown {
    background: #0f172a !important;
  }
}

/* ═══ Vitrine / pages produit ═══ */
[data-style="dark"] .os-box,
[data-style="dark"] .pricing-card,
[data-style="dark"] .plan-card,
[data-style="dark"] .feature-card {
  background-color: #111827 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

[data-style="dark"] .text-muted {
  color: var(--ais-text-muted) !important;
}

[data-style="dark"] .list-group-item {
  background-color: #111827 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}
[data-style="dark"] .list-group-item-action:hover {
  background-color: #1f2937 !important;
}

[data-style="dark"] .nav-tabs {
  border-color: rgba(255, 255, 255, 0.1);
}
[data-style="dark"] .nav-tabs .nav-link {
  color: var(--ais-text-muted);
}
[data-style="dark"] .nav-tabs .nav-link.active {
  background-color: #111827 !important;
  border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) #111827 !important;
  color: #f8fafc !important;
}

[data-style="dark"] .breadcrumb-item,
[data-style="dark"] .breadcrumb-item a {
  color: var(--ais-text-muted) !important;
}
[data-style="dark"] .breadcrumb-item.active {
  color: #e2e8f0 !important;
}

[data-style="dark"] .shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.35) !important;
}

[data-style="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(255, 255, 255, 0.02);
  color: #e2e8f0;
}

[data-style="dark"] .table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

[data-style="dark"] .offcanvas,
[data-style="dark"] .offcanvas-body {
  background-color: #111827 !important;
  color: #f8fafc !important;
}

[data-style="dark"] .toast {
  background-color: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

[data-style="dark"] .popover {
  background-color: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
[data-style="dark"] .popover-header {
  background-color: #111827 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}
[data-style="dark"] .popover-body {
  color: #e2e8f0 !important;
}

[data-style="dark"] .tooltip-inner {
  background-color: #374151;
}

[data-style="dark"] hr {
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

[data-style="dark"] .border-light {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-style="dark"] code {
  background-color: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

[data-style="dark"] pre {
  background-color: #0f172a !important;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Panier / commande */
[data-style="dark"] .cart-item,
[data-style="dark"] .order-summary,
[data-style="dark"] .checkout-box {
  background-color: #111827 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* DataTables (manager) */
[data-style="dark"] div.dataTables_wrapper div.dataTables_length select,
[data-style="dark"] div.dataTables_wrapper div.dataTables_filter input {
  background-color: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}
[data-style="dark"] div.dataTables_wrapper div.dataTables_info,
[data-style="dark"] div.dataTables_wrapper div.dataTables_length label {
  color: var(--ais-text-muted) !important;
}
[data-style="dark"] div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-link {
  background-color: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #93c5fd !important;
}
[data-style="dark"] div.dataTables_wrapper div.dataTables_paginate ul.pagination .page-link:hover {
  background-color: #374151 !important;
  color: #fff !important;
}

[data-style="dark"] .nav-sidebar .nav-link {
  color: var(--text-muted, var(--ais-text-muted));
}
[data-style="dark"] .nav-sidebar .nav-link:hover {
  background: rgba(22, 58, 114, 0.1);
  color: #93c5fd;
}

[data-style="dark"] .form-label-pro {
  color: var(--ais-text-muted);
}

[data-style="dark"] .btn-pro.btn-light,
[data-style="dark"] .btn-pro.btn-outline-secondary {
  background-color: #1f2937 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

/* Home.css sections (si dark activé hors accueil) */
[data-style="dark"] body.page-home {
  background-color: #0b0f19 !important;
}
[data-style="dark"] body.page-home .ais-home-offers-section,
[data-style="dark"] .ais-home-offer-card,
[data-style="dark"] .ais-home-plan-tile {
  background: #111827 !important;
  color: #e2e8f0;
}
[data-style="dark"] .ais-home-section-title {
  color: #f8fafc !important;
}
[data-style="dark"] .ais-home-hex-bg {
  background:
    linear-gradient(180deg, rgb(12, 14, 20) 0%, #0b0f19 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5-13-7.5v-15l13-7.5M0 22.92l13-7.5v15l-13 7.5V22.92zm14 0l13-7.5v15l-13 7.5v-15z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* -- Inline styles hérités du mode clair -- */
[data-style="dark"] [style*="color: #64748b"],
[data-style="dark"] [style*="color:#64748b"],
[data-style="dark"] [style*="color: #475569"],
[data-style="dark"] [style*="color:#475569"],
[data-style="dark"] [style*="color: #334155"],
[data-style="dark"] [style*="color:#334155"] {
  color: var(--ais-text-muted) !important;
}

[data-style="dark"] [style*="color: #1e293b"],
[data-style="dark"] [style*="color:#1e293b"] {
  color: var(--ais-text-secondary) !important;
}

/* -- Icônes secondaires -- */
[data-style="dark"] .text-muted i,
[data-style="dark"] .text-muted .ti,
[data-style="dark"] .text-muted .bi,
[data-style="dark"] .res-desc i,
[data-style="dark"] .ca-kpi-desc i {
  color: var(--ais-icon-muted);
}

[data-style="dark"] .res-title,
[data-style="dark"] .res-desc {
  color: var(--ais-text-muted) !important;
}

[data-style="dark"] .page-btn:disabled {
  opacity: 0.58;
}

/* -- Espace client : compléments lisibilité -- */
[data-style="dark"] .ca-empty-icon,
[data-style="dark"] .ca-empty--services .ca-empty-icon {
  color: var(--ais-icon-muted) !important;
}

[data-style="dark"] .ca-empty p,
[data-style="dark"] .ca-page .manager-thead th,
[data-style="dark"] .ca-page .table thead th,
[data-style="dark"] .ca-service-meta,
[data-style="dark"] .ca-invoice-amount,
[data-style="dark"] .ca-page:not(.ca-admin-page) .nav-sidebar .nav-link {
  color: var(--ais-text-muted) !important;
}

/* -- Accueil : avis -- */
[data-style="dark"] .ais-home-review-meta small {
  color: var(--ais-text-muted) !important;
}

[data-style="dark"] .ais-home-schema-unit i {
  color: var(--ais-icon-muted);
}
/* -- Panier -- */
[data-style="dark"] .cart-meta-label,
[data-style="dark"] .cart-summary-details span,
[data-style="dark"] .cart-duration-trigger i {
  color: var(--ais-text-muted) !important;
}
