/**
 * Caly-Quiz IRVE - Éditeur de Cours
 * Interface style Habilec pour création/modification de slides
 * Version 1.0
 */

/* ============================================
   VARIABLES ÉDITEUR
   ============================================ */
:root {
    --editor-bg: #f5f5f5;
    --editor-sidebar: #ffffff;
    --editor-panel: #f8f9fa;
    --editor-accent: #f59e0b;
    --editor-success: #22c55e;
    --editor-warning: #f59e0b;
    --editor-text: #1f2937;
    --editor-text-muted: #4b5563;
    --editor-border: #e5e7eb;
}

/* ============================================
   CONTAINER PRINCIPAL ÉDITEUR
   ============================================ */
#course-editor-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--editor-bg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

/* Hide gamification XP bar when course editor is open */
body:has(#course-editor-container:not(.hidden)) .xp-bar-container,
body:has(#course-editor-container:not(.hidden)) #gamification-xp-bar {
    display: none !important;
}

#course-editor-container.hidden {
    display: none !important;
}

/* ============================================
   HEADER ÉDITEUR
   ============================================ */
.editor-header {
    background: var(--editor-sidebar);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--editor-border);
    flex-shrink: 0;
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-back-btn {
    background: transparent;
    border: none;
    color: var(--editor-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.editor-back-btn:hover {
    background: rgba(245, 158, 11, 0.06);
    color: var(--editor-text);
}

.editor-course-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-course-title input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--editor-text);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    min-width: 300px;
}

.editor-course-title input:hover {
    border-color: var(--editor-border);
}

.editor-course-title input:focus {
    outline: none;
    border-color: var(--editor-accent);
    background: rgba(245, 158, 11, 0.04);
}

