/* =====================================================
   STUDIO EDITOR - Styles principaux
   ===================================================== */

/* Variables — accent aligné sur la marque (cf. lien Studio de la navbar) */
:root {
    --studio-primary: #844fc0;   /* violet de marque (était corail #ff6b6b) */
    --studio-secondary: #ff4365; /* rose de marque (était #ffb3b3) */
    --studio-bg: #f8f9fa;        /* fond de travail neutre (éditeur) */
    --studio-sidebar-width: 280px;
    --studio-properties-width: 260px;
    --studio-toolbar-height: 56px;
}

/* Reset pour l'éditeur */
.studio-editor {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--studio-bg);
    overflow: hidden;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Cacher la navbar sur l'éditeur */
body:has(.studio-editor) .navbar {
    display: none;
}

body:has(.studio-editor) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}


/* =====================================================
   BARRE D'OUTILS SUPÉRIEURE
   ===================================================== */
.editor-toolbar {
    height: var(--studio-toolbar-height);
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    flex-shrink: 0;
    z-index: 100;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-back {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #f0f0f0;
    color: #333;
}

.creation-name input {
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    padding: 5px 10px;
    border-radius: 6px;
    width: 200px;
}

.creation-name input:hover,
.creation-name input:focus {
    background: #f5f5f5;
    outline: none;
}

.format-badge {
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-secondary));
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tool-btn:active {
    background: #e0e0e0;
}

/* Groupe d'outils de sélection */
.tool-group {
    display: flex;
    gap: 2px;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 2px;
}

.tool-group .tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.tool-group .tool-btn.active {
    background: var(--studio-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.tool-group .tool-btn.active:hover {
    background: var(--studio-secondary);
    color: white;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #e0e0e0;
    margin: 0 5px;
}

.zoom-level {
    font-size: 0.85rem;
    color: #666;
    min-width: 50px;
    text-align: center;
}

.btn-secondary,
.btn-primary {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-secondary));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transform: translateY(-1px);
}

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

/* =====================================================
   SIDEBAR GAUCHE - ÉLÉMENTS
   ===================================================== */
.editor-sidebar {
    width: var(--studio-sidebar-width);
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--studio-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Accordéon des catégories */
.category-item {
    margin-bottom: 5px;
}

.category-header {
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    transition: all 0.2s;
}

.category-header:hover {
    background: #f0f0f0;
}

.element-count {
    background: #e0e0e0;
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.category-content {
    padding: 10px;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.element-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    background: #f8f9fa;
}

.element-item:hover {
    border-color: var(--studio-primary);
    transform: scale(1.05);
}

.element-item:active {
    cursor: grabbing;
}

.element-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.element-item.premium {
    border-color: #ffc107;
}

.premium-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #ffc107;
    color: #333;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

/* Sections de la sidebar */
.sidebar-section {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.sidebar-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.btn-add-text {
    width: 100%;
    padding: 10px;
    border: 2px dashed #d0d0d0;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-add-text:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
    background: rgba(255, 107, 107, 0.05);
}

.background-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.background-options input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}

.btn-bg {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-bg:hover {
    border-color: var(--studio-primary);
}

.btn-bg span {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    display: block;
}

/* =====================================================
   ZONE CANVAS
   ===================================================== */
.canvas-container {
    flex: 1;
    display: block;
    overflow: auto;
    padding: 30px;
    background: #e8eaed;
    background-image:
        linear-gradient(45deg, #ddd 25%, transparent 25%),
        linear-gradient(-45deg, #ddd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd 75%),
        linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    /* Permettre le scroll sur les deux axes */
    min-height: 0;
    min-width: 0;
    /* Centrage horizontal via text-align pour inline-flex child */
    text-align: center;
}

/* Wrapper interne pour centrer verticalement et permettre le scroll horizontal */
.canvas-container-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

/* Style des scrollbars pour un look moderne */
.canvas-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.canvas-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

.canvas-container::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.4);
    border-radius: 5px;
}

.canvas-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.6);
}

.canvas-wrapper {
    background: white;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, outline 0.2s ease;
    outline: 3px solid transparent;
    outline-offset: 3px;
}

/* Contour bleu au survol pour indiquer la zone interactive */
.canvas-wrapper:hover {
    outline-color: var(--studio-primary);
    box-shadow: 0 5px 30px rgba(255, 107, 107, 0.25);
}

#fabricCanvas {
    display: block;
}

