/**
 * Styles pour l'éditeur Bullet Points avec barre d'outils
 * 
 * @package EDA_Workgroup
 * @version 1.2.1
 */

/* Barre d'outils */
.eda-bullets-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(to bottom, #fafafa 0%, #f0f0f0 100%);
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.eda-toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.eda-toolbar-separator {
    width: 1px;
    height: 28px;
    background: linear-gradient(to bottom, transparent 0%, #ccc 20%, #ccc 80%, transparent 100%);
    margin: 0 4px;
}

.eda-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 32px;
    height: 32px;
    position: relative;
}

.eda-toolbar-btn strong,
.eda-toolbar-btn em,
.eda-toolbar-btn u,
.eda-toolbar-btn .eda-icon {
    color: #444;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: color 0.15s ease;
    pointer-events: none;
    font-style: normal;
}

.eda-toolbar-btn .eda-icon {
    font-size: 16px;
    letter-spacing: -3px;
}

.eda-toolbar-btn:hover {
    background: #0073aa;
    border-color: #0073aa;
    box-shadow: 0 1px 3px rgba(0,115,170,0.3);
    transform: translateY(-1px);
}

.eda-toolbar-btn:hover strong,
.eda-toolbar-btn:hover em,
.eda-toolbar-btn:hover u,
.eda-toolbar-btn:hover .eda-icon {
    color: #fff;
}

.eda-toolbar-btn:active,
.eda-toolbar-btn.active {
    background: #005177;
    border-color: #005177;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
    transform: translateY(0);
}

.eda-toolbar-btn:active strong,
.eda-toolbar-btn:active em,
.eda-toolbar-btn:active u,
.eda-toolbar-btn:active .eda-icon,
.eda-toolbar-btn.active strong,
.eda-toolbar-btn.active em,
.eda-toolbar-btn.active u,
.eda-toolbar-btn.active .eda-icon {
    color: #fff;
}

.eda-toolbar-label {
    font-size: 11px;
    color: #666;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eda-toolbar-color-btn,
.eda-toolbar-highlight-btn {
    position: relative;
    overflow: visible;
}

.eda-toolbar-color-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: all;
    cursor: pointer;
    left: 0;
    top: 0;
}

.eda-toolbar-color-btn:hover,
.eda-toolbar-highlight-btn:hover {
    cursor: pointer;
}

/* Indicateur de couleur sous le bouton */
.eda-toolbar-color-btn::after,
.eda-toolbar-highlight-btn::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 1px;
    pointer-events: none;
}

.eda-toolbar-color-btn::after {
    background: #000000;
}

.eda-toolbar-highlight-btn::after {
    background: #ffff00;
}

/* Éditeur */
.eda-bullets-editor {
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    outline: none;
}

.eda-bullets-editor:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Placeholder */
.eda-bullets-editor:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

/* Styles de formatage dans l'éditeur */
.eda-bullets-editor b,
.eda-bullets-editor strong {
    font-weight: bold;
}

.eda-bullets-editor i,
.eda-bullets-editor em {
    font-style: italic;
}

.eda-bullets-editor u {
    text-decoration: underline;
}

/* Indentation */
.eda-bullets-editor .indent-1 {
    margin-left: 30px;
}

.eda-bullets-editor .indent-2 {
    margin-left: 60px;
}

.eda-bullets-editor .indent-3 {
    margin-left: 90px;
}

/* Listes */
.eda-bullets-editor ul,
.eda-bullets-editor ol {
    margin: 10px 0;
    padding-left: 30px;
}

.eda-bullets-editor li {
    margin: 5px 0;
}

/* Paragraphes */
.eda-bullets-editor p {
    margin: 10px 0;
}

.eda-bullets-editor p:first-child {
    margin-top: 0;
}

.eda-bullets-editor p:last-child {
    margin-bottom: 0;
}

/* Divs avec indentation */
.eda-bullets-editor div[style*="margin-left"] {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Scrollbar personnalisée */
.eda-bullets-editor::-webkit-scrollbar {
    width: 8px;
}

.eda-bullets-editor::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.eda-bullets-editor::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.eda-bullets-editor::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animations et effets */
@keyframes toolbar-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.eda-toolbar-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.2);
}

.eda-toolbar-btn:focus:not(:hover) {
    border-color: #0073aa;
}

/* Tooltips améliorés */
.eda-toolbar-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
}

.eda-toolbar-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: rgba(0,0,0,0.85);
    z-index: 1001;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .eda-bullets-toolbar {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .eda-toolbar-group {
        gap: 3px;
    }
    
    .eda-toolbar-btn {
        width: 28px;
        height: 28px;
    }
    
    .eda-toolbar-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .eda-toolbar-separator {
        height: 24px;
        margin: 0 2px;
    }
    
    .eda-bullets-editor {
        min-height: 200px;
        padding: 12px;
        font-size: 13px;
    }
    
    /* Désactive les tooltips sur mobile */
    .eda-toolbar-btn[title]:hover::after,
    .eda-toolbar-btn[title]:hover::before {
        display: none;
    }
}

/* Mode lecture seule */
.eda-workgroup-bullets-display {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
}

/* Styles de formatage en mode lecture seule */
.eda-workgroup-bullets-display b,
.eda-workgroup-bullets-display strong {
    font-weight: bold;
}

.eda-workgroup-bullets-display i,
.eda-workgroup-bullets-display em {
    font-style: italic;
}

.eda-workgroup-bullets-display u {
    text-decoration: underline;
}

.eda-workgroup-bullets-display .indent-1 {
    margin-left: 30px;
}

.eda-workgroup-bullets-display .indent-2 {
    margin-left: 60px;
}

.eda-workgroup-bullets-display .indent-3 {
    margin-left: 90px;
}

.eda-workgroup-bullets-display ul,
.eda-workgroup-bullets-display ol {
    margin: 10px 0;
    padding-left: 30px;
}

.eda-workgroup-bullets-display li {
    margin: 5px 0;
}

.eda-workgroup-bullets-display p {
    margin: 10px 0;
}

.eda-workgroup-bullets-display div[style*="margin-left"] {
    margin-top: 5px;
    margin-bottom: 5px;
}