.editor-header-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-tab {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--editor-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-tab:hover {
    background: rgba(245, 158, 11, 0.06);
}

.editor-tab.active {
    background: var(--editor-accent);
    color: white;
}

.editor-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.editor-btn-secondary {
    background: transparent;
    border: 1px solid var(--editor-border);
    color: var(--editor-text);
}

.editor-btn-secondary:hover {
    background: rgba(245, 158, 11, 0.06);
}

.editor-btn-primary {
    background: var(--editor-success);
    color: white;
}

.editor-btn-primary:hover {
    background: #16a34a;
}

.editor-btn-danger {
    background: var(--editor-accent);
    color: white;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   SIDEBAR GAUCHE - LISTE DES SLIDES
   ============================================ */
.editor-slides-sidebar {
    width: 220px;
    min-width: 0;
    background: var(--editor-sidebar);
    border-right: 1px solid var(--editor-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease, padding 0.3s ease, border 0.3s ease;
    overflow: hidden;
    position: relative;
}

.editor-slides-sidebar.collapsed {
    width: 0;
    border-right: none;
    padding: 0;
}

.editor-slides-sidebar.collapsed > * {
    opacity: 0;
    pointer-events: none;
}

/* Boutons toggle panneaux */
.panel-toggle-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 48px;
    border: 1px solid var(--editor-border);
    background: var(--editor-sidebar);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s;
    color: #94a3b8;
    font-size: 0.7rem;
    padding: 0;
}

.panel-toggle-btn:hover {
    background: #fef3c7;
    color: #f59e0b;
}

.toggle-sidebar-btn {
    right: -20px;
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.toggle-properties-btn {
    left: -20px;
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.slides-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--editor-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.slides-sidebar-header h3 {
    color: var(--editor-text);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.slides-count {
    background: var(--editor-accent);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

.slides-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.slides-list::-webkit-scrollbar {
    width: 6px;
}

.slides-list::-webkit-scrollbar-thumb {
    background: var(--editor-border);
    border-radius: 3px;
}

/* Carte de slide miniature */
.slide-thumbnail {
    background: var(--editor-panel);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.slide-thumbnail:hover {
    border-color: var(--editor-border);
}

.slide-thumbnail.active {
    border-color: var(--editor-accent);
}

.slide-thumbnail-header {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.03);
}

.slide-number {
    font-size: 0.75rem;
    color: var(--editor-text-muted);
    font-weight: 600;
}

.slide-type-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.slide-type-badge.title { background: #8b5cf6; color: white; }
.slide-type-badge.content { background: #3b82f6; color: white; }
.slide-type-badge.image { background: #10b981; color: white; }
.slide-type-badge.quiz { background: #f59e0b; color: white; }
.slide-type-badge.video { background: #ef4444; color: white; }

.slide-thumbnail-preview {
    height: 80px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--editor-text-muted);
    text-align: center;
    overflow: hidden;
}

.slide-thumbnail-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.slide-thumbnail-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.slide-thumbnail:hover .slide-thumbnail-actions {
    opacity: 1;
}

.slide-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: rgba(0,0,0,0.6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.slide-action-btn:hover {
    background: var(--editor-accent);
}

/* Bouton ajouter slide */
.add-slide-section {
    padding: 0.75rem;
    border-top: 1px solid var(--editor-border);
}

.add-slide-btn {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--editor-border);
    border-radius: 8px;
    background: transparent;
    color: var(--editor-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.add-slide-btn:hover {
    border-color: var(--editor-accent);
    color: #92400e;
    background: rgba(245, 158, 11, 0.08);
}

/* ============================================
   ZONE D'ÉDITION CENTRALE
   ============================================ */
.editor-canvas {
    flex: 1;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canvas-toolbar {
    padding: 0.75rem 1rem;
    background: var(--editor-sidebar);
    border-bottom: 1px solid var(--editor-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-right: 0.75rem;
    border-right: 1px solid var(--editor-border);
    margin-right: 0.75rem;
}

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

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--editor-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: rgba(245, 158, 11, 0.06);
    color: var(--editor-text);
}

.toolbar-btn.active {
    background: var(--editor-accent);
    color: white;
}

.toolbar-select {
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    color: var(--editor-text);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Zone de prévisualisation/édition */
.canvas-preview {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0.5rem;
    overflow: auto;
}

.slide-editor-frame {
    width: 100%;
    max-width: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    overflow: hidden;
    position: relative;
}

.slide-content-editable {
    width: 100%;
    height: 100%;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
}

/* Types de contenu éditables */
.editable-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--editor-text);
    margin-bottom: 1rem;
    outline: none;
    border: 2px dashed transparent;
    padding: 0.5rem;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.editable-title:hover,
.editable-title:focus {
    border-color: var(--editor-accent);
}

.editable-subtitle {
    font-size: 1.25rem;
    color: var(--editor-text-muted);
    outline: none;
    border: 2px dashed transparent;
    padding: 0.5rem;
    border-radius: 8px;
}

.editable-subtitle:hover,
.editable-subtitle:focus {
    border-color: var(--editor-accent);
}

.editable-content {
    flex: 1;
    font-size: 1.1rem;
    color: var(--editor-text);
    line-height: 1.8;
    outline: none;
    border: 2px dashed transparent;
    padding: 0.5rem;
    border-radius: 8px;
    overflow-y: auto;
}

.editable-content:hover,
.editable-content:focus {
    border-color: var(--editor-accent);
}

/* Zone d'image éditable */
.editable-image-zone {
    flex: 1;
    border: 2px dashed var(--editor-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(245, 158, 11, 0.03);
}

.editable-image-zone:hover {
    border-color: var(--editor-accent);
    background: rgba(245, 158, 11, 0.08);
}

.editable-image-zone.has-image {
    border-style: solid;
    border-color: transparent;
}

.editable-image-zone img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-placeholder {
    text-align: center;
    color: var(--editor-text-muted);
}

.image-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.image-placeholder p {
    font-size: 0.9rem;
}

/* ============================================
   PANNEAU DROITE - PROPRIÉTÉS & RESSOURCES
   ============================================ */
.editor-properties-panel {
    width: 270px;
    min-width: 0;
    background: var(--editor-sidebar);
    border-left: 1px solid var(--editor-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease, padding 0.3s ease, border 0.3s ease;
    overflow: hidden;
    position: relative;
}

.editor-properties-panel.collapsed {
    width: 0;
    border-left: none;
    padding: 0;
}

.editor-properties-panel.collapsed > * {
    opacity: 0;
    pointer-events: none;
}

.properties-tabs {
    display: flex;
    border-bottom: 1px solid var(--editor-border);
}

.properties-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--editor-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.properties-tab:hover {
    color: var(--editor-text);
}

.properties-tab.active {
    color: #92400e;
    border-bottom-color: var(--editor-accent);
}

.properties-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Section de propriétés */
.property-section {
    margin-bottom: 1.5rem;
}

.property-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--editor-text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.property-group {
    margin-bottom: 1rem;
}

.property-label {
    font-size: 0.8rem;
    color: var(--editor-text);
    margin-bottom: 0.4rem;
    display: block;
}

.property-input {
    width: 100%;
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    color: var(--editor-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.property-input:focus {
    outline: none;
    border-color: var(--editor-accent);
}

.property-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    color: var(--editor-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    resize: vertical;
}

.property-select {
    width: 100%;
    background: var(--editor-panel);
    border: 1px solid var(--editor-border);
    color: var(--editor-text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Grille de ressources */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.resource-card {
    background: var(--editor-panel);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.resource-card:hover {
    border-color: var(--editor-accent);
}

.resource-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.resource-card-title {
    font-size: 0.8rem;
    color: var(--editor-text);
    font-weight: 500;
}

.resource-card-desc {
    font-size: 0.7rem;
    color: var(--editor-text-muted);
    margin-top: 0.25rem;
}

/* Upload de fichiers */
.upload-zone {
    border: 2px dashed var(--editor-border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--editor-accent);
    background: rgba(245, 158, 11, 0.08);
}

.upload-zone svg {
    width: 32px;
    height: 32px;
    color: var(--editor-text-muted);
    margin-bottom: 0.5rem;
}

.upload-zone p {
    font-size: 0.8rem;
    color: var(--editor-text-muted);
}

.upload-zone span {
    color: #92400e;
}

/* ============================================
   MODAL SÉLECTION TYPE DE SLIDE
   ============================================ */
.slide-type-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.slide-type-modal.hidden {
    display: none;
}

.slide-type-modal-content {
    background: var(--editor-sidebar);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
}

.slide-type-modal-title {
    font-size: 1.25rem;
    color: var(--editor-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.slide-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.slide-type-option {
    background: var(--editor-panel);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.slide-type-option:hover {
    border-color: var(--editor-accent);
    transform: translateY(-2px);
}

.slide-type-option-icon {
    width: 48px;
    height: 48px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem;
}

.slide-type-option-title {
    font-size: 0.9rem;
    color: var(--editor-text);
    font-weight: 600;
}

.slide-type-option-desc {
    font-size: 0.75rem;
    color: var(--editor-text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   COLLAPSIBLE PROPERTY SECTIONS
   ============================================ */
.property-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.6rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
    user-select: none;
}

.property-section-header:hover {
    background: rgba(245, 158, 11, 0.06);
}

.property-section-header .property-section-title {
    margin-bottom: 0;
}

.property-section-chevron {
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.property-section.collapsed .property-section-chevron {
    transform: rotate(-90deg);
}

.property-section-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
    max-height: 600px;
    opacity: 1;
    padding-top: 0.5rem;
}

.property-section.collapsed .property-section-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

/* ============================================
   LEFT SIDEBAR COLLAPSIBLE SECTIONS
   ============================================ */
.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.sidebar-section-header:hover {
    background: rgba(245, 158, 11, 0.06);
}

/* ============================================
   RESOURCE IMAGE PREVIEW (Right Panel Only)
   ============================================ */
.resource-image-preview {
    border-radius: 8px;
    border: 1px solid var(--editor-border);
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    position: relative;
}

.resource-image-preview img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    display: block;
}

.resource-image-preview .resource-img-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}

.resource-image-preview .resource-img-actions button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.resource-image-preview .resource-img-actions .btn-change {
    background: rgba(255,255,255,0.9);
    color: #475569;
}

.resource-image-preview .resource-img-actions .btn-change:hover {
    background: #fef3c7;
    color: #92400e;
}

.resource-image-preview .resource-img-actions .btn-delete {
    background: rgba(255,255,255,0.9);
    color: #ef4444;
}

.resource-image-preview .resource-img-actions .btn-delete:hover {
    background: #fef2f2;
}

.resource-image-preview .resource-img-name {
    padding: 4px 8px;
    font-size: 0.7rem;
    color: #64748b;
    background: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .editor-properties-panel {
        width: 240px;
    }

    .editor-slides-sidebar {
        width: 190px;
    }
}

@media (max-width: 900px) {
    .editor-main {
        flex-direction: column;
    }

    .editor-slides-sidebar {
        width: 100%;
        height: 150px;
        border-right: none;
        border-bottom: 1px solid var(--editor-border);
    }

    .slides-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
    }

    .slide-thumbnail {
        flex-shrink: 0;
        width: 120px;
        margin-bottom: 0;
        margin-right: 0.5rem;
    }

    .editor-properties-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 40%;
        border-left: none;
        border-top: 1px solid var(--editor-border);
    }
}

/* ============================================
   MODAL COMPOSANTS VISUELS
   ============================================ */
#course-editor-container > .ce-modal-overlay,
.ce-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 200000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(4px);
    animation: ce-fade-in 0.2s ease;
    flex-direction: row !important;
    flex-shrink: 0;
}

@keyframes ce-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ce-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: ce-slide-up 0.25s ease;
}

.ce-modal-lg {
    max-width: 640px;
}

@keyframes ce-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ce-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
}

.ce-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 700;
}

.ce-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ce-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Grille de composants */
.ce-comp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 16px;
}

.ce-comp-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.ce-comp-card:hover {
    border-color: #f59e0b;
    background: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.15);
}

.ce-comp-preview {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
}

.ce-comp-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ce-comp-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.ce-comp-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.2;
}

.ce-comp-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Configuration labels */
.ce-cfg-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 8px;
}

/* Bouton accent dans la toolbar */
.toolbar-btn-accent {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border: 1px solid #f59e0b40 !important;
}

.toolbar-btn-accent:hover {
    background: linear-gradient(135deg, #fde68a, #fcd34d) !important;
    border-color: #f59e0b !important;
}

@media (max-width: 600px) {
    .ce-comp-grid {
        grid-template-columns: 1fr;
    }
    .ce-modal-lg {
        max-width: 95%;
    }
}
