/**
 * Shortcodes DEMG - CSS commun (frontend)
 * Chargé par tous les shortcodes DEMG via `demg_enqueue_shortcodes_common_assets()`.
 * 
 * Styles dédiés pour éviter les conflits avec les thèmes WordPress, Elementor et autres plugins.
 * Isolation complète du plugin pour garantir un rendu cohérent.
 */

/* ========================================
   ISOLATION PRINCIPALE - Wrapper DEMG
   ======================================== */

.demg-shortcode {
  /* Isolation du box-model */
  box-sizing: border-box;
  
  /* Isolation des styles de typographie */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  
  /* Isolation des marges/paddings */
  margin: 0;
  padding: 0;
  
  /* Isolation du positionnement */
  position: relative;
  
  /* Isolation des transformations */
  transform: none;
  
  /* Isolation des filtres (pour éviter les conflits avec Elementor) */
  filter: none;
  backdrop-filter: none;
  
  /* Isolation de l'overflow */
  overflow: visible;
  
  /* Isolation de la visibilité */
  visibility: visible;
  opacity: 1;
  
  /* Isolation des z-index */
  z-index: auto;
  
  /* Forcer le fond blanc pour éviter les conflits avec Elementor/thème */
  background-color: #ffffff !important;
  background: #ffffff !important;
}

/* Reset complet pour tous les éléments enfants */
.demg-shortcode *,
.demg-shortcode *::before,
.demg-shortcode *::after {
  box-sizing: inherit;
  
  /* Réinitialiser les styles qui pourraient venir d'Elementor */
  animation: none !important;
  transition: none;
  
  /* Isolation des transformations */
  transform: none;
  
  /* Isolation des filtres */
  filter: none;
  backdrop-filter: none;
}

/* Réinitialiser les transitions uniquement pour les éléments DEMG */
.demg-shortcode .demg-transition,
.demg-shortcode [class*="demg-"] {
  transition: all 0.3s ease;
}

