 @import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

body {
    font-family: "Ubuntu";
    background-color: #f9f5eb;
    margin: 0;
    padding: 10px;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #b8a57e;
    margin-bottom: 20px;
    font-size: 24px;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.preview {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    position: relative;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background-color: #fff;
}

.preview.rectangulaire {
    border-radius: 10px;
    height: 400px;
    /* Forme rectangle plus haute que large */
}

#ecussonCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 280px;
}

.control-panel {
    background-color: #f5f0e5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.control-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.slider-container {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.slider-container label {
    width: 100%;
    font-weight: bold;
    margin-bottom: 5px;
}

.slider-container input[type="range"] {
    flex: 1;
    min-width: 100px;
    height: 30px;
    margin-right: 8px;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #b8a57e;
    cursor: pointer;
}

.slider-container input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: #ddd;
    border-radius: 4px;
}

.slider-container .value {
    width: 50px;
    text-align: center;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.color-picker label {
    width: 100%;
    font-weight: bold;
    margin-bottom: 5px;
}

.color-picker input[type="color"] {
    width: 60px;
    height: 35px;
    cursor: pointer;
    -webkit-appearance: none;
    border: 1px solid #ccc;
}

.text-input {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;  
}

.text-input label {
    width: 100%;
    font-weight: bold;
    margin-bottom: 5px;
}

.text-input input[type="text"],
.text-input select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    -webkit-appearance: none;
    flex: 1;
}

.file-input {
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.file-input label {
    width: 100%;
    font-weight: bold;
    margin-bottom: 5px;
}

.file-input input[type="file"] {
    width: 100%;
    padding: 5px 0;
    font-size: 14px;
}

.export-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #b8a57e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
    margin-top: 15px;
    -webkit-appearance: none;
}

.export-button:hover {
    background-color: #a08d63;
}

.form-choice {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.form-choice-btn {
    padding: 10px 20px;
    margin: 0 10px;
    background-color: #f5f0e5;
    border: 2px solid #b8a57e;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.form-choice-btn.active {
    background-color: #b8a57e;
    color: white;
}

.dimensions-container {
    display: flex;
    gap: 10px;
}

.dimension-input {
    flex: 1;
}

#debug {
    background: #f0f0f0;
    padding: 5px;
    margin-top: 10px;
    border: 1px solid #ccc;
    font-family: monospace;
    font-size: 12px;
    display: none;
}

select option {
    font-size: 16px;
}

/* Media queries pour responsive */
@media (min-width: 600px) {
    body {
        padding: 20px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
    }

    .slider-container label,
    .color-picker label,
    .text-input label,
    .file-input label {
        width: 120px;
    }

    .text-input input[type="text"],
    .text-input select {
        width: calc(100% - 130px);
        flex: 1;
    }

    .preview {
        width: 300px;
        height: 300px;
    }

    .preview.rectangulaire {
        height: 420px;
    }

    #ecussonCanvas {
        width: 300px;
        height: 300px;
    }
}

/* Ajustements pour petits écrans */
@media (max-width: 320px) {
    .preview {
        width: 250px;
        height: 250px;
    }

    .preview.rectangulaire {
        height: 350px;
    }

    #ecussonCanvas {
        width: 250px;
        height: 250px;
    }
}