/**
 * Theme Name: Custom CB
 * Theme URI:  https://academie-rituels-spas.com
 * Description: Thème sur-mesure pour l'Académie des Rituels de Spas. Version autonome sans dépendance Elementor.
 * Author:     Camille Becht
 * Version:    2.0.0
 * Text Domain: custom-cb
 * Tags:       custom-theme, tailwind
 */

/* ===============================================
   STYLES POUR LES FORMATIONS - DESIGN ÉPURÉ
   =============================================== */

/* FIX PERFORMANCE: NUCLEAR RESET
   Prevents 'Root Scroller' Layer Promotion (57MB Layer Loop)
   Force standard flow layout for the browser engine.
*/
html {
    height: auto !important;
    overflow-y: scroll !important; /* Force scrollbar to avoid layout jump */
    overflow-x: hidden !important;
    min-height: 100% !important;
}

body {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    position: static !important; /* CRITICAL: Prevent relative/fixed on body */
    transform: none !important;
    filter: none !important;
    perspective: none !important;
    background-attachment: scroll !important;
    /* contain: content !important; REMOVED: Breaks fixed positioning (FABs) */
}

/* Complianz banner: pas d'isolement pour éviter les masques d'affichage */
.cmplz-cookiebanner, #cmplz-cookiebanner-container {
    contain: none !important;
    z-index: 99999 !important;
}

