.site-inner {
    padding: 0;
    width:100%;
    max-width: 100%;
    margin: 0;
}
#genesis-content{
    position: relative;
    /* La largeur prendra toute la place moins la toolbar de 100px */
    max-width: calc(100% - 120px); 
    width: 100%;
    float: right;
    /* Positionne juste après la toolbar (100px) + marge (20px) */
    margin-left: 120px; 
    transition: margin-left 0.3s ease; /* Transition pour un effet fluide */
}
#genesis-content.drawers-visible{
    /* 100px (toolbar) + 250px (drawers) + 20px (marge) = 370px */
    max-width: calc(100% - 370px); 
    margin-left: 370px;
}
#vcreator-drawers {
    width: 250px; 
    height: calc(100vh - 110px);
    position: fixed; 
    top: 110px;
    z-index: 998;
    padding: 10px;
    background: #f0f0f0;
    overflow-y: auto;
    
    /* MASQUAGE PAR DÉFAUT : Déplacer le bloc hors de l'écran */
    left: -250px; 
    transition: left 0.3s ease; /* Ajout d'une transition pour l'effet "slide" */
}
#vcreator-drawers.open-drawers {
    /* Repositionner le bloc juste après la toolbar de 100px */
    left: 100px; 
}
.vcreator-toolbar{
    width:100px;
    background: #838c95;
    text-align: left;
    padding: 5px;
    height:calc(100vh - 110px);
    position: fixed;
    top:110px;
    left:0;
    z-index: 999;
}

.vcreator-toolbar hr{
    border-top:1px solid #fff;
    margin:0;
}
.vcreator-toolbar .tool-title,
.vcreator-toolbar * {
    font-size: 1rem;
    font-family: Helvetica;
    text-transform: none;
    font-weight: normal;
    text-align: center;
}
.vcreator-toolbar .tool-title{
    font-size: 1.2rem;
    display: block;
    color:#fff;
    font-weight: bold;
}
.vcreator-toolbar button
 {
    width: 80px; 
    margin: 5px;
    padding: 5px; 
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center; 
}
#vcreator-drawers button{
    background: #333;
    color: #fff;
    border: none;
    border-radius: 0px;
}
.vcreator-toolbar button [class*="fa-"] {
    font-size: 2.2em;
    line-height: 1;
    margin-bottom: 3px; 
}
.vcreator-toolbar #bg-fit-controls button{
    width:33%;
    margin:1px; 
    padding: 1px;
}
.vcreator-toolbar button span:not([class*="fa-"]) {
    font-size: 0.85em; 
    line-height: 1.2;
}
.with-tools{
    display: flex;
}
.with-tools button:first-child{
    margin-right:0;
}
.with-tools button:last-child{
    width:33%;
}
/* Tiroirs */
.vcreator-drawer {
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    overflow: hidden;
    
    /* CRITIQUE : Le tiroir doit être caché par défaut */
    display: none;
}
.vcreator-drawer.open {
    display: block; 
}
.vcreator-toolbar button.vcreator-drawer-toggle-main {
    background: #5a5a5a; /* Couleur différente pour les distinguer */
}

.vcreator-toolbar button.vcreator-drawer-toggle-main.active {
    background: #4CAF50; /* Vert quand actif */
}

.vcreator-drawer-toggle {
    width: 100%;
    padding: 12px 15px;
    background: #f8f9fa;
    border: none;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: space-between; /* Pour mettre le X à droite */
    align-items: center;
    font-weight: 500;
}

.vcreator-drawer-toggle:hover {
    background: #e9ecef;
}

.vcreator-drawer-toggle .fa-chevron-down {
    transition: transform 0.3s;
    font-size: 12px;
}

.vcreator-drawer-toggle.open .fa-chevron-down {
    transform: rotate(180deg);
}

.vcreator-drawer-content.open {
    max-height: 500px;
    padding: 15px;
}

