/**
 * Styles Public - Protection des images
 * Version : 1.0.0 (La Comédillienne)
 * 
 * @package Images_Protect
 * @since 1.0.0
 * 
 * NOTE : Ce fichier est autonome. Il définit ses propres variables de base
 * pour garantir que le Toast et le Flou s'affichent correctement quel que soit le thème.
 */

/* ============================================================================
   1. VARIABLES DE BASE (FALLBACK AUTONOME)
   ============================================================================ */

:root {
    --lc-color-primary: #2271b1;
    --lc-color-danger: #d63638;
    --lc-radius-std: 4px;
    --lc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ============================================================================
   2. IMAGE PROTÉGÉE
   ============================================================================
   Applique les restrictions de sélection et de drag&drop.
   Compatible avec les modules Image de Divi.
*/

img.lc-protected {
    -webkit-user-select: none; /* Safari/Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
    
    -webkit-user-drag: none;   /* Empêche le glisser-déposer */
    user-drag: none;
    
    pointer-events: auto;      /* Laisse passer les clics normaux (lien parent) mais bloque le contexte */
    touch-action: manipulation;
}

/* ============================================================================
   3. MODE PANIQUE (Flou + Overlay)
   ============================================================================
   Actif lorsque les outils de développement sont détectés.
*/

body.lc-ip-blur-active {
    filter: blur(10px);
    pointer-events: none; /* Bloque toute interaction */
    overflow: hidden;     /* Empêche le scroll */
    height: 100vh;
    width: 100vw;
    position: fixed;      /* Fige la page */
    top: 0;
    left: 0;
}

#lc-ip-blur-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999998;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-family: var(--lc-font-family);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

#lc-ip-blur-overlay.visible {
    display: flex;
}

/* ============================================================================
   4. NOTIFICATION TOAST (Alerte Clic Droit)
   ============================================================================
   Message temporaire en bas de l'écran.
*/

#lc-ip-toast {
    visibility: hidden;
    min-width: 300px;
    max-width: 90%;
    background-color: var(--lc-color-primary); 
    color: #fff;
    text-align: center;
    border-radius: var(--lc-radius-std);
    padding: 16px 20px;
    position: fixed;
    z-index: 999999; /* Au-dessus de tout (y compris les menus Divi) */
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-family: var(--lc-font-family);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    /* Bordure indicative de statut (danger) */
    border-left: 5px solid var(--lc-color-danger); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    line-height: 1.5;
}

#lc-ip-toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 40px;
}

/* ============================================================================
   5. ACCESSIBILITÉ & CONTRASTE
   ============================================================================ */

@media (prefers-contrast: more) {
    #lc-ip-toast {
        border: 2px solid #fff;
    }
}

/* ============================================================================
   6. RESPONSIVE MOBILE
   ============================================================================ */

@media (max-width: 600px) {
    #lc-ip-toast {
        min-width: auto;
        width: 80%;
        font-size: 13px;
        bottom: 20px;
    }
    
    #lc-ip-toast.show {
        bottom: 30px;
    }
    
    body.lc-ip-blur-active #lc-ip-blur-overlay {
        font-size: 1.2rem;
        padding: 15px;
    }
}