/* Variables CSS - Utilisation directe des variables Elementor globales */
:root {
  /* Espacements */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Autres */
  --border-radius: 8px;
  --box-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --box-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --box-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Planning Digiforma */
.digiforma-sessions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.session-item {
  padding: var(--spacing-md);
  background: var(--e-global-color-background, #ffffff);
  border: 2px solid var(--e-global-color-border, #e5e7eb);
  border-radius: var(--border-radius);
  transition: all 0.3s;
  box-shadow: var(--box-shadow-sm);
}

/* Infobulle sur les cellules du calendrier */
.calendar-day.in-range {
  cursor: pointer;
}

.calendar-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--e-global-color-heading, var(--e-global-color-text, #1f2937));
  color: var(--e-global-color-background, #ffffff);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: normal;
  width: 280px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  /* Add delay to visibility to prevent instant closing */
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
  transition-delay: 0.1s; 
  text-align: left;
}

.calendar-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--e-global-color-heading, var(--e-global-color-text, #1f2937));
}

/* Invisible bridge for safe hover */
.calendar-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px; /* Bridges the 12px gap defined in bottom: calc(100% + 12px) */
  background: transparent;
}

.calendar-day.in-range:hover .calendar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Styles pour le contenu de l'infobulle */
.calendar-tooltip .tooltip-title {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: 0.9375rem;
  color: var(--e-global-color-background, #ffffff);
  font-weight: 600;
}

.calendar-tooltip .tooltip-date,
.calendar-tooltip .tooltip-duration {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
  font-size: 0.8125rem;
  opacity: 0.95;
}

.calendar-tooltip .tooltip-date:first-child,
.calendar-tooltip .tooltip-duration:first-child {
  margin-top: 0;
}

.calendar-tooltip .tooltip-date i,
.calendar-tooltip .tooltip-duration i {
  font-size: 0.75rem;
  width: 14px;
  text-align: center;
}

.session-date {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  color: var(--e-global-color-primary, #2563eb);
  font-size: 1rem;
}

.session-date i {
  font-size: 1.1rem;
}

.session-name {
  font-weight: 600;
  color: var(--e-global-color-heading, var(--e-global-color-text, #1f2937));
  margin-bottom: var(--spacing-xs);
  font-size: 0.95rem;
}

.session-location,
.session-places {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
  color: var(--e-global-color-text, #6b7280);
  margin-top: var(--spacing-xs);
}

.session-location i,
.session-places i {
  color: var(--e-global-color-secondary, #6b7280);
  font-size: 0.875rem;
}

.session-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--spacing-sm);
  text-transform: uppercase;
}

.session-status.status-confirmed,
.session-status.status-ouvert {
  background: #d1fae5;
  color: #065f46;
}

.session-status.status-draft,
.session-status.status-brouillon {
  background: #fef3c7;
  color: #92400e;
}

.session-status.status-cancelled,
.session-status.status-annulé {
  background: #fee2e2;
  color: #991b1b;
}

.session-note {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--e-global-color-border, #e5e7eb);
  text-align: center;
  color: var(--e-global-color-text, #6b7280);
  font-size: 0.875rem;
}

.session-note i {
  margin-right: 0.25rem;
  color: var(--e-global-color-primary, #2563eb);
}

/* ===============================================
   CALENDRIER DIGIFORMA
   =============================================== */
.digiforma-calendar-container {
  margin-bottom: var(--spacing-xl);
}

.calendar-month {
  margin-bottom: var(--spacing-2xl);
  position: relative;
}

.calendar-month:last-child {
  margin-bottom: 0;
}

.calendar-wrapper {
  position: relative;
  background: var(--e-global-color-background, #ffffff);
  border: 1px solid var(--e-global-color-border, #e5e7eb);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  overflow: visible;
}

.calendar-month-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--e-global-color-heading, var(--e-global-color-text, #1f2937));
  margin: 0 0 var(--spacing-lg) 0;
  text-align: center;
  text-transform: capitalize;
}

.calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.875rem;
}

.calendar-table thead th {
  padding: var(--spacing-sm);
  text-align: center;
  font-weight: 600;
  color: var(--e-global-color-text, #6b7280);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.calendar-day {
  width: calc(100% / 7);
  height: 65px;
  padding: 8px 4px;
  text-align: center;
  vertical-align: top;
  border: 1px solid var(--e-global-color-border, #e5e7eb);
  position: relative;
  background: var(--e-global-color-background, #ffffff);
  transition: background-color 0.2s;
  overflow: visible;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.weekend {
  background: rgba(0, 0, 0, 0.02);
}

.calendar-day.today {
  background: color-mix(in srgb, var(--e-global-color-primary, #2563eb) 8%, transparent);
  border-color: var(--e-global-color-primary, #2563eb);
  font-weight: 600;
}

.calendar-day.has-session {
  background: color-mix(in srgb, var(--e-global-color-primary, #2563eb) 5%, transparent);
  cursor: pointer;
}

.calendar-day.has-session:hover {
  background: color-mix(in srgb, var(--e-global-color-primary, #2563eb) 12%, transparent);
}

.calendar-day-number {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--e-global-color-text, #1f2937);
  line-height: 1.2;
  position: relative;
  z-index: 2;
}

.calendar-day.weekend .calendar-day-number {
  color: var(--e-global-color-text, #6b7280);
}

.calendar-day.today .calendar-day-number {
  color: var(--e-global-color-primary, #2563eb);
  font-weight: 700;
}

.calendar-day.has-session .calendar-day-number {
  color: var(--e-global-color-primary, #2563eb);
  font-weight: 600;
}

/* Cellules dans une plage de dates */
.calendar-day.in-range {
  background: color-mix(in srgb, var(--e-global-color-primary, #2563eb) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--e-global-color-primary, #2563eb) 30%, transparent);
}

.calendar-day.in-range:hover {
  background: color-mix(in srgb, var(--e-global-color-primary, #2563eb) 18%, transparent) !important;
}

.calendar-day.in-range .calendar-day-number {
  color: var(--e-global-color-primary, #2563eb);
  font-weight: 600;
}

/* Position dans la plage - coins arrondis */
.calendar-day.range-start {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.calendar-day.range-end {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.calendar-day.range-single {
  border-radius: 6px;
}

/* Responsive calendrier */
@media (max-width: 768px) {
  .calendar-wrapper {
    padding: var(--spacing-md);
  }

  .calendar-month-title {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
  }

  .calendar-table {
    border-spacing: 1px;
  }

  .calendar-day {
    height: 50px;
    padding: 4px 2px;
  }

  .calendar-day-number {
    font-size: 0.8125rem;
  }

  .calendar-table thead th {
    font-size: 0.7rem;
    padding: var(--spacing-xs);
  }
}

/* ===============================================
   BOUTONS FLOTTANTS
   Utilisation des variables CSS globales d'Elementor
   =============================================== */
.floating-action-buttons {
  position: fixed;
  bottom: 100px; /* Eviter le chevauchement avec le chatbot */
  right: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  z-index: 9999;
  font-family: var(--e-global-typography-primary-font-family, var(--font-primary));
  align-items: flex-end;
}

.fab-button {
  position: relative;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #b58c6e; /* GOLD COLOR */
  color: var(--e-global-color-background, #ffffff);
  text-decoration: none;
  box-shadow: var(--box-shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  /* Remplacement du filter qui cause des lags par opacity */
  opacity: 0.9;
}

.fab-button svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.fab-button:hover svg {
  transform: scale(1.1);
}

/* Labels au survol */
.fab-label {
  position: absolute;
  right: calc(100% + var(--spacing-sm));
  white-space: nowrap;
  background: var(--e-global-color-heading, var(--e-global-color-text, #1f2937));
  color: var(--e-global-color-background, #ffffff);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--e-global-typography-text-font-family, var(--font-text));
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: var(--box-shadow-md);
}

.fab-label::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--e-global-color-heading, var(--e-global-color-text, #1f2937));
}

.fab-button:hover .fab-label {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Couleurs spécifiques pour chaque bouton - Utilisation des variables Elementor */
.fab-brochure {
  background: #b58c6e;
}

.fab-brochure:hover {
  opacity: 0.9;
}

.fab-calendly {
  background: #b58c6e;
}

.fab-calendly:hover {
  opacity: 0.9;
}

.fab-digiforma {
  background: #b58c6e;
}

.fab-digiforma:hover {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
  .floating-action-buttons {
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    gap: var(--spacing-xs);
  }

  .fab-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .fab-button svg {
    width: 20px;
    height: 20px;
  }

  .fab-label {
    font-size: 0.8125rem;
    padding: calc(var(--spacing-xs) / 2) var(--spacing-xs);
  }
}

@media (max-width: 480px) {
  .floating-action-buttons {
    bottom: var(--spacing-xs);
    right: var(--spacing-xs);
  }

  .fab-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .fab-button svg {
    width: 18px;
    height: 18px;
  }

  /* Cacher les labels sur très petits écrans */
  .fab-label {
    display: none;
  }
}

/* ===============================================
   UTILITAIRES
   =============================================== */
.serif-font {
  font-family: var(--e-global-typography-heading-font-family, serif);
}

.font-light {
    font-weight: 300;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lucide Icons support */

/* ===============================================
   PERSONNALISATION CHATBOT
   =============================================== */
#rag-widget-toggle img {
    display: none !important;
}

#rag-widget-toggle {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iI2ZmZmZmZiI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTIwIDJINGMtMS4xIDAtMiAuOS0yIDJ2MThsNC00aDE0YzEuMSAwIDItLjkgMi0yVjRjMC0xLjEtLjktMi0yLTJ6bTAgMTRINmwtMiAyVjRoMTZ2MTJ6Ii8+PC9zdmc+');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px; /* Taille standard 24px pour matcher les autres boutons */
    background-color: #b58c6e !important; /* Force Gold Color override */
}

/* Override Internal Widget Colors */
.rag-widget-header {
    background: #b58c6e !important; /* Header Gold */
    border-bottom: 1px solid #a37c5e !important;
}

.rag-widget-message.user {
    background: #b58c6e !important; /* User Message Gold */
}

.rag-widget-send {
    background: #b58c6e !important; /* Send Button Gold */
}

.rag-widget-contact-form-button.primary {
    background: #b58c6e !important; /* Form Button Gold */
}

.rag-widget-suggested-question:hover {
    background: #b58c6e !important; /* Suggestion Hover Gold */
    color: #fff !important;
}


