/* Styles du mode édition NanoCMS */
/* Highlight au survol en mode édition */
.nano-editable-hover {
    outline: 2px dashed #3b82f6 !important;
    cursor: pointer !important;
    position: relative;
}

/* Label au survol pour savoir ce qu'on touche */
.nano-editable-hover::after {
    content: attr(data-tag-name);
    position: absolute;
    top: -20px;
    left: 0;
    background: #3b82f6;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 9990;
    pointer-events: none;
    white-space: nowrap;
}

/* Élément actuellement sélectionné */
.nano-active-element {
    outline: 3px solid #2563eb !important;
    z-index: 40;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { outline-color: #2563eb; }
    50% { outline-color: #60a5fa; }
    100% { outline-color: #2563eb; }
}

/* Interface UI du CMS */
#nano-cms-ui {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    top: 0; left: 0; width: 100%; height: 100%;
}

#nano-cms-ui * {
    pointer-events: auto;
    box-sizing: border-box;
}

/* Bouton Flottant (Toggle Edit) */
.nano-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    z-index: 10000;
    border: 2px solid white;
}
.nano-toggle-btn:hover { transform: scale(1.1); }
.nano-toggle-btn.active { background: #2563eb; }

/* Barre d'outils latérale */
.nano-sidebar {
    position: fixed;
    top: 0;
    right: -340px;
    width: 340px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 9998;
}
.nano-sidebar.open { right: 0; }

/* Header Sidebar */
.nano-sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nano-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Content Sidebar */
.nano-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections de contrôles */
.nano-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 5px;
}

.nano-control-group {
    margin-bottom: 15px;
}
.nano-control-group label {
    display: block;
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 6px;
    font-weight: 500;
}

.nano-input, .nano-select, .nano-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.nano-input:focus { border-color: #2563eb; outline: none; }

.nano-row { display: flex; gap: 10px; }
.nano-col { flex: 1; }

/* Boutons d'action */
.nano-btn-icon {
    padding: 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    color: #374151;
    transition: all 0.2s;
}
.nano-btn-icon:hover { background: #e5e7eb; color: #111; }

.nano-grid-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.nano-btn-insert {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    height: 70px;
}
.nano-btn-insert:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}
.nano-btn-insert i { font-size: 1.2rem; margin-bottom: 5px; }

.nano-btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
.nano-btn-danger:hover { background: #fecaca; }

.nano-btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.nano-btn-primary:hover { background: #1d4ed8; }

/* Footer Sidebar */
.nano-sidebar-footer {
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.nano-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}