/* =====================================================
   PANNEAU PROPRIÉTÉS (DROITE)
   ===================================================== */
.editor-properties {
    width: var(--studio-properties-width);
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.properties-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.properties-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

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

.no-selection {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-selection i {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.property-group {
    margin-bottom: 20px;
}

.property-group h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 10px;
}

.property-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.property-row label {
    font-size: 0.85rem;
    color: #666;
    min-width: 60px;
}

.property-row input[type="number"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 80px;
}

.property-row input:focus {
    outline: none;
    border-color: var(--studio-primary);
}

.properties-content select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.properties-content input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.properties-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--studio-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.properties-content input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--studio-secondary);
    transform: scale(1.1);
}

.properties-content input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--studio-primary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.properties-content input[type="range"]::-moz-range-thumb:hover {
    background: var(--studio-secondary);
    transform: scale(1.1);
}

.properties-content input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
}

.opacity-value {
    font-size: 0.85rem;
    color: #666;
}

/* =====================================================
   SECTIONS RÉTRACTABLES
   ===================================================== */
.collapsible-section {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.section-header:hover {
    background: linear-gradient(135deg, #f0f0f0 0%, #f8f9fa 100%);
}

.section-header h4 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
    letter-spacing: 0.02em;
}

.section-header h4 i {
    color: var(--studio-primary);
    font-size: 0.8rem;
}

.section-chevron {
    color: #999;
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

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

.section-content {
    padding: 12px;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.collapsible-section.collapsed .section-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-top: none;
}

/* Grille pour position compacte */
.property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.property-row.compact {
    margin-bottom: 0;
}

.property-row.compact label {
    min-width: 20px;
    font-weight: 600;
}

.property-row.compact input[type="number"] {
    width: 100%;
}

/* Slider avec valeur */
.slider-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.slider-with-value label {
    font-size: 0.8rem;
    color: #666;
    min-width: 70px;
    white-space: nowrap;
}

.slider-with-value input[type="range"] {
    flex: 1;
    margin: 0;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-with-value input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--studio-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-with-value input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--studio-secondary);
    transform: scale(1.1);
}

.slider-with-value input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--studio-primary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.slider-with-value input[type="range"]::-moz-range-thumb:hover {
    background: var(--studio-secondary);
    transform: scale(1.1);
}

.slider-with-value input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
}

.slider-with-value span {
    font-size: 0.8rem;
    color: #666;
    min-width: 40px;
    text-align: right;
}

/* Sous-sections */
.subsection {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.subsection-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    display: block;
}

/* Color picker row */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-row input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}

.color-presets {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Style de contour */
.stroke-style-selector {
    margin-top: 10px;
}

.stroke-style-selector > label {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-bottom: 8px;
}

.stroke-style-buttons {
    display: flex;
    gap: 8px;
}

.stroke-style-btn {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.stroke-style-btn:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
}

.stroke-style-btn.active {
    border-color: var(--studio-primary);
    background: var(--studio-primary);
    color: #fff;
}

/* Filter items */
.filter-item {
    margin-bottom: 8px;
}

.filter-item:last-of-type {
    margin-bottom: 15px;
}

.text-format-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.format-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.format-btn:hover {
    background: #f0f0f0;
}

.format-btn.active {
    background: var(--studio-primary);
    color: white;
    border-color: var(--studio-primary);
}

/* Préréglages couleur SVG */
.svg-color-presets {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: var(--studio-primary);
}

.color-preset[data-color="#ffffff"] {
    border-color: #ccc;
}

/* =====================================================
   MULTI-COULEURS SVG
   ===================================================== */
.multi-color-section {
    margin-top: 10px;
}

.multi-colors-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.multi-color-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    padding: 5px 8px;
    border-radius: 8px;
}

