* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    height: 100dvh;
    margin: 0;
    background: #f4f6f8;
}

.container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.btn-select {
    background: #1e88e5;
    color: white;
    border: none;
    padding: 18px 32px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(30,136,229,0.35);
    margin-bottom: 25px;
}

#preview {
    max-width: 900px;
    margin: 40px auto;
}

.page-image {
    width: 100%;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 0.5vw;
}

.page-wrapper {
    position: relative;
    margin-bottom: 25px;
        margin-top: 100px;
}

.page-wrapper img {
    width: 100%;
    display: block;
    border-radius: 6px;
}

.draw-canvas {
    position: absolute;
    top: 0;
    left: 0;

    pointer-events: auto;

   touch-action: pan-y;
   cursor: crosshair;

}



.loading-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-box {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    min-width: 260px;
}

.loading-box p {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #ddd;
    border-top-color: #1e88e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.color-bubble {
    width: 35px;
    height: 35px;



    flex-shrink: 0; /* 🔑 empêche l’écrasement */
    position: relative;
    cursor: pointer;
    display: inline-block;
}


.color-bubble input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;

    appearance: none;
    -webkit-appearance: none;

    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}


.bubble-preview {
    display: block;

    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #000000;
    pointer-events: none;
}


.save-toolbar {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    flex-direction: row-reverse;
    align-items: center;
        background-color: #dee8f9;
    
    padding: 10px;
    border-radius: 15px;
}



.zone-btn {
    width: 35px;
    height: 35px;
    border-radius: 25%;
    border: 0px solid #4444447f;
    background: #ffffff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
     display: flex;
}



/* bouton NORMAL dans le flex */
.btn-save {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 8px 22px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    
    white-space: nowrap; /* ⬅️ empêche l’écrasement du texte */
}

.btn-x {
       
    background: #d21e1e;
    color: white;
    border: none;
    padding: 0px 0px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    
    white-space: nowrap; /* ⬅️ empêche l’écrasement du texte */
}

.btn-save:hover {
    background: #1b5e20;
}


.zone-selector {
    display: flex;
    gap: 10px;
}
.zone-btn.active img {
    filter: invert(1);
}


.zone-btn:hover {
    background: #cfcfcf;
}

.zone-btn.active {
    background: #1e88e5;
    border-color: #1e88e5;
   
}

.drop-zone {
    width: 475px;
    height: 175px;
    border: 3px dashed #1e88e5;
    border-radius: 16px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.drop-zone:hover {
    background: #f1f6ff;
}

.drop-zone.dragover {
    background: #e3f0ff;
    border-color: #0d47a1;
    transform: scale(1.02);
}

.drop-content {
    text-align: center;
    color: #1e88e5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drop-content strong {
    font-size: 20px;
}

.drop-content span {
    font-size: 14px;
}

.drop-content small {
    font-size: 12px;
    color: #666;
}


.btn-x-image{
    width: 10vw;
    height: 10vw;
}


.btn-x-image{
    width: 35px;
    height: 35px;
        filter: invert(1);
    transform: scale(0.55);

}

.btn-close {
    position: fixed;
    z-index: 5000; /* plus haut que le canvas */
    pointer-events: auto;
}


@media (max-aspect-ratio: 1/1) {
    .save-toolbar {

    }
.zone-btn {
    width: 8vw;
    height: 8vw;

}
.color-bubble {
    width: 8vw;
    height: 8vw;


}

.btn-x {
    width: 8vw;
    height: 8vw;
    border-radius: 25%
}


.bubble-preview {
    display: block;

    width: 8vw;
    height: 8vw;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #000000;
    pointer-events: none;
}


.btn-x-image{
    width: 8vw;
    height: 8vw;
        filter: invert(1);
    transform: scale(0.55);

}

.btn-save {
font-size: 5vw;

border-radius: 6% / 25%;
}


.save-toolbar{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    }

#preview {
    max-width: 900px;
    margin: 40px auto;
    margin-top: 125px;
}

.drop-zone {
    width: 75vw;
    height: 25vw;
        border: 6px dashed #1e88e5;
        border-radius: 4vw;
}


.drop-content strong {
    font-size: 35px;
}

.drop-content small {
    font-size: 30px;
    color: #666;
}

.btn-select{

    font-size: 4vw;
    border-radius: 2vw;
    margin-bottom: 40px;


}
}


