/* ==================== CONTENU ÉDITABLE ==================== */

.editable-content {
    border: 2px dashed transparent;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
    min-height: 20px;
    cursor: pointer;
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.editable-content:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.editable-content:after {
    content: "✏️";
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.editable-content:hover:after { opacity: 1; }

.editable-content.modified {
    border-color: #ffc107 !important;
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Barre d'outils admin */
.admin-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    gap: 10px;
    border: 1px solid #e0e0e0;
}

.admin-toolbar .btn {
    padding: 8px 15px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-success { background: #28a745; color: white; }
.btn-info { background: #17a2b8; color: white; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-secondary { background: #6c757d; color: white; }

.btn-success:hover, .btn-info:hover, .btn-warning:hover, .btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Indicateur de modification */
.edit-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffc107;
    color: #212529;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 9999;
    font-size: 14px;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 5px;
    z-index: 10002;
    max-width: 80%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

.notification-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.notification-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.notification-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

@keyframes slideIn {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

/* ==================== ÉDITEUR RICHE ==================== */

.custom-editor {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    z-index: 100000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.editor-open .custom-editor { display: flex; }

.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: none;
}

.editor-open .editor-overlay { display: block; }

.editor-toolbar {
    background: #2c3e50;
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #34495e;
    min-height: 60px;
    align-items: center;
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 5px;
    padding-right: 15px;
    border-right: 1px solid #4a607a;
    margin-right: 15px;
}

.toolbar-group:last-child { border-right: none; margin-right: 0; }

.editor-btn {
    background: #34495e;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.editor-btn:hover { background: #4a607a; transform: translateY(-2px); }
.editor-btn.active { background: #3498db; box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3); }

.editor-select {
    background: #34495e;
    border: 1px solid #4a607a;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    min-width: 120px;
}

.editor-select option { background: #2c3e50; color: white; }

.editor-color {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px;
    background: transparent;
}

.editor-input {
    background: #34495e;
    border: 1px solid #4a607a;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    min-width: 200px;
}

.editor-content {
    flex: 1;
    padding: 20px;
    overflow: auto;
    background: #f8f9fa;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    min-height: 200px;
}

.editor-actions {
    padding: 15px;
    background: #ecf0f1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.action-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.action-btn.cancel { background: #e74c3c; color: white; }
.action-btn.save { background: #2ecc71; color: white; }
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

/* Color pickers */
.color-picker-wrapper {
    position: relative;
    display: inline-block;
}

.color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.3);
}

.color-palette {
    position: absolute;
    top: 45px;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    z-index: 100001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.color-swatch {
    width: 25px;
    height: 25px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #333;
}

.transparent-swatch {
    background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 50% / 10px 10px;
    position: relative;
}

/* Sidebar de l'éditeur */
.editor-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    width: 350px;
    height: 100%;
    background: white;
    border-left: 1px solid #ddd;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 100002;
    display: none;
    overflow-y: auto;
}

#sidebarContent {
    padding: 20px;
}

/* Upload area */
.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: #2ecc71;
    background: #e8f8f5;
}

.upload-area i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.file-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    background: #f8f9fa;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item .remove-file {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 5px 8px;
}

.image-preview {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.upload-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.upload-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-option:hover {
    background: #f0f0f0;
}

.upload-option input[type="radio"] {
    margin-right: 5px;
}

.upload-option i {
    margin-right: 8px;
}

.sidebar-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.sidebar-actions .action-btn {
    flex: 1;
    text-align: center;
}

/* Cadres éditables */
.editable-frame {
    border-radius: 5px;
    margin: 10px 0;
    padding: 15px;
    position: relative;
    transition: all 0.3s;
}

.editable-frame:hover .frame-delete-btn {
    opacity: 1;
}

.frame-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Liens de fichiers */
.file-link-container {
    margin: 10px 0;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.file-link:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.file-link i {
    font-size: 32px;
}

.file-link-text {
    display: flex;
    flex-direction: column;
}

.file-link-text strong {
    font-size: 14px;
}

.file-link-text small {
    font-size: 11px;
    color: #7f8c8d;
}

/* Conteneur PDF */
.pdf-container {
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Styles pour l'éditeur PDF intégré */
.pdf-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pdf-container canvas {
    display: block;
    margin: 0 auto;
    background: #fff;
}

.pdf-container .pdf-controls {
    background: #f5f5f5;
    padding: 10px;
    text-align: center;
    border-top: 1px solid #ddd;
}

.pdf-container button {
    margin: 0 5px;
    padding: 5px 12px;
}

/* Mode plein écran */
.pdf-container:fullscreen {
    background: #fff;
    padding: 20px;
}

.pdf-container:fullscreen canvas {
    max-height: calc(100vh - 150px);
    width: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .pdf-container button {
        padding: 3px 8px;
        font-size: 12px;
    }
}



















.full-width-content {
    display: block !important;
    width: 100% !important;
}

/* Animation de chargement */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive pour l'éditeur */
@media (max-width: 768px) {
    .custom-editor { width: 95%; max-height: 90vh; }
    .editor-toolbar { flex-direction: column; max-height: 120px; overflow-y: auto; }
    .toolbar-group { flex-wrap: wrap; border-right: none; margin-right: 0; padding-right: 0; margin-bottom: 10px; justify-content: center; }
    .admin-toolbar { top: 10px; right: 10px; left: 10px; flex-direction: column; }
    .editor-sidebar { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
    .custom-editor { width: 98%; max-height: 95vh; }
    .editor-content { padding: 10px; }
    .editor-btn { width: 35px; height: 35px; font-size: 14px; }
    .editor-select { min-width: 100px; padding: 6px 8px; }
}

<style>
    /* ... styles existants ... */
    
    /* Styles pour les conteneurs PDF */
    .pdf-container {
        margin: 20px 0;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .pdf-container object,
    .pdf-container iframe {
        transition: height 0.3s ease;
    }
    
    .btn-expand {
        transition: all 0.2s ease;
    }
    
    .btn-expand:hover {
        transform: scale(1.02);
        opacity: 0.9;
    }
    
    @media (max-width: 768px) {
        .pdf-container object,
        .pdf-container iframe {
            height: 400px !important;
        }
    }
</style>