/**
 * LMJ Onboarding - Styles personnalisés
 * Thème aux couleurs de Le Maître des Jeux
 */

/* ==========================================
   DRIVER.JS - CUSTOMISATION
   ========================================== */

/* L'overlay utilise la couleur définie par JavaScript via overlayColor */
/* Ne pas forcer l'opacité ici pour permettre le réglage admin */

/* Popover principal */
.driver-popover {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 2px solid #ffd700 !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.2) !important;
    padding: 0 !important;
    max-width: 400px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Titre du popover */
.driver-popover-title {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4a 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    padding: 20px 20px 10px !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

/* Description */
.driver-popover-description {
    color: #e0e0e0 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    padding: 0 20px 15px !important;
    margin: 0 !important;
}

/* Footer avec boutons */
.driver-popover-footer {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 215, 0, 0.2) !important;
    padding: 15px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-radius: 0 0 14px 14px !important;
}

/* Progression */
.driver-popover-progress-text {
    color: #888 !important;
    font-size: 0.85rem !important;
}

/* Boutons navigation */
.driver-popover-prev-btn,
.driver-popover-next-btn {
    background: linear-gradient(135deg, #ffd700 0%, #f0c000 100%) !important;
    color: #1a1a2e !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-shadow: none !important;
}

.driver-popover-prev-btn:hover,
.driver-popover-next-btn:hover {
    background: linear-gradient(135deg, #ffed4a 0%, #ffd700 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4) !important;
}

.driver-popover-prev-btn {
    background: transparent !important;
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
    color: #ffd700 !important;
}

.driver-popover-prev-btn:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: #ffd700 !important;
}

/* Bouton fermer */
.driver-popover-close-btn {
    color: #888 !important;
    font-size: 1.5rem !important;
    position: absolute !important;
    top: 10px !important;
    right: 15px !important;
    opacity: 0.7 !important;
    transition: all 0.2s !important;
}

.driver-popover-close-btn:hover {
    color: #ffd700 !important;
    opacity: 1 !important;
}

/* Bouton "Continuer sur le site" - Quitter la visite */
.lmj-skip-tour-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 15px 20px;
    padding: 10px 16px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #999;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.lmj-skip-tour-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffd700;
}

/* Flèche du popover */
.driver-popover-arrow {
    border-color: #ffd700 !important;
}

.driver-popover-arrow-side-bottom {
    border-bottom-color: #1a1a2e !important;
}

.driver-popover-arrow-side-top {
    border-top-color: #1a1a2e !important;
}

/* Highlight de l'élément - fond lumineux (desktop) */
.driver-highlighted-element {
    filter: brightness(1.8) saturate(1.2) !important;
    position: relative !important;
    z-index: 100001 !important;
}

/* Le stage (trou dans l'overlay) - fond clair */
.driver-highlighted-element-stage {
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 
        0 0 40px 20px rgba(255, 255, 255, 0.6),
        inset 0 0 25px rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px !important;
}

/* Animation subtile */
@keyframes driver-glow {
    0%, 100% {
        box-shadow: 
            0 0 40px 20px rgba(255, 255, 255, 0.6),
            inset 0 0 25px rgba(255, 255, 255, 0.8);
    }
    50% {
        box-shadow: 
            0 0 50px 25px rgba(255, 255, 255, 0.7),
            inset 0 0 30px rgba(255, 255, 255, 0.9);
    }
}

.driver-highlighted-element-stage {
    animation: driver-glow 2s ease-in-out infinite !important;
}

/* Mobile: réduire la luminosité pour éviter l'éblouissement */
@media (max-width: 768px) {
    .driver-highlighted-element {
        filter: brightness(1.3) saturate(1.1) !important;
        /* Transition douce au démarrage */
        transition: filter 0.8s ease-out !important;
    }
    
    .driver-highlighted-element-stage {
        background: rgba(255, 255, 255, 0.5) !important;
        box-shadow: 
            0 0 20px 10px rgba(255, 255, 255, 0.4),
            inset 0 0 15px rgba(255, 255, 255, 0.5) !important;
        /* Animation d'entrée douce au lieu de flash immédiat */
        animation: driver-glow-mobile 2.5s ease-in-out infinite, driver-fade-in 0.6s ease-out !important;
    }
    
    /* Fade-in progressif au démarrage sur mobile */
    @keyframes driver-fade-in {
        0% {
            opacity: 0;
            box-shadow: none;
        }
        100% {
            opacity: 1;
        }
    }
    
    @keyframes driver-glow-mobile {
        0%, 100% {
            box-shadow: 
                0 0 20px 10px rgba(255, 255, 255, 0.4),
                inset 0 0 15px rgba(255, 255, 255, 0.5);
        }
        50% {
            box-shadow: 
                0 0 25px 12px rgba(255, 255, 255, 0.5),
                inset 0 0 18px rgba(255, 255, 255, 0.6);
        }
    }
}

/* ==========================================
   TIPPY.JS - THÈME LMJ
   ========================================== */

/* Z-index élevé pour passer au-dessus de tout */
.tippy-box {
    z-index: 999999 !important;
}

.tippy-box[data-theme~='lmj'] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 215, 0, 0.1);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e0e0e0;
    padding: 2px;
    z-index: 999999 !important;
}

