/* ==========================================================================
   Switcher LLA - Styles Frontend
   ========================================================================== */

/* --- Variables par défaut --- */
:root {
    --switcher-primary: #6C63FF;
    --switcher-secondary: #f0efff;
    --switcher-text: #333333;
    --switcher-active-text: #ffffff;
}

/* --- Navigation Container --- */
.switcher-lla-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.switcher-lla-nav--horizontal {
    flex-direction: row;
}

.switcher-lla-nav--vertical {
    flex-direction: column;
    align-items: stretch;
}

/* --- Tab Button --- */
.switcher-lla-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-lla-tab:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* --- Tab Inner (flexbox pour icône + label) --- */
.switcher-lla-tab-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Position icône : au-dessus / en-dessous */
.switcher-lla-tab.switcher-lla-icon--above .switcher-lla-tab-inner,
.switcher-lla-tab.switcher-lla-icon--below .switcher-lla-tab-inner {
    flex-direction: column;
}

/* --- Icône --- */
.switcher-lla-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-lla-tab-icon svg {
    fill: currentColor;
}

/* ==========================================================================
   PRESETS DE STYLE
   ========================================================================== */

/* --- Preset : Pill / Capsule --- */
.switcher-lla-preset--pill .switcher-lla-tab {
    padding: 10px 24px;
    border-radius: 50px;
    background: var(--switcher-secondary);
    color: var(--switcher-text);
    font-weight: 500;
}

.switcher-lla-preset--pill .switcher-lla-tab:hover {
    background: color-mix(in srgb, var(--switcher-primary) 20%, var(--switcher-secondary));
    transform: translateY(-1px);
}

.switcher-lla-preset--pill .switcher-lla-tab.active {
    background: var(--switcher-primary);
    color: var(--switcher-active-text);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--switcher-primary) 40%, transparent);
    transform: translateY(-1px);
}

/* --- Preset : Underline --- */
.switcher-lla-preset--underline .switcher-lla-tab {
    padding: 12px 20px;
    background: transparent;
    color: var(--switcher-text);
    border-bottom: 3px solid transparent;
    font-weight: 500;
    border-radius: 0;
}

.switcher-lla-preset--underline .switcher-lla-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--switcher-primary);
    border-radius: 3px 3px 0 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.switcher-lla-preset--underline .switcher-lla-tab:hover::before {
    width: 50%;
}

.switcher-lla-preset--underline .switcher-lla-tab.active {
    color: var(--switcher-primary);
}

.switcher-lla-preset--underline .switcher-lla-tab.active::before {
    width: 100%;
}

/* --- Preset : Toggle Switch --- */
.switcher-lla-preset--toggle {
    background: var(--switcher-secondary);
    border-radius: 50px;
    padding: 4px;
    gap: 0 !important;
}

.switcher-lla-preset--toggle .switcher-lla-tab {
    padding: 10px 28px;
    border-radius: 50px;
    color: var(--switcher-text);
    font-weight: 500;
    z-index: 1;
    transition: color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-lla-preset--toggle .switcher-lla-tab:hover:not(.active) {
    color: var(--switcher-primary);
}

.switcher-lla-preset--toggle .switcher-lla-tab.active {
    background: var(--switcher-primary);
    color: var(--switcher-active-text);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--switcher-primary) 35%, transparent);
}

/* --- Preset : Card / Carte --- */
.switcher-lla-preset--card .switcher-lla-tab {
    padding: 14px 24px;
    border-radius: 12px;
    background: var(--switcher-secondary);
    color: var(--switcher-text);
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-lla-preset--card .switcher-lla-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: color-mix(in srgb, var(--switcher-primary) 30%, transparent);
}

.switcher-lla-preset--card .switcher-lla-tab.active {
    background: var(--switcher-primary);
    color: var(--switcher-active-text);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--switcher-primary) 35%, transparent);
    border-color: transparent;
}

/* --- Preset : Gradient Glow --- */
.switcher-lla-preset--glow .switcher-lla-tab {
    padding: 12px 26px;
    border-radius: 10px;
    background: transparent;
    color: var(--switcher-text);
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--switcher-text) 15%, transparent);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-lla-preset--glow .switcher-lla-tab:hover {
    border-color: var(--switcher-primary);
    color: var(--switcher-primary);
    box-shadow: 0 0 20px color-mix(in srgb, var(--switcher-primary) 20%, transparent);
}