/* Contrôles à l'intérieur des tiroirs */
#bg-fit-controls,
#text-controls {
    display: flex;
    gap: 8px;
    /* Ajouté/Modifié : Centre les éléments (boutons) horizontalement */
    justify-content: center; 
    /* 'align-items' centre verticalement, ce qui est souvent désiré aussi */
    align-items: center;
    flex-wrap: wrap;
}

#text-controls select,
#text-controls input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#text-controls input[type="number"] {
    width: 60px;
}

#bg-fit-controls button,
#text-controls button,
#drawer-overlays button{
    margin:2px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    color:#333;
}

#bg-fit-controls button.active,
#text-controls button.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

#bg-fit-controls button:hover,
#text-controls button:hover {
    border-color: #4CAF50;
}


/*--------------------*/
.vcreator-wrapper {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    font-family: sans-serif;
}

.vcreator-wrapper {
    margin-bottom: 10px;
}


.vcreator-canvas-container {
    position: relative;
    float: right;
    margin: 20px auto; /* Marge + centrage horizontal */
    width: 100%; /* Largeur relative à la zone #genesis-content */
    max-width: 1200px; /* Limite maximale pour rester confortable */
    aspect-ratio: 1 / 1; /* Carré parfait */
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

#vcreator-canvas {
  position: absolute;
    top: 0;
    left: 0;
}
.editor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.vcreator-zoom-controls {
    text-align: right;
    width: 100%;
    /* Positionné au-dessus du canvas */
    margin-bottom: 10px;
    padding-right: 5%; /* Aligner avec la marge du conteneur */
}

.vcreator-zoom-controls button {
    background: #333;
    color: #fff;
    border: none;
    padding: 5px 10px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 4px;
}

.vcreator-zoom-controls span {
    margin: 0 10px;
    font-weight: bold;
}
.vcreator-zindex-controls {
    /* Utiliser Flexbox pour un layout en grille */
    display: flex; 
    flex-wrap: wrap; /* Permet aux boutons de passer à la ligne */
    justify-content: space-between; /* Espace équitable entre les deux colonnes */
    
    /* Le conteneur doit prendre toute la largeur de la toolbar */
    width: 100%;
    padding: 0; 
    border-left: none; /* Supprimer les styles d'alignement horizontal qui ne sont plus nécessaires */
    margin-left: 0;
    text-align: center;
}

.vcreator-zindex-controls p {
    /* Assurer que le texte "Ordre des Calques :" prend toute la largeur pour être au-dessus des boutons */
    width: 100%;
    display: block;
    font-weight: bold;
    margin: 5px 0 5px 0; /* Ajuster les marges pour l'espacement */
    text-align: center;
    color: #333; /* Rétablir la couleur du texte si elle a été modifiée */
}

.vcreator-zindex-controls button {
    /* Calcul de la largeur : 48% pour laisser 4% de marge totale (2% entre les boutons) */
    width: 48%; 
    height: 40px;
    margin: 1% 1%; /* Marge verticale et horizontale */
    padding: 0;
    line-height: 40px; /* Centrer l'emoji/icône verticalement */
    font-size: 16px;
    background: #5a5a5a;
    color: #fff;
    border-radius: 4px;
    
    /* S'assurer que le contenu du bouton est centré (pour l'icône) */
    display: flex;
    justify-content: center;
    align-items: center;
}

.vcreator-zindex-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ===== MODAL ===== */
.vcreator-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.vcreator-modal.active {
    display: flex !important;
}

.vcreator-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.vcreator-modal-content {
    position: relative;
    background: #fff;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 2;
    width: 90%;
    max-width: 400px;
    animation: fadeInUp 0.3s ease-out;
    text-align: center;
}

.vcreator-inputs input {
    width: 100%;
    margin: 6px 0;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.vcreator-actions {
    margin-top: 15px;
}

.vcreator-actions .button {
    margin: 5px;
    padding: 8px 15px;
    cursor: pointer;
}

.vcreator-feedback {
    margin-top: 10px;
    font-size: 0.9em;
}

@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