.multi-color-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    min-width: 20px;
}

.multi-color-input {
    width: 32px;
    height: 32px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.multi-color-input:hover {
    border-color: var(--studio-primary);
    transform: scale(1.05);
}

.btn-apply-mono {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    border: 1px dashed #ccc;
    background: transparent;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-mono:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
    background: rgba(255, 107, 107, 0.05);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.action-btn {
    padding: 12px;
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffb3b3 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
}

.action-btn.delete {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
    color: #e03131;
}

.action-btn.delete:hover {
    background: linear-gradient(135deg, #fa5252 0%, #e03131 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(224, 49, 49, 0.3);
}

/* =====================================================
   EFFETS TEXTE (FX) STYLE CANVA
   ===================================================== */
.fx-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.fx-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    color: #666;
    gap: 4px;
}

.fx-btn i {
    font-size: 1.2rem;
}

.fx-btn:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
    background: rgba(255, 107, 107, 0.05);
}

.fx-btn.active {
    border-color: var(--studio-primary);
    background: linear-gradient(135deg, #ff6b6b 0%, #ffb3b3 100%);
    color: white;
}

.fx-settings {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.fx-settings .property-row {
    margin-bottom: 10px;
}

.fx-settings .property-row:last-child {
    margin-bottom: 0;
}

/* =====================================================
   DÉGRADÉS
   ===================================================== */
.gradient-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gradient-type-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    color: #666;
}

.gradient-type-btn:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
}

.gradient-type-btn.active {
    border-color: var(--studio-primary);
    background: var(--studio-primary);
    color: white;
}

.gradient-preview {
    margin-bottom: 12px;
}

.gradient-preview-box {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffb3b3 100%);
}

.gradient-colors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.gradient-colors .property-row {
    margin-bottom: 0;
}

.gradient-angle-value {
    font-size: 0.85rem;
    color: #666;
    min-width: 35px;
    text-align: right;
}

/* =====================================================
   FILTRES (FLOU GAUSSIEN)
   ===================================================== */
.filter-properties .property-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-properties .property-row label {
    flex: 0 0 100%;
    margin-bottom: 4px;
}

.filter-properties .property-row input[type="range"] {
    flex: 1;
}

.filter-blur-value {
    font-size: 0.85rem;
    color: #666;
    min-width: 40px;
    text-align: right;
}

.btn-reset-filters {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.2s;
}

.btn-reset-filters:hover,
.btn-reset-adjustments:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.btn-reset-adjustments {
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
    transition: all 0.2s;
}

/* Sélecteur de type de flou */
.blur-type-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.blur-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    color: #666;
}

.blur-type-btn i {
    font-size: 1rem;
}

.blur-type-btn:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary);
}

.blur-type-btn.active {
    border-color: var(--studio-primary);
    background: var(--studio-primary);
    color: #fff;
}

/* Options flou radial */
.blur-radial-options,
.blur-optimized-options {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 10px;
}

.blur-mode-buttons {
    display: flex;
    gap: 5px;
}

.blur-mode-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.blur-mode-btn:hover {
    border-color: var(--studio-primary);
}

.blur-mode-btn.active {
    border-color: var(--studio-primary);
    background: var(--studio-primary);
    color: #fff;
}

/* Adjustment items */
.adjustment-item {
    margin-bottom: 8px;
}

.adjustment-item:last-of-type {
    margin-bottom: 15px;
}

/* =====================================================
   PANNEAU DES CALQUES
   ===================================================== */
.layers-panel {
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    max-height: 300px;
}

.layers-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.layers-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.layers-count {
    background: var(--studio-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.layers-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.layers-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}

.layers-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

.layers-empty p {
    font-size: 0.85rem;
    margin: 0;
}

/* Item de calque */
.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    background: #f8f9fa;
    transition: all 0.15s;
    user-select: none;
}

.layer-item:hover {
    background: #e8eaed;
}

.layer-item.active {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid var(--studio-primary);
}

.layer-item.dragging {
    opacity: 0.5;
    background: #e0e0e0;
}

