/* Style global pour l'éditeur */
#main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Custom modal overlay styles (pour notifications et confirmations) */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.custom-modal-overlay.notification-modal-overlay {
    z-index: 10001;
}

.custom-modal-overlay .custom-modal {
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-modal-overlay .custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.custom-modal-overlay .custom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2D3E50;
}

.custom-modal-overlay .custom-modal-body {
    padding: 24px;
}

.custom-modal-overlay .custom-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-overlay .btn-modal-primary {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-modal-overlay .btn-modal-primary:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    transform: translateY(-1px);
}

.custom-modal-overlay .btn-modal-cancel {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-modal-overlay .btn-modal-cancel:hover {
    background: #dee2e6;
}

.custom-modal-overlay .btn-modal-delete {
    background: var(--shary-corail, #FF7675);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-modal-overlay .btn-modal-delete:hover {
    background: var(--shary-corail-hover, #E85E5D);
    transform: translateY(-1px);
}

#top-controls {
    background: var(--shary-blanc, white);
    padding: 20px;
    border-radius: var(--shary-radius-lg, 24px);
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}


.control-group input,
.control-group textarea,
.control-group select {
    padding: 10px 16px;
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-sm, 8px);
    font-family: var(--shary-font-family, 'Poppins', sans-serif);
    transition: all 0.3s ease;
}

.control-group input:focus,
.control-group textarea:focus,
.control-group select:focus {
    border-color: var(--shary-bleu-clair, #74B9FF);
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}



.control-group .color-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    border: 1px solid #ddd;
}

#editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin: 20px 0;
}

#editor-container {
    width: 100%;
    height: auto;
    background: var(--shary-gris-bg, #F8F9FA);
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    position: relative;
    overflow: hidden;
}

#side-panel {
    background: var(--shary-blanc, white);
    padding: 20px;
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
    height: fit-content;
}

.merge-field {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--shary-bleu-clair, #74B9FF);
    border-radius: var(--shary-radius-sm, 8px);
    padding: 8px;
    cursor: move;
    user-select: none;
    touch-action: none;
    min-width: 50px;
    min-height: 30px;
    overflow: hidden;
    word-wrap: break-word;
    text-overflow: ellipsis;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.merge-field.selected,
.merge-field.multi-selected {
    border: 4px solid var(--shary-bleu-clair, #74B9FF) !important;
    box-shadow: 0 0 0 4px rgba(116, 185, 255, 0.4), 0 4px 12px rgba(116, 185, 255, 0.3);
    z-index: 1000;
    outline: none;
}

/* Info de sélection multiple dans le panneau latéral */
.multi-select-info {
    background: linear-gradient(135deg, #74B9FF 0%, #5FA3E8 100%);
    color: white;
    padding: 10px 15px;
    border-radius: var(--shary-radius-sm, 8px);
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(116, 185, 255, 0.2);
}

.multi-select-info i {
    font-size: 14px;
}

.merge-field img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Style pour les images circulaires */
.merge-field.circular {
    border-radius: 50%;
    overflow: hidden;
}

.merge-field.circular img {
    object-fit: cover;
}

/* Styles pour les poignées de redimensionnement */
.merge-field:hover {
    outline: 2px solid var(--shary-violet, #6C5CE7);
}

#action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Indicateur de sélection multiple */
#multi-selection-indicator {
    background: linear-gradient(135deg, #FD9644 0%, #FFA06A 100%);
    color: white;
    padding: 12px 20px;
    border-radius: var(--shary-radius-md, 12px);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(253, 150, 68, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

#multi-selection-indicator i.fa-layer-group {
    font-size: 16px;
}

#multi-selection-count {
    font-weight: 700;
    font-size: 16px;
}

#clear-multi-selection {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: var(--shary-radius-sm, 6px);
    cursor: pointer;
    margin-left: auto;
    transition: background 0.2s ease;
}

#clear-multi-selection:hover {
    background: rgba(255, 255, 255, 0.3);
}

#action-bar button {
    background: var(--shary-violet, #6C5CE7);
    color: var(--shary-blanc, white);
    border: none;
    border-radius: var(--shary-radius-sm, 8px);
    cursor: pointer;
    padding: 10px 24px;
    font-weight: var(--shary-font-weight-medium, 500);
    transition: all 0.3s ease;
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
}

#action-bar button:hover {
    background: var(--shary-gradient, linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%));
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
    transform: translateY(-2px);
}

