/* ============================
   GALAXY 7 – VISION PANEL
   ============================ */

/* ----- Variables globales (facilement surchargées par site) ----- */
:root {
  --g7-vision-button-size: 52px;
  --g7-vision-z: 99999;

  /* Couleurs par défaut (7monenergie) */
  --g7-vision-button-gradient: linear-gradient(135deg, #0ea5e9, #22c55e);
  --g7-vision-button-icon: #ffffff;

  --g7-vision-panel-bg: rgba(15, 23, 42, 0.9);
  --g7-vision-panel-border: rgba(148, 163, 184, 0.45);
  --g7-vision-panel-shadow: 0 18px 40px rgba(15, 23, 42, 0.55);

  --g7-vision-text-main: #e5e7eb;
  --g7-vision-text-muted: #9ca3af;

  --g7-vision-accent: #22c55e;
  --g7-vision-accent-soft: rgba(34, 197, 94, 0.12);
}

/* Tu pourras surcharger ces variables dans chaque site, par exemple :
:root {
  --g7-vision-button-gradient: linear-gradient(135deg, #ef4444, #f97316); // 7monbarbeuc
}
*/

/* ----- Conteneur global ----- */
#g7-vision-widget {
  position: fixed;
  inset: auto 1.5rem 1.5rem auto; /* bottom-right */
  z-index: var(--g7-vision-z);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Ajustement mobile : on remonte légèrement pour éviter les CTA bas de page */
@media (max-width: 640px) {
  #g7-vision-widget {
    inset: auto 1rem 4rem auto; /* un peu plus haut pour ne pas gêner le footer/CTA */
  }
}

/* ----- Bouton flottant ----- */
#g7-vision-toggle {
  width: var(--g7-vision-button-size);
  height: var(--g7-vision-button-size);
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background-image: var(--g7-vision-button-gradient);
  color: var(--g7-vision-button-icon);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);

  transition:
    transform 160ms ease-out,
    box-shadow 160ms ease-out,
    filter 160ms ease-out;
}

/* Icône */
#g7-vision-toggle-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Hover / focus */
#g7-vision-toggle:hover,
#g7-vision-toggle:focus-visible {
  outline: none;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.5);
  filter: brightness(1.03);
}

/* Focus visible (accessibilité) */
#g7-vision-toggle:focus-visible {
  box-shadow:
    0 0 0 2px #0f172a,
    0 0 0 4px rgba(56, 189, 248, 0.9),
    0 16px 40px rgba(15, 23, 42, 0.5);
}

/* ----- Panel (glassmorphism) ----- */
#g7-vision-panel {
  position: absolute;
  right: 0;
  bottom: calc(var(--g7-vision-button-size) + 0.8rem);
  width: 270px;
  max-width: 80vw;

  background: var(--g7-vision-panel-bg);
  border-radius: 18px;
  border: 1px solid var(--g7-vision-panel-border);
  box-shadow: var(--g7-vision-panel-shadow);
  color: var(--g7-vision-text-main);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  padding: 0.85rem 0.9rem 0.9rem;
  box-sizing: border-box;

  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 150ms ease-out,
    transform 150ms ease-out;
}

/* Panel visible */
#g7-vision-panel[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Contenu interne */
.g7-vision-inner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Header du panel */
.g7-vision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

#g7-vision-title {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.g7-vision-close {
  background: transparent;
  border: none;
  color: var(--g7-vision-text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  transition: background 120ms ease-out, color 120ms ease-out;
}

.g7-vision-close:hover,
.g7-vision-close:focus-visible {
  outline: none;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
}

/* Liste des modes */
.g7-vision-modes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Option radio */
.g7-vision-option {
  border-radius: 0.9rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  width: 100%;

  color: var(--g7-vision-text-main);
  font-size: 0.82rem;
  line-height: 1.25;
  transition:
    background 140ms ease-out,
    border-color 140ms ease-out,
    box-shadow 140ms ease-out;
}

