/* Styles pour l'éditeur avancé */
.advanced-editor {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editor-toolbar {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 2px;
}

.toolbar-group .btn {
    border-radius: 4px;
    transition: all 0.2s;
}

.toolbar-group .btn:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
}

.editor-content {
    min-height: 200px;
    padding: 15px;
    outline: none;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.editor-content:focus {
    box-shadow: inset 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.editor-content.drag-over {
    background-color: #e3f2fd;
    border: 2px dashed #2196f3;
}

.editor-content p {
    margin-bottom: 10px;
}

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

/* Styles pour les médias dans l'éditeur */
.editor-media-container {
    position: relative;
    margin: 15px 0;
    display: inline-block;
    max-width: 100%;
}

.editor-media-container:hover .media-controls {
    opacity: 1;
    visibility: visible;
}

.editor-image, .editor-video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.editor-image:hover, .editor-video:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.media-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    border-radius: 6px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.size-controls, .align-controls {
    display: flex;
    gap: 4px;
}

.media-controls .btn {
    padding: 4px 8px;
    font-size: 12px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-controls .btn:hover {
    background: white;
    transform: scale(1.1);
}

.media-controls .btn-outline-danger {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.media-controls .btn-outline-danger:hover {
    background: #dc3545;
}

/* Alignements des médias */
.align-left {
    float: left;
    margin-right: 15px;
    margin-bottom: 10px;
}

.align-right {
    float: right;
    margin-left: 15px;
    margin-bottom: 10px;
}

.align-center {
    display: block;
    margin: 15px auto;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-toolbar {
        padding: 8px;
        gap: 8px;
    }
    
    .toolbar-group .btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .editor-content {
        padding: 12px;
        min-height: 150px;
    }
    
    .media-controls {
        position: static;
        opacity: 1;
        visibility: visible;
        background: rgba(0,0,0,0.05);
        margin-top: 10px;
        flex-direction: row;
        justify-content: center;
    }
    
    .align-left, .align-right {
        float: none;
        margin: 10px auto;
        display: block;
    }
}

/* Animation pour les boutons actifs */
.editor-toolbar .btn.active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

/* Placeholder personnalisé */
.editor-content:empty:before {
    content: "Écrivez votre publication ici... Vous pouvez glisser-déposer des images et vidéos directement !";
    color: #6c757d;
    font-style: italic;
}

/* Styles pour la prévisualisation */
.editor-preview {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
    margin-top: 15px;
}

.editor-preview h4 {
    margin-bottom: 10px;
    color: #495057;
}

/* Indicateur de chargement */
.upload-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,123,255,0.1);
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 20px;
    color: #007bff;
    font-size: 14px;
    min-height: 100px;
}

.upload-progress .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 8px;
}

.upload-error {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
    color: #dc3545;
    text-align: center;
}

/* Animation pour le spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.125em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