.tippy-box[data-theme~='lmj'] .tippy-content {
    padding: 10px 14px;
}

.tippy-box[data-theme~='lmj'] .tippy-arrow {
    color: #1a1a2e;
}

.tippy-box[data-theme~='lmj'][data-placement^='top'] > .tippy-arrow::before {
    border-top-color: #1a1a2e;
}

.tippy-box[data-theme~='lmj'][data-placement^='bottom'] > .tippy-arrow::before {
    border-bottom-color: #1a1a2e;
}

.tippy-box[data-theme~='lmj'][data-placement^='left'] > .tippy-arrow::before {
    border-left-color: #1a1a2e;
}

.tippy-box[data-theme~='lmj'][data-placement^='right'] > .tippy-arrow::before {
    border-right-color: #1a1a2e;
}

/* Animation scale */
.tippy-box[data-animation='scale'][data-state='hidden'] {
    opacity: 0;
    transform: scale(0.8);
}

/* ==========================================
   BOUTON D'AIDE FLOTTANT
   ========================================== */

.lmj-help-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    
    display: flex;
    align-items: center;
    gap: 8px;
    
    background: linear-gradient(135deg, #ffd700 0%, #f0c000 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    
    font-weight: 700;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.2);
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.lmj-help-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.5), 0 6px 15px rgba(0, 0, 0, 0.25);
}

.lmj-help-button:active {
    transform: translateY(-1px) scale(1.02);
}

.lmj-help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(26, 26, 46, 0.15);
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 800;
}

.lmj-help-text {
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

/* Mobile: icône seule */
@media (max-width: 600px) {
    .lmj-help-button {
        padding: 14px;
        border-radius: 50%;
        bottom: 20px;
        right: 20px;
    }
    
    .lmj-help-text {
        display: none;
    }
    
    .lmj-help-icon {
        width: 24px;
        height: 24px;
        background: transparent;
    }
}

/* Animation pulse au chargement */
@keyframes lmj-pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 8px 35px rgba(255, 215, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(255, 215, 0, 0.1);
    }
}

.lmj-help-button {
    animation: lmj-pulse 2s ease-in-out 3;
}

.lmj-help-button:hover {
    animation: none;
}

/* ==========================================
   CONSEILS CONTEXTUELS (Tips)
   ========================================== */

.lmj-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-left: 4px solid #ffd700;
    border-radius: 8px;
    padding: 15px 18px;
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.lmj-tip-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.lmj-tip-content {
    color: #333;
}

.lmj-tip-content strong {
    color: #1a1a2e;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .lmj-tip {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.08) 100%);
    }
    
    .lmj-tip-content {
        color: #e0e0e0;
    }
    
    .lmj-tip-content strong {
        color: #ffd700;
    }
}

/* ==========================================
   BADGES "NOUVEAU" / "CONSEIL"
   ========================================== */

.lmj-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lmj-badge--new {
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    color: white;
}

.lmj-badge--tip {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #1a1a2e;
}

.lmj-badge--info {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: white;
}
