.color-option {
    flex: 0 0 auto;
    margin: 0 0.5rem;
}

.color-checkbox {
    display: none;
}

.rounded-circle {
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
}

.selected-indicator {
    display: none;
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: blue;
    justify-content: center;
    align-items: center;
    bottom: -5px;
    right: -5px;
    border: 3px solid blue;
}

.color-option .rounded-circle {
    /* Mantieni le proprietà esistenti */
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
    
    /* effetto lucente */
}

.color-checkbox:checked+.color-label .selected-indicator {
    display: block;
}

.color-checkbox:checked+p {
    font-weight: bold;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 20px;
    margin: 0 auto;
    max-width: 800px;
    padding: 0 10px;
}

.color-item {
    position: relative;
    width: 100%;
    min-width: 10vw;
    max-width: 120px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out forwards;
    animation-fill-mode: both;
}

.color-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-label {
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.selected-indicator {
    display: none;
}

.color-checkbox:checked + .color-label .selected-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Rimuoviamo box-shadow dalla transizione qui, poiché non la controlliamo più da questa regola */
    transition: transform 0.3s ease;
    position: relative; /* Necessario per posizionare correttamente lo pseudo-elemento ::before */
    z-index: 1;       /* Assicura che il color-swatch sia sopra la sua aureola (::before) */
}

/* Nuova regola per l'aureola dietro il color-swatch */
.color-swatch::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Deve corrispondere al border-radius del .color-swatch */
    /* L'aureola: un box-shadow diffuso.
       Colore: bianco panna/avorio (simile a #FFF8EA usato per l'ombra inset).
       Parametri: offset-x | offset-y | blur-radius | spread-radius | color */
    box-shadow: 0 0 18px 6px var(--swatch-base-color);
    z-index: -1; /* Posiziona l'aureola dietro il .color-swatch */
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* L'aureola è invisibile di default */
}

.color-checkbox:checked + .color-label .color-swatch {
    transform: scale(1.1);
}

.color-checkbox:checked + .color-label .color-swatch::before {
    box-shadow: 0 0 28px 10px var(--swatch-base-color);
    opacity: 0.7; /* Rende l'aureola visibile quando selezionato */
}


/* Stagger animation for each color item */
.color-item:nth-of-type(1) { animation-delay: 0.1s; }
.color-item:nth-of-type(2) { animation-delay: 0.2s; }
.color-item:nth-of-type(3) { animation-delay: 0.3s; }
.color-item:nth-of-type(4) { animation-delay: 0.4s; }
.color-item:nth-of-type(5) { animation-delay: 0.5s; }
.color-item:nth-of-type(6) { animation-delay: 0.6s; }
.color-item:nth-of-type(7) { animation-delay: 0.7s; }
.color-item:nth-of-type(8) { animation-delay: 0.8s; }
.color-item:nth-of-type(9) { animation-delay: 0.9s; }
.color-item:nth-of-type(10) { animation-delay: 1.0s; }
.color-item:nth-of-type(11) { animation-delay: 1.1s; }
.color-item:nth-of-type(12) { animation-delay: 1.2s; }

/* Responsive styles */
@media (max-width: 600px) {

    /* Adjust color circle sizes */
    .rounded-circle {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
}

@media(min-width: 768px) {
    p {
        font-size: 1.5rem;
    }
}

@media(min-aspect-ratio: 1/1) {
    .color-item {
        min-width: 1vw;
        width: 100%;
        max-width: 12vh;
    }
    .color-grid {
        margin-top: 2rem;
        height: 40vh;
    }

    #mascotte-div {
        width: 80% !important;
    }
}