/* Isolation contre Elementor - Réinitialiser les styles globaux */
.demg-shortcode.elementor-widget,
.demg-shortcode.elementor-element,
.demg-shortcode.elementor-section {
  /* Réinitialiser les styles Elementor */
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Isolation contre les thèmes - Réinitialiser les styles de conteneur */
.demg-shortcode .container,
.demg-shortcode .container-fluid,
.demg-shortcode .row,
.demg-shortcode .col,
.demg-shortcode [class*="col-"] {
  /* Réinitialiser les styles Bootstrap/Foundation si présents */
  padding: 0;
  margin: 0;
  width: auto;
  max-width: none;
}

/* Isolation des formulaires */
.demg-shortcode form,
.demg-shortcode input,
.demg-shortcode textarea,
.demg-shortcode select,
.demg-shortcode button {
  /* Réinitialiser les styles de formulaire du thème */
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
  outline: none;
}

/* Isolation des boutons */
.demg-shortcode button,
.demg-shortcode .button,
.demg-shortcode input[type="button"],
.demg-shortcode input[type="submit"] {
  /* Réinitialiser les styles de bouton du thème */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* Isolation des liens */
.demg-shortcode a {
  /* Réinitialiser les styles de lien du thème */
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

/* Isolation des listes */
.demg-shortcode ul,
.demg-shortcode ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Isolation des titres */
.demg-shortcode h1,
.demg-shortcode h2,
.demg-shortcode h3,
.demg-shortcode h4,
.demg-shortcode h5,
.demg-shortcode h6 {
  margin: 0;
  padding: 0;
  font-weight: 600;
  line-height: 1.2;
}

/* Isolation des paragraphes */
.demg-shortcode p {
  margin: 0;
  padding: 0;
}

/* Isolation des images */
.demg-shortcode img {
  max-width: 100%;
  height: auto;
  display: block;
  border: none;
  box-shadow: none;
}

/* Isolation des tableaux */
.demg-shortcode table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}


/* Isolation des tooltips */
.demg-shortcode .demg-tooltip,
.demg-shortcode [class*="demg-tooltip"] {
  z-index: 999998 !important;
}

/* Helpers */
.demg-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Styles dédiés pour les KPIs dans les shortcodes */
/* Force les styles pour éviter les conflits avec les thèmes WordPress */
.demg-shortcode .demg-stat-card,
.demg-espace-membre .demg-stat-card {
  color: #ffffff !important;
}

.demg-shortcode .demg-stat-value,
.demg-espace-membre .demg-stat-value {
  color: #ffffff !important;
}

.demg-shortcode .demg-stat-label,
.demg-espace-membre .demg-stat-label {
  color: #ffffff !important;
}

.demg-shortcode .demg-stat-button,
.demg-espace-membre .demg-stat-button {
  color: #ffffff !important;
}

.demg-shortcode .demg-stat-button:hover,
.demg-espace-membre .demg-stat-button:hover {
  color: #ffffff !important;
}

/* Styles dédiés pour le header moderne - Force les styles blancs */
.demg-shortcode .demg-member-welcome-modern,
.demg-espace-membre .demg-member-welcome-modern {
  color: #ffffff !important;
}

.demg-shortcode .demg-member-welcome-modern .demg-username,
.demg-espace-membre .demg-member-welcome-modern .demg-username {
  color: rgba(255, 255, 255, 0.95) !important;
}

.demg-shortcode .demg-member-subtitle-modern,
.demg-espace-membre .demg-member-subtitle-modern {
  color: rgba(255, 255, 255, 0.85) !important;
}

.demg-shortcode .demg-last-login,
.demg-espace-membre .demg-last-login {
  color: rgba(255, 255, 255, 0.95) !important;
}

.demg-shortcode .demg-header-notifications-btn,
.demg-espace-membre .demg-header-notifications-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 48px !important;
  height: 48px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

.demg-shortcode .demg-header-notifications-btn:hover,
.demg-espace-membre .demg-header-notifications-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

.demg-shortcode .demg-header-notifications-btn .dashicons,
.demg-espace-membre .demg-header-notifications-btn .dashicons {
  color: #ffffff !important;
  font-size: 20px !important;
  width: 20px !important;
  height: 20px !important;
}

.demg-shortcode .demg-notifications-badge,
.demg-espace-membre .demg-notifications-badge {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  min-width: 18px !important;
  height: 18px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 18px !important;
  text-align: center !important;
}

.demg-shortcode .demg-header-notifications-btn,
.demg-espace-membre .demg-header-notifications-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 48px !important;
  height: 48px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

.demg-shortcode .demg-header-notifications-btn:hover,
.demg-espace-membre .demg-header-notifications-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

.demg-shortcode .demg-header-notifications-btn .dashicons,
.demg-espace-membre .demg-header-notifications-btn .dashicons {
  color: #ffffff !important;
  font-size: 20px !important;
  width: 20px !important;
  height: 20px !important;
}

.demg-shortcode .demg-notifications-badge,
.demg-espace-membre .demg-notifications-badge {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  min-width: 18px !important;
  height: 18px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 18px !important;
  text-align: center !important;
}

.demg-shortcode .demg-header-action-btn,
.demg-espace-membre .demg-header-action-btn {
  color: #ffffff !important;
  height: 48px !important;
  line-height: 24px !important;
  box-sizing: border-box !important;
}

.demg-shortcode .demg-header-action-btn:hover,
.demg-espace-membre .demg-header-action-btn:hover {
  color: #ffffff !important;
}

.demg-shortcode .demg-header-action-btn .dashicons,
.demg-espace-membre .demg-header-action-btn .dashicons {
  color: #ffffff !important;
}

.demg-shortcode .demg-member-subtitle-modern .dashicons,
.demg-espace-membre .demg-member-subtitle-modern .dashicons {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Styles dédiés pour l'input de recherche - Force les styles pour éviter les conflits */
.demg-shortcode .demg-header-search-wrapper,
.demg-espace-membre .demg-header-search-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.demg-shortcode .demg-header-search-input,
.demg-espace-membre .demg-header-search-input {
  padding: 12px 40px 12px 16px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  width: 280px !important;
  height: 48px !important;
  line-height: 24px !important;
  transition: all 0.3s ease !important;
  outline: none !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  box-sizing: border-box !important;
}

.demg-shortcode .demg-header-search-input::placeholder,
.demg-espace-membre .demg-header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.7) !important;
}

.demg-shortcode .demg-header-search-input:focus,
.demg-espace-membre .demg-header-search-input:focus {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.demg-shortcode .demg-header-search-icon,
.demg-espace-membre .demg-header-search-icon {
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 18px !important;
  width: 18px !important;
  height: 18px !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* Styles pour le bouton outils */
.demg-shortcode .demg-header-tools-btn,
.demg-espace-membre .demg-header-tools-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 48px !important;
  height: 48px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  margin-left: 12px !important;
}

.demg-shortcode .demg-header-tools-btn:hover,
.demg-espace-membre .demg-header-tools-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.demg-shortcode .demg-header-tools-btn .dashicons,
.demg-espace-membre .demg-header-tools-btn .dashicons {
  color: #ffffff !important;
  font-size: 20px !important;
  width: 20px !important;
  height: 20px !important;
}