#side-panel.active {
    display: block;
}

#close-panel {
    float: right;
    cursor: pointer;
    font-size: 20px;
}

#final-section {
    margin-top: 20px;
    text-align: center;
}

#final-image {
    max-width: 100%;
    margin-top: 15px;
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-lg, 24px);
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
}

.error-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: var(--shary-blanc, white);
    border-radius: var(--shary-radius-lg, 24px);
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
    text-align: center;
}

#debug-download-json {
    background-color: var(--shary-gris-neutre, #2D3436);
    color: var(--shary-blanc, white);
    border: none;
    padding: 10px 24px;
    border-radius: var(--shary-radius-sm, 8px);
    cursor: pointer;
    font-weight: var(--shary-font-weight-medium, 500);
    transition: all 0.3s ease;
}

#debug-download-json:hover {
    background-color: var(--shary-gris-dark, #1E2426);
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
}

.button.debug {
    background-color: var(--shary-gris-neutre, #2D3436);
    margin-right: 10px;
}

.button.debug:hover {
    background-color: var(--shary-gris-dark, #1E2426);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--shary-gradient, linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%));
    color: var(--shary-blanc, white);
    border-radius: var(--shary-radius-md, 16px) var(--shary-radius-md, 16px) 0 0;
    margin: -20px -20px 20px -20px;
}

.side-panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: var(--shary-font-weight-semibold, 600);
    color: var(--shary-blanc, white);
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    color: var(--shary-blanc, white);
    transition: all 0.3s ease;
}

.close-button:hover {
    color: var(--shary-gris-light, #B2BEC3);
    transform: rotate(90deg);
}

/* Modal custom pour l'éditeur de bannières - ajoutées dynamiquement au body par JS */
.background-image-modal,
.configuration-modal,
.share-text-modal,
.wizard-modal,
.editor-modal,
#json-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* Quand le JS définit display: block, on force flex pour centrer */
.background-image-modal[style*="display: block"],
.configuration-modal[style*="display: block"],
.share-text-modal[style*="display: block"],
.wizard-modal[style*="display: block"],
.editor-modal[style*="display: block"],
#json-modal[style*="display: block"] {
    display: flex !important;
}

.background-image-modal .modal-content,
.configuration-modal .modal-content,
.share-text-modal .modal-content,
.wizard-modal .modal-content,
.editor-modal .modal-content,
#json-modal .modal-content {
    position: relative;
    background-color: var(--shary-blanc, white);
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    border-radius: var(--shary-radius-lg, 24px);
    box-shadow: 0 20px 60px rgba(108, 92, 231, 0.2);
    border: none;
    overflow: hidden;
}

.background-image-modal .modal-header,
.configuration-modal .modal-header,
.share-text-modal .modal-header,
.wizard-modal .modal-header,
.editor-modal .modal-header,
#json-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--shary-gradient, linear-gradient(135deg, #8B7EEB 0%, #6C5CE7 100%));
    color: var(--shary-blanc, white);
    padding: 24px 28px;
    border-bottom: none;
}

.background-image-modal .modal-header h2,
.background-image-modal .modal-header h3,
.configuration-modal .modal-header h2,
.configuration-modal .modal-header h3,
.share-text-modal .modal-header h2,
.share-text-modal .modal-header h3,
.wizard-modal .modal-header h2,
.wizard-modal .modal-header h3,
.editor-modal .modal-header h2,
.editor-modal .modal-header h3,
#json-modal .modal-header h2,
#json-modal .modal-header h3 {
    color: var(--shary-blanc, white);
    font-weight: 600;
    margin: 0;
    font-size: 1.25rem;
}

.background-image-modal .close-button,
.configuration-modal .close-button,
.share-text-modal .close-button,
.wizard-modal .close-button,
.editor-modal .close-button,
#json-modal .close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background-image-modal .close-button:hover,
.configuration-modal .close-button:hover,
.share-text-modal .close-button:hover,
.wizard-modal .close-button:hover,
.editor-modal .close-button:hover,
#json-modal .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.background-image-modal .modal-body,
.configuration-modal .modal-body,
.share-text-modal .modal-body,
.wizard-modal .modal-body,
.editor-modal .modal-body,
#json-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 28px;
}

