html {
    font-size: 15px;
}

h1 {
    text-align: center;
}

.contentWrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 1vh !important; /*not like other pages bc we want the tool to be full screen */
}

#editor {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1rem auto;
    max-width: 1500px;
}

#shadows-section {
    flex: 1;
    min-width: 300px;
    padding: 1.5rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 450px;
}

.add-shadow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.add-shadow-header span {
    font-size: 1.1rem;
    color: var(--darker-primary-color);
    font-weight: 500;
}

#add-shadow-button {
    cursor: pointer;
    font-size: 20px;
    padding: 0.3rem 0.6rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

#add-shadow-button:hover {
    background: var(--darker-primary-color);
}

#add-shadow-button:active {
    background: var(--accentuation-color);
}

#shadows-list {
    width: 100%;
}

.shadow {
    border: 1px solid #ddd;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    background: #f9f9f9;
}

.shadow > div {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
}

.shadow label {
    display: inline-block;
    width: 100px; /* Largeur fixe pour aligner les labels */
    font-weight: 500;
    color: var(--darker-primary-color);
    margin-right: 0.5rem;
}

.shadow input[type="range"] {
    flex: 1;
    max-width: 200px;
    margin: 0 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: lightgrey;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.shadow input[type="range"]:hover {
    opacity: 1;
}

.shadow input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--darker-primary-color);
    cursor: pointer;
    border-radius: 50%;
}

.shadow input[type="color"] {
    width: 50px;
    height: 35px;
    padding: 0;
    margin-left: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.shadow .value-display {
    display: inline-block;
    width: 50px; /* Largeur fixe pour aligner les valeurs */
    text-align: right;
    font-size: 0.9rem;
    color: #555;
    margin-left: 0.5rem;
}

.shadow button.remove-shadow {
    display: block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shadow button.remove-shadow:hover {
    background: #cc0000;
}


#preview {
    flex: 1;
    min-width: 300px;
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 400px;
    position: relative;
    height: fit-content;
}

#preview-box {
    width: 150px;
    height: 150px;
    margin: 2rem auto;
    background: var(--primary-color);
    transition: all 0.3s ease;
    max-width: 90%;
    max-height: 80vh;
    position: relative;
    z-index: 1;
    background-size: cover;
    background-position: center;
    border-style: solid; /* Ajoute cette ligne */
    border-width: 0; /* Valeur initiale */
    border-color: #000000; /* Couleur initiale */
    border-radius: 0; /* Rayon initial */
}


#preview::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 4rem);
    height: calc(100% - 4rem);
    background-image:
        linear-gradient(to right, rgba(0.5, 0.5, 0.5, 0.1) 10px, transparent 1px),
        linear-gradient(to bottom, rgba(0.5, 0.5, 0.5, 0.1) 10px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    border-radius: 4px;
}

#css-output {
    margin-top: auto;
    width: 100%;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 6px;
    z-index: 100;
    transform: translateY(2em);
}


#css-output h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--darker-primary-color);
}

#css-code {
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#box-style {
    margin-top: 0;
    padding: 1rem;
    background: white;
    border-radius: 6px;
}

#box-style label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: var(--darker-primary-color);
}

#box-style input[type="range"] {
    width: 95%;
    max-width: 400px;
    margin: 0.5rem 0;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: lightgrey;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#box-style input[type="range"]:hover {
    opacity: 1;
}

#box-style input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--darker-primary-color);
    cursor: pointer;
    border-radius: 50%;
}

#box-style input[type="color"] {
    width: 50px;
    height: 35px;
    padding: 0;
    margin-left: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}













/* Style pour les groupes de paramètres */
.param-group {
    margin-bottom: 1.2rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 6px;
}

.param-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--darker-primary-color);
}

.param-group input[type="range"] {
    width: 100%;
    max-width: 300px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.param-group input[type="color"] {
    width: 50px;
    height: 35px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.param-group span {
    display:none;
    font-size: 0.9rem;
    color: #555;
    vertical-align: middle;
}

.param-group button {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.param-group button:hover {
    background: var(--darker-primary-color);
}





@media (max-width: 725px) {
    #editor {
        flex-direction: column;
    }

    #shadows-section, #preview {
        width: 100%;
        margin: 0 auto;
    }
    
    #box-style {
        margin-top: 1.5rem;
    }
}
