/* ==========================================================================
   LAHALEX UNIVERSAL HIGHLIGHTER CSS
   Système de surlignage universel et persistant pour LAHALEX
   ========================================================================== */

/* Style des marques de surlignage */
mark.user-highlight {
    background-color: #fff176;
    color: inherit;
    padding: 1px 2px;
    border-radius: 3px;
    cursor: pointer;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

mark.user-highlight:hover {
    filter: brightness(0.92);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

mark.user-highlight.active-highlight {
    outline: 2px solid #0d6efd;
    outline-offset: 1px;
}

/* Barre d'outils flottante de surlignage */
#lahalex-highlight-toolbar {
    position: absolute;
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transform: translate(-50%, -100%);
    margin-top: -10px;
    pointer-events: auto;
    animation: lahalexHlFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    user-select: none;
    -webkit-user-select: none;
}

@keyframes lahalexHlFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -90%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }
}

/* Flèche pointant vers la sélection */
#lahalex-highlight-toolbar::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ffffff;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

#lahalex-highlight-toolbar.toolbar-below {
    transform: translate(-50%, 0);
    margin-top: 10px;
}

#lahalex-highlight-toolbar.toolbar-below::after {
    top: -6px;
    bottom: auto;
    border-top: none;
    border-bottom: 6px solid #ffffff;
    filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.1));
}

/* Pastilles de couleur */
.lahalex-hl-colors {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 6px;
    border-right: 1px solid #e0e0e0;
}

.lahalex-hl-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
}

.lahalex-hl-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px #0d6efd;
}

.lahalex-hl-dot.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #0d6efd;
}

/* Boutons d'action dans la toolbar */
.lahalex-hl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.lahalex-hl-btn:hover {
    background-color: #f1f3f5;
    color: #1a1a1a;
}

.lahalex-hl-btn i {
    font-size: 13px;
}

.lahalex-hl-btn.btn-delete {
    color: #dc3545;
}

.lahalex-hl-btn.btn-delete:hover {
    background-color: #ffe3e3;
    color: #c92a2a;
}

/* Toast de notification personnalisé pour le surlignage */
#lahalex-hl-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    background: #1e293b;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#lahalex-hl-toast.show {
    opacity: 1;
    transform: translateY(0);
}

#lahalex-hl-toast.toast-success i {
    color: #4ade80;
}

#lahalex-hl-toast.toast-error i {
    color: #f87171;
}

#lahalex-hl-toast.toast-info i {
    color: #60a5fa;
}