.background-image-modal .modal-footer,
.configuration-modal .modal-footer,
.share-text-modal .modal-footer,
.editor-modal .modal-footer {
    padding: 20px 28px;
    background: var(--shary-gris-bg, #F8F9FA);
    border-top: 1px solid var(--shary-gris-light, #E0E0E0);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal .btn {
    padding: 12px 24px;
    border-radius: var(--shary-radius-sm, 8px);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal .btn-primary {
    background: var(--shary-violet, #6C5CE7);
    color: white;
}

.modal .btn-primary:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.3);
}

.modal .btn-secondary {
    background: white;
    color: var(--shary-gris-dark, #2D3436);
    border: 2px solid var(--shary-gris-light, #B2BEC3);
}

.modal .btn-secondary:hover {
    background: var(--shary-gris-bg, #F8F9FA);
    border-color: var(--shary-gris-neutre, #636E72);
}

/* Unsaved Changes Modal */
.unsaved-changes-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.unsaved-changes-modal .modal-content {
    max-width: 500px;
    position: relative;
}

.unsaved-changes-modal .modal-body {
    padding: 28px;
}

.unsaved-changes-modal .modal-body p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--shary-gris-dark, #2D3436);
    margin: 0;
}

#json-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

.banner-selection-modal .modal-content {
    max-width: 800px;
    width: 90%;
}

.banner-selection-modal .modal-body {
    padding: 20px;
}

.banner-selection-modal .upload-section {
    margin-bottom: 20px;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 5px;
    text-align: center;
}

.banner-selection-modal .size-recommendation {
    color: #666;
    margin: 10px 0;
    font-size: 0.9em;
}

.banner-selection-modal .upload-custom-banner {
    padding: 12px 24px;
    background: var(--shary-violet, #6C5CE7);
    color: var(--shary-blanc, white);
    border: none;
    border-radius: var(--shary-radius-sm, 8px);
    cursor: pointer;
    font-weight: var(--shary-font-weight-medium, 500);
    transition: all 0.3s ease;
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
}

.banner-selection-modal .upload-custom-banner:hover {
    background: var(--shary-gradient, linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%));
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
    transform: translateY(-2px);
}

.banner-selection-modal .separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.banner-selection-modal .separator:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.banner-selection-modal .separator span {
    background: white;
    padding: 0 15px;
    position: relative;
    color: #666;
}

.banner-selection-modal .banner-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.banner-selection-modal .banner-template {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--shary-radius-md, 16px);
    overflow: hidden;
    transition: all 0.3s;
    text-align: center;
}

.banner-selection-modal .banner-template:hover {
    border-color: var(--shary-violet, #6C5CE7);
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
    transform: translateY(-4px);
}

.banner-selection-modal .banner-template img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.banner-selection-modal .banner-template span {
    display: block;
    padding: 8px;
    background: #f0f0f0;
}

.button.select-background {
    background: var(--shary-violet, #6C5CE7);
    color: var(--shary-blanc, white);
    padding: 10px 24px;
    border: none;
    border-radius: var(--shary-radius-sm, 8px);
    cursor: pointer;
    margin-top: 10px;
    font-weight: var(--shary-font-weight-medium, 500);
    transition: all 0.3s ease;
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
}

.button.select-background:hover {
    background: var(--shary-gradient, linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%));
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
    transform: translateY(-2px);
}

/* Style pour le conteneur principal de l'éditeur et le wrapper */
.banner-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#main-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#editor-wrapper {
    display: flex;
    position: relative;
    min-height: 400px;
    justify-content: flex-start;
    overflow: hidden;
}

/* Style pour l'éditeur principal */
#editor-container {
    background-color: #ffffff;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid #dee2e6;
    margin: 0;
    position: relative;
    overflow: hidden;
    flex-grow: 0;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Styles pour le panneau latéral d'édition */
#side-panel {
    background: var(--shary-blanc, #ffffff);
    border-left: 1px solid var(--shary-gris-light, #B2BEC3);
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
    padding: 0;
    width: 300px;
    transition: all 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    flex-shrink: 0;
}

.side-panel-header {
    background: var(--shary-gradient, linear-gradient(135deg, #6C5CE7 0%, #74B9FF 100%));
    color: var(--shary-blanc, white);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.side-panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: var(--shary-font-weight-semibold, 600);
    color: var(--shary-blanc, white);
    text-align: center;
}

.side-panel-header .close-button {
    background: none;
    border: none;
    color: var(--shary-blanc, white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    transition: all 0.3s ease;
}

.side-panel-header .close-button:hover {
    color: var(--shary-gris-light, #B2BEC3);
    transform: rotate(90deg);
}

#side-panel-content {
    padding: 15px;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Styles des groupes de contrôles */
.control-group {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--shary-blanc, white);
    border-radius: var(--shary-radius-sm, 8px);
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.control-group:hover {
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-weight: var(--shary-font-weight-medium, 500);
    color: var(--shary-gris-neutre, #2D3436);
    font-size: 0.9rem;
}

/* Style pour les labels avec icônes */
.control-group label i {
    margin-right: 8px;
    display: inline-block;
    width: 16px;
    text-align: center;
    color: var(--shary-violet, #6C5CE7);
}

.control-group label.with-icon {
    display: flex;
    align-items: center;
}

/* Style spécifique pour les groupes avec select - label et contrôle sur la même ligne */
.control-group.inline-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-group.inline-control label {
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: 100px;
}

.control-group.inline-control select,
.control-group.inline-control .format-buttons {
    flex: 1;
}

/* Styles pour les inputs */
.control-group input[type="text"],
.control-group input[type="number"],
.control-group textarea,
.control-group select {
    padding: 10px 16px;
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-sm, 8px);
    font-size: 0.9rem;
    font-family: var(--shary-font-family, 'Poppins', sans-serif);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.control-group input[type="text"]:focus,
.control-group input[type="number"]:focus,
.control-group textarea:focus,
.control-group select:focus {
    border-color: var(--shary-bleu-clair, #74B9FF);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}

.control-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Styles pour les sliders et inputs range */
.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: var(--shary-radius-sm, 8px);
    background: var(--shary-gris-light, #B2BEC3);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--shary-violet, #6C5CE7);
    cursor: pointer;
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
    transition: all 0.3s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
}

/* Style pour les checkbox - alignées à gauche */
.control-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.checkbox-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}



.control-group input[type="checkbox"] + label {
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 0;
}

/* Style pour les inputs de couleur */
.control-group input[type="color"] {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Message quand aucun élément n'est sélectionné */
.no-selection {
    color: #6c757d;
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

/* Styles pour les entrées côte à côte */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group input {
    flex: 1;
}

/* Effet de survol pour les groupes de contrôles */
.control-group:hover {
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.12));
}

/* Styles spécifiques pour les contrôles d'image */
#field-width, #field-height {
    width: calc(50% - 5px);
    display: inline-block;
}



/* Styles pour les champs d'édition */
.merge-field {
    border: 2px dashed var(--shary-gris-light, #B2BEC3);
    background-color: rgba(255, 255, 255, 0.7);
    min-width: 50px;
    min-height: 30px;
    position: absolute !important;
    cursor: move;
    z-index: 5;
    transition: all 0.3s ease;
    border-radius: var(--shary-radius-sm, 8px);
    overflow: hidden;
    word-wrap: break-word;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
}

.merge-field.selected {
    border: 2px solid var(--shary-violet, #6C5CE7);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* ============================================
   WIZARD DE CRÉATION DE BANNIÈRE
   ============================================ */

.wizard-modal .modal-content {
    max-width: 700px;
    width: 95%;
}

.wizard-modal .wizard-content {
    border-radius: var(--shary-radius-lg, 24px);
    overflow: hidden;
}

.wizard-modal .wizard-header {
    background: var(--shary-gradient, linear-gradient(135deg, #8B7EEB 0%, #6C5CE7 100%));
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wizard-modal .wizard-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.wizard-modal .close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-modal .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Progress Bar */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: var(--shary-gris-bg, #F8F9FA);
    border-bottom: 1px solid var(--shary-gris-light, #B2BEC3);
}

.wizard-progress .progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.wizard-progress .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #DFE6E9;
    color: var(--shary-gris-dark, #1E2426);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid #B2BEC3;
}

.wizard-progress .step-label {
    font-size: 12px;
    color: var(--shary-gris-dark, #1E2426);
    font-weight: 500;
    white-space: nowrap;
}

.wizard-progress .progress-step.active .step-number {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.wizard-progress .progress-step.completed .step-number {
    background: var(--shary-vert, #00B894);
    color: white;
    border-color: var(--shary-vert, #00B894);
}

.wizard-progress .progress-step.completed .step-number::after {
    content: '✓';
}

.wizard-progress .progress-line {
    width: 60px;
    height: 3px;
    background: var(--shary-gris-light, #B2BEC3);
    margin: 0 10px;
    margin-bottom: 24px;
    border-radius: 2px;
}

/* Wizard Body */
.wizard-body {
    padding: 24px;
    min-height: 300px;
}

.wizard-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-step h4 {
    margin: 0 0 20px 0;
    color: var(--shary-gris-dark, #1E2426);
    font-size: 1.1rem;
    font-weight: 600;
}

.wizard-step .form-group {
    margin-bottom: 20px;
}

.wizard-step .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--shary-gris-neutre, #2D3436);
}

.wizard-step .form-group label .required {
    color: var(--shary-corail, #FF6B6B);
}

.wizard-step .form-group input,
.wizard-step .form-group select,
.wizard-step .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-sm, 8px);
    font-family: var(--shary-font-family, 'Poppins', sans-serif);
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.wizard-step .form-group input:focus,
.wizard-step .form-group select:focus,
.wizard-step .form-group textarea:focus {
    border-color: var(--shary-bleu-clair, #74B9FF);
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.15);
}

.wizard-step .form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--shary-gris-light, #B2BEC3);
}

/* Banner Type Selector avec Boutons */
.banner-type-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    background: white;
    border-radius: var(--shary-radius-sm, 8px);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.type-btn i {
    font-size: 24px;
    color: var(--shary-gris-dark, #1E2426);
    transition: all 0.3s ease;
}

.type-btn span {
    font-size: 14px;
    font-weight: 500;
    color: var(--shary-gris-dark, #1E2426);
    transition: all 0.3s ease;
}

.type-btn:hover {
    border-color: var(--shary-violet, #6C5CE7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
}

.type-btn.active {
    border-color: var(--shary-violet, #6C5CE7);
    background: var(--shary-violet-light, #F5F3FF);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.type-btn.active i,
.type-btn.active span {
    color: var(--shary-violet, #6C5CE7);
}

/* Merge Tags Section */
.merge-tags-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--shary-gris-bg, #F8F9FA);
    border-radius: var(--shary-radius-sm, 8px);
    border: 1px solid var(--shary-gris-light, #B2BEC3);
}

.merge-tags-label {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--shary-gris-dark, #1E2426);
}

.merge-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.merge-tag-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--shary-violet, #6C5CE7);
    color: var(--shary-violet, #6C5CE7);
    border-radius: var(--shary-radius-sm, 8px);
    font-family: monospace;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(108, 92, 231, 0.08);
}

.merge-tag-btn:hover {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.merge-tag-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(108, 92, 231, 0.08);
}

/* Upload Recommendations */
.upload-recommendations {
    background: var(--shary-gris-bg, #F8F9FA);
    border: 1px solid var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-sm, 8px);
    padding: 16px;
    margin-bottom: 20px;
}

.upload-recommendations .recommendations-title {
    font-weight: 600;
    color: var(--shary-gris-dark, #1E2426);
    margin: 0 0 12px 0;
    font-size: 14px;
}

.upload-recommendations .recommendations-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.upload-recommendations .recommendations-list li {
    font-size: 13px;
    color: var(--shary-gris-neutre, #2D3436);
    margin-bottom: 8px;
    line-height: 1.5;
}

.upload-recommendations .recommendations-list li:last-child {
    margin-bottom: 0;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-md, 16px);
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--shary-gris-bg, #F8F9FA);
}

.upload-zone.drag-over {
    border-color: var(--shary-violet, #6C5CE7);
    background: rgba(108, 92, 231, 0.05);
}

.upload-placeholder .upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--shary-violet, #6C5CE7);
    font-weight: 300;
}

.upload-placeholder p {
    margin: 8px 0;
    color: var(--shary-gris-neutre, #2D3436);
}

.upload-placeholder .upload-or {
    color: var(--shary-gris-light, #B2BEC3);
    font-size: 12px;
}

.upload-placeholder .upload-hint {
    display: block;
    margin-top: 16px;
    font-size: 11px;
    color: var(--shary-gris-light, #B2BEC3);
}

.upload-preview {
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: var(--shary-radius-sm, 8px);
    box-shadow: var(--shary-shadow-soft, 0 4px 12px rgba(108, 92, 231, 0.08));
}

.upload-preview .btn-sm {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 12px;
}

/* Share Preview */
.share-preview {
    margin-top: 24px;
    padding: 16px;
    background: var(--shary-gris-bg, #F8F9FA);
    border-radius: var(--shary-radius-sm, 8px);
}

.share-preview h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--shary-gris-neutre, #2D3436);
}

.share-preview-box {
    background: white;
    padding: 16px;
    border-radius: var(--shary-radius-sm, 8px);
    border: 1px solid var(--shary-gris-light, #B2BEC3);
    font-size: 14px;
    line-height: 1.6;
    color: var(--shary-gris-neutre, #2D3436);
    white-space: pre-wrap;
}

.share-preview-box .merge-tag {
    background: rgba(108, 92, 231, 0.1);
    color: var(--shary-violet, #6C5CE7);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* Wizard Footer */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--shary-gris-bg, #F8F9FA);
    border-top: 1px solid var(--shary-gris-light, #B2BEC3);
    gap: 10px;
}

.wizard-footer .footer-spacer {
    flex: 1;
}

.wizard-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--shary-radius-sm, 8px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-footer .btn-secondary {
    background: white;
    color: var(--shary-violet, #6C5CE7);
    border: 2px solid var(--shary-violet, #6C5CE7);
}

.wizard-footer .btn-secondary:hover {
    background: var(--shary-violet, #6C5CE7);
    color: white;
}

.wizard-footer .btn-primary {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    border: 2px solid var(--shary-violet, #6C5CE7);
}

.wizard-footer .btn-primary:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    border-color: var(--shary-violet-hover, #5B4BCF);
    transform: translateY(-2px);
    box-shadow: var(--shary-shadow-medium, 0 8px 24px rgba(108, 92, 231, 0.2));
}

/* Responsive Wizard */
@media (max-width: 600px) {
    .wizard-progress {
        padding: 16px 10px;
    }
    
    .wizard-progress .progress-line {
        width: 30px;
    }
    
    .wizard-progress .step-label {
        font-size: 10px;
    }
    
    .wizard-progress .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .wizard-body {
        padding: 16px;
    }
    
    .wizard-footer {
        flex-wrap: wrap;
    }
    
    .wizard-footer .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* Boutons dans les modales custom */
.btn-modal-primary {
    padding: 12px 24px;
    background: var(--shary-violet, #6C5CE7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-modal-primary:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-modal-primary i {
    font-size: 14px;
}

.btn-modal-cancel {
    padding: 12px 24px;
    background: transparent;
    color: var(--shary-violet, #6C5CE7);
    border: 2px solid var(--shary-violet, #6C5CE7);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-modal-cancel:hover {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    transform: translateY(-2px);
}

.btn-modal-cancel i {
    font-size: 14px;
}

/* Bouton de suppression dans la modale */
.btn-modal-delete {
    padding: 12px 24px;
    background: var(--shary-corail, #FF7675);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-modal-delete:hover {
    background: var(--shary-corail-hover, #E85E5D);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 118, 117, 0.3);
}

.btn-modal-delete i {
    font-size: 14px;
}

/* Modale de suppression */
.delete-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.delete-modal .modal-content {
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: white;
}

.delete-modal .modal-header {
    background: linear-gradient(135deg, var(--shary-violet, #6C5CE7) 0%, var(--shary-violet-dark, #5B4CD3) 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
}

.delete-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.delete-modal .modal-body {
    padding: 30px 25px;
}

.delete-warning {
    text-align: center;
}

.delete-warning i {
    display: block;
    margin: 0 auto 20px;
}

.delete-modal .modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #E8E8E8;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 12px 12px;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    color: var(--shary-violet, #6C5CE7);
    border: 2px solid var(--shary-violet, #6C5CE7);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    padding: 10px 20px;
    background: var(--shary-corail, #FF7675);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #E85E5D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 118, 117, 0.3);
}

/* Boutons de formatage de texte */
.format-buttons {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.format-btn {
    flex: 0 0 auto;
    padding: 6px 8px;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 32px;
}

.format-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.format-btn.active {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    border-color: var(--shary-violet, #6C5CE7);
}

.format-btn.active:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    border-color: var(--shary-violet-hover, #5B4BCF);
}

.format-btn i {
    font-size: 10px;
}

/* Bouton clear couleur (transparence) */
.btn-clear-color {
    padding: 4px 8px;
    border: 1px solid var(--shary-gris-clair, #e0e0e0);
    background: var(--shary-blanc, #ffffff);
    border-radius: 4px;
    cursor: pointer;
    color: var(--shary-gris-fonce, #666);
    font-size: 12px;
    margin-left: 4px;
    transition: all 0.2s ease;
}

.btn-clear-color:hover {
    background: var(--shary-gris-clair, #f0f0f0);
    border-color: var(--shary-violet, #6C5CE7);
}

.btn-clear-color.active {
    background: var(--shary-violet, #6C5CE7);
    border-color: var(--shary-violet, #6C5CE7);
    color: white;
}

.btn-clear-color.active:hover {
    background: var(--shary-violet-hover, #5B4BCF);
}

/* Contrôles d'alignement */
.alignment-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.alignment-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alignment-label {
    font-size: 0.85rem;
    color: var(--shary-gris-neutre, #2D3436);
    min-width: 80px;
    margin: 0;
}

.alignment-buttons {
    display: flex;
    gap: 4px;
}

.alignment-btn {
    flex: 0 0 auto;
    padding: 6px 10px;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 32px;
}

.alignment-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.alignment-btn.active {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    border-color: var(--shary-violet, #6C5CE7);
}

.alignment-btn.active:hover {
    background: var(--shary-violet-hover, #5B4BCF);
    border-color: var(--shary-violet-hover, #5B4BCF);
}

.alignment-btn i {
    font-size: 12px;
}

/* =====================================================
   MODALE DE TEXTE DE PARTAGE
   ===================================================== */

.share-text-modal .wizard-textarea,
.share-text-modal .share-text-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--shary-gris-light, #B2BEC3);
    border-radius: var(--shary-radius-sm, 8px);
    font-family: var(--shary-font-family, 'Poppins', sans-serif);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 180px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.share-text-modal .wizard-textarea:focus,
.share-text-modal .share-text-input:focus {
    border-color: var(--shary-bleu-clair, #74B9FF);
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.15);
}

.share-text-modal .wizard-form-group {
    margin-bottom: 20px;
}

.share-text-modal .wizard-merge-tags-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--shary-gris-bg, #F8F9FA);
    border-radius: var(--shary-radius-sm, 8px);
    border: 1px solid var(--shary-gris-light, #B2BEC3);
}

.share-text-modal .wizard-merge-tags-label {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--shary-gris-dark, #1E2426);
}

.share-text-modal .wizard-merge-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.share-text-modal .wizard-merge-tag {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--shary-violet, #6C5CE7);
    color: var(--shary-violet, #6C5CE7);
    border-radius: var(--shary-radius-sm, 8px);
    font-family: monospace;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(108, 92, 231, 0.08);
}

.share-text-modal .wizard-merge-tag:hover {
    background: var(--shary-violet, #6C5CE7);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.share-text-modal .wizard-merge-tag:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(108, 92, 231, 0.08);
}

/* =====================================================
   CHAMPS MULTILIGNES (MERGE FIELDS)
   ===================================================== */

.merge-field[data-type="multiline"],
.merge-field[data-is-multiline="true"] {
    white-space: normal !important;
    word-wrap: break-word;
    overflow: hidden;
}