.layer-item.drag-over {
    border-top: 2px solid var(--studio-primary);
}

/* Miniature du calque */
.layer-thumbnail {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.layer-thumbnail i {
    font-size: 1rem;
    color: #666;
}

/* Infos du calque */
.layer-info {
    flex: 1;
    min-width: 0;
}

.layer-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.layer-name:hover {
    background: rgba(255, 107, 107, 0.1);
}

.layer-name-input {
    width: 100%;
    border: 1px solid var(--studio-primary) !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 0.8rem !important;
    outline: none !important;
    background: #fff !important;
    font-weight: 500;
}

.layer-type {
    font-size: 0.7rem;
    color: #999;
}

/* Actions du calque */
.layer-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.layer-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.15s;
    font-size: 0.8rem;
}

.layer-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.layer-action-btn.active {
    color: var(--studio-primary);
}

.layer-action-btn.hidden {
    color: #ccc;
}

.layer-action-btn.locked {
    color: #ffc107;
}

/* Poignée de drag */
.layer-drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 0.9rem;
}

.layer-drag-handle:active {
    cursor: grabbing;
}

/* =====================================================
   MODAL APERÇU
   ===================================================== */
.preview-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: nowrap;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1200px) {
    :root {
        --studio-sidebar-width: 240px;
        --studio-properties-width: 220px;
    }
}

@media (max-width: 992px) {
    .editor-properties {
        display: none;
    }

    .canvas-container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .editor-sidebar {
        position: fixed;
        left: -100%;
        top: var(--studio-toolbar-height);
        height: calc(100vh - var(--studio-toolbar-height));
        z-index: 200;
        transition: left 0.3s ease;
        width: 280px;
    }

    .editor-sidebar.active {
        left: 0;
    }

    .toolbar-center {
        display: none;
    }

    .creation-name input {
        width: 120px;
    }

    .btn-secondary span,
    .btn-primary span:not(.bi) {
        display: none;
    }

    .canvas-container {
        padding: 10px;
    }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.saving-indicator {
    animation: pulse 1s ease-in-out infinite;
}

/* Drag & Drop feedback */
.element-item.dragging {
    opacity: 0.5;
}

.canvas-wrapper.drop-target {
    outline: 3px dashed var(--studio-primary);
    outline-offset: -3px;
}

/* =====================================================
   BOUTON GUIDE
   ===================================================== */
.btn-guide {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: var(--studio-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-guide:hover {
    background: var(--studio-primary);
    color: white;
    border-color: var(--studio-primary);
}

.btn-guide i {
    font-size: 1.1rem;
}

/* =====================================================
   MODAL GUIDE
   ===================================================== */
#guideModal .modal-body {
    max-height: 70vh;
}

#guideModal .tab-content {
    display: block !important;
    min-height: 300px;
}

#guideModal .tab-pane {
    display: none;
}

#guideModal .tab-pane.active {
    display: block !important;
}

#guideModal kbd {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    font-family: monospace;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    color: #333 !important;
}

#guideModal .shortcut-section {
    margin-bottom: 20px;
}

#guideModal .shortcut-section h6 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

#guideModal .shortcut-section table {
    margin-bottom: 0;
}

#guideModal .shortcut-section table td:first-child {
    width: 40%;
    font-weight: 500;
}

#guideModal .workflow-step,
#guideModal .interface-section,
#guideModal .faq-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

#guideModal .workflow-step h6,
#guideModal .interface-section h6,
#guideModal .faq-item h6 {
    color: var(--studio-primary);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

#guideModal .alert-warning {
    border-left: 4px solid #ffc107;
}

#guideModal .nav-tabs .nav-link {
    color: #666;
    border: none;
    padding: 8px 16px;
}

#guideModal .nav-tabs .nav-link:hover {
    color: var(--studio-primary);
    border: none;
}

#guideModal .nav-tabs .nav-link.active {
    color: var(--studio-primary);
    background: transparent;
    border-bottom: 2px solid var(--studio-primary);
    font-weight: 600;
}