.switcher-lla-preset--glow .switcher-lla-tab.active {
    background: linear-gradient(135deg, var(--switcher-primary), color-mix(in srgb, var(--switcher-primary) 70%, #ff6b6b));
    color: var(--switcher-active-text);
    border-color: transparent;
    box-shadow:
        0 0 20px color-mix(in srgb, var(--switcher-primary) 40%, transparent),
        0 0 40px color-mix(in srgb, var(--switcher-primary) 15%, transparent);
    animation: switcher-glow-pulse 2s ease-in-out infinite;
}

@keyframes switcher-glow-pulse {
    0%, 100% {
        box-shadow:
            0 0 20px color-mix(in srgb, var(--switcher-primary) 40%, transparent),
            0 0 40px color-mix(in srgb, var(--switcher-primary) 15%, transparent);
    }
    50% {
        box-shadow:
            0 0 25px color-mix(in srgb, var(--switcher-primary) 50%, transparent),
            0 0 50px color-mix(in srgb, var(--switcher-primary) 25%, transparent);
    }
}

/* ==========================================================================
   INDICATEUR ACTIF (pseudo-élément ::after)
   ========================================================================== */

/* Par défaut : pas d'indicateur */
.switcher-lla-tab::after {
    content: none;
}

/* L'indicateur n'apparaît QUE sur l'onglet actif ET quand une position est définie */
.switcher-lla-indicator--bottom .switcher-lla-tab.active::after,
.switcher-lla-indicator--top .switcher-lla-tab.active::after,
.switcher-lla-indicator--left .switcher-lla-tab.active::after,
.switcher-lla-indicator--right .switcher-lla-tab.active::after {
    content: '';
    position: absolute;
    transition: background-color 0.3s ease;
}

/* Indicateur en bas */
.switcher-lla-indicator--bottom .switcher-lla-tab.active::after {
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--switcher-indicator-size, 3px);
}

/* Indicateur en haut */
.switcher-lla-indicator--top .switcher-lla-tab.active::after {
    top: 0;
    left: 0;
    right: 0;
    height: var(--switcher-indicator-size, 3px);
}

/* Indicateur à gauche */
.switcher-lla-indicator--left .switcher-lla-tab.active::after {
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--switcher-indicator-size, 3px);
    height: auto;
}

/* Indicateur à droite */
.switcher-lla-indicator--right .switcher-lla-tab.active::after {
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--switcher-indicator-size, 3px);
    height: auto;
}

/* Masquer complètement si désactivé */
.switcher-lla-indicator--none .switcher-lla-tab::after {
    content: none !important;
    display: none !important;
}

/* Les presets underline / toggle / glow n'utilisent pas l'indicateur ::after standard */
.switcher-lla-preset--underline .switcher-lla-tab.active::after,
.switcher-lla-preset--toggle .switcher-lla-tab.active::after,
.switcher-lla-preset--glow .switcher-lla-tab.active::after {
    content: none !important;
    display: none !important;
}

/* ==========================================================================
   ANIMATIONS DE CONTENU
   ========================================================================== */

/* --- Containers cibles : états --- */
.switcher-lla-hidden {
    display: none !important;
}

/* Container en cours d'animation */
.switcher-lla-animating {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* Perspective pour les animations 3D (flip) */
.switcher-lla-perspective {
    perspective: 1200px;
}

/* ==========================================================================
   SWITCHER LLA CONTAINER - Widget Container Navigation
   ========================================================================== */

/* Le widget config est invisible */
.switcher-lla-container-config {
    display: none !important;
}

/* Container navigation : état par défaut (les styles inline sont appliqués via JS) */
.switcher-lla-container-active {
    /* Classe ajoutée par le JS au container-nav actif */
}

/* ==========================================================================
   COMPARATEUR
   ========================================================================== */

/* Wrapper du bouton comparer */
.switcher-lla-compare-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Bouton Comparer */
.switcher-lla-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switcher-lla-compare-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.switcher-lla-compare-btn.active {
    animation: switcher-compare-pulse 0.3s ease;
}

@keyframes switcher-compare-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Instruction texte */
.switcher-lla-compare-instruction {
    display: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.switcher-lla-compare-instruction.visible {
    display: block;
    animation: switcher-compare-fade-in 0.3s ease both;
}

@keyframes switcher-compare-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Badge de sélection sur les nav containers en mode comparaison */
.switcher-lla-compare-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    opacity: 0;
    transform: scale(0);
}

.switcher-lla-compare-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* Container en mode comparaison : overlay pour indiquer qu'il est sélectionnable */
.switcher-lla-compare-selectable {
    position: relative;
    cursor: pointer;
}

.switcher-lla-compare-selectable::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed transparent;
    border-radius: inherit;
    transition: border-color 0.3s ease, border-style 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

/* Les couleurs et épaisseurs sont injectées via <style> PHP ciblant chaque #nav-id */
.switcher-lla-compare-selected::before {
    border-style: solid;
}

/* Zone d'affichage côte à côte */
.switcher-lla-compare-view {
    display: none !important;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.switcher-lla-compare-view.visible {
    display: grid !important;
    opacity: 0;
}

.switcher-lla-compare-view.visible.switcher-lla-compare-reveal {
    opacity: 1;
}

/* Neutraliser les animations Elementor sur les containers dans les slots de comparaison */
.switcher-lla-compare-slot .elementor-invisible {
    visibility: visible !important;
}

.switcher-lla-compare-slot > * {
    animation-name: none !important;
    animation-duration: 0s !important;
}

/* Séparateur central */
.switcher-lla-compare-separator {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

/* Labels VS dans le séparateur — les valeurs visuelles sont injectées via JS depuis la config */
.switcher-lla-compare-vs {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 6;
    box-sizing: border-box;
}

/* Slots de comparaison */
.switcher-lla-compare-slot {
    min-height: 100px;
    min-width: 0;
    overflow: hidden;
}

/* Forcer les containers Elementor dans les slots à respecter la grille */
.switcher-lla-compare-slot > .elementor-element,
.switcher-lla-compare-slot > [data-elementor-type],
.switcher-lla-compare-slot > .e-con {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Responsive */
.switcher-lla-compare-view.stacked {
    grid-template-columns: 1fr;
}

.switcher-lla-compare-view.stacked .switcher-lla-compare-separator {
    display: none;
}

.switcher-lla-compare-view.stacked .switcher-lla-compare-vs {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 10px auto;
}