.g7-vision-option[data-checked="true"] {
  border-color: rgba(34, 197, 94, 0.85);
  background: linear-gradient(
      135deg,
      rgba(34, 197, 94, 0.12),
      rgba(56, 189, 248, 0.12)
    );
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.g7-vision-option:hover {
  border-color: rgba(148, 163, 184, 0.9);
}

/* Indic radio visuel */
.g7-vision-radio-icon {
  margin-top: 0.1rem;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
  flex-shrink: 0;
  position: relative;
}

.g7-vision-option[data-checked="true"] .g7-vision-radio-icon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: var(--g7-vision-accent);
}

/* Textes option */
.g7-vision-option-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.g7-vision-option-label {
  font-weight: 600;
  font-size: 0.83rem;
}

.g7-vision-option-desc {
  font-size: 0.78rem;
  color: var(--g7-vision-text-muted);
}

/* Bouton reset */
.g7-vision-reset {
  margin-top: 0.3rem;
  border: none;
  background: transparent;
  color: var(--g7-vision-text-muted);
  font-size: 0.78rem;
  text-align: right;
  cursor: pointer;
  padding: 0.2rem 0.1rem 0;
}

.g7-vision-reset:hover,
.g7-vision-reset:focus-visible {
  outline: none;
  color: #e5e7eb;
  text-decoration: underline;
}

/* ====== MODES APPLIQUÉS AU BODY ====== */

/* Standard = pas de classe spéciale ou .g7-vision-standard si tu veux forcer. */
body.g7-vision-standard {
  /* optionnel : définir des valeurs de base */
}

/* ===========================================
   MODE CONTRASTE RENFORCÉ – VERSION SIMPLE
   =========================================== */

body.g7-vision-contrast {
  background-color: #f9fafb !important; /* fond clair */
  color: #020617 !important;            /* texte très sombre */
}

/* Tout le layout passe en fond clair */
body.g7-vision-contrast #page,
body.g7-vision-contrast .site,
body.g7-vision-contrast .site-main,
body.g7-vision-contrast .elementor,
body.g7-vision-contrast main,
body.g7-vision-contrast section,
body.g7-vision-contrast .elementor-section,
body.g7-vision-contrast .elementor-container,
body.g7-vision-contrast .elementor-column,
body.g7-vision-contrast .elementor-widget-container {
  background-color: #ffffff !important;
  color: #111827 !important;
}

/* Cartes / blocs type cards */
body.g7-vision-contrast .card,
body.g7-vision-contrast .box,
body.g7-vision-contrast .g7-card {
  background-color: #ffffff !important;
  color: #111827 !important;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

/* Titres très lisibles */
body.g7-vision-contrast h1,
body.g7-vision-contrast h2,
body.g7-vision-contrast h3,
body.g7-vision-contrast h4,
body.g7-vision-contrast h5,
body.g7-vision-contrast h6 {
  color: #020617 !important;
  font-weight: 700 !important;
}

/* Paragraphes, listes, spans */
body.g7-vision-contrast p,
body.g7-vision-contrast li,
body.g7-vision-contrast span {
  color: #111827 !important;
}

/* Liens : bleu foncé lisible */
body.g7-vision-contrast a {
  color: #1d4ed8 !important;
}

/* Textes “muted” plus foncés mais différenciés */
body.g7-vision-contrast .text-muted,
body.g7-vision-contrast .muted,
body.g7-vision-contrast small {
  color: #4b5563 !important;
}

/* Boutons : fond bleu, texte blanc */
body.g7-vision-contrast .elementor-button,
body.g7-vision-contrast button,
body.g7-vision-contrast .btn {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  filter: none !important;
}

/* Boutons outline */
body.g7-vision-contrast .btn-outline,
body.g7-vision-contrast .elementor-button.elementor-size-sm.elementor-button-outline {
  background-color: transparent !important;
  color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

/* Ne pas casser le panneau lui-même */
body.g7-vision-contrast #g7-vision-panel,
body.g7-vision-contrast #g7-vision-panel * {
  color: inherit;
  background: none;
}

/* Mode nuit / vision confort */
body.g7-vision-night {
  /* légère baisse de luminosité globale */
  filter: brightness(0.95);
}

/* Légère augmentation de la taille de police globale (sans casser la mise en page en général) */
html.g7-vision-night-fontboost {
  font-size: 103%;
}

/* On peut adoucir les ombres si besoin */
body.g7-vision-night * {
  text-shadow: none !important;
}