/* Estilos de cada tarjeta (forma base, se sobrescribe por ID) */
.card {
    background: linear-gradient(145deg, var(--main-color), var(--main-color-darker));
    color: white;
    width: 300px;
    height: 200px;
    place-content: center;
    padding: 1.5rem;
    box-shadow: 0 0px 15px var(--main-color-darker, 0.2);
    transition: border-radius 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.card {
    &.card1 {
        border-radius: 30% 70% 60% 40% / 70% 40% 60% 30%;
    }

    &.card2 {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    &.card3 {
        border-radius: 30% 70% 60% 40% / 70% 40% 60% 30%;
    }

    &.card4 {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}
.card h3 {
    color: white;
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    margin: 1rem 0;
    font-size: 1.25rem;
    user-select: none;
}

/* Contenido extra oculto, aparece al hacer hover */
.card .extra-content {
    font-size: 0.9rem;
    opacity: 0;
    max-height: 0px;
    transition: opacity 1s ease, max-height 1s ease;
    text-align: center;
    user-select: none;
}
.card.open .content::-webkit-scrollbar {
    display: none;
  }
.card.open .content{
    max-height: 95%;
    overflow: scroll;
}

body.modal-open {
    overflow: hidden;
}

@media (hover: hover) {
    .card:has(.content:hover):not(.open) , .card.opening{
        &.card1 {
            border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        }
        
        &.card2 {
            border-radius: 30% 70% 60% 40% / 70% 40% 60% 30%;
        }
        
        &.card3 {
            border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        }
        
        &.card4 {
            border-radius: 30% 70% 60% 40% / 70% 40% 60% 30%;
        }
        box-shadow: 0 0px 30px var(--main-color-darker, 0.3);
        transition: border-radius 0.3 ease,
        box-shadow 0.6s ease;
    }
    .card:not(.open) .content:hover .extra-content , .card.opening .extra-content {
        opacity: 1;
        max-height: 150px;
    }
    .card:hover:not(.open) .first-content, .card.opening:not(.open) .first-content {
        opacity: 0;
        max-height: 0px;
        margin-top: 0.8rem;
        transition: opacity 0.8s ease, max-height 0.8s ease;
    }
}


/* Contenido extra oculto, aparece al hacer hover */
.card .first-content {
    font-size: 2rem;
    opacity: 1;
    max-height: 50px;
    transition: opacity 0.6s ease, max-height 0.6s ease;
    text-align: center;
    user-select: none;
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    color: black;
    transition: background 0.3s ease;
}

@media (max-width: 768px) {
    .card.open {
        width: 95vw;
        height: 90vh;
        padding: 1rem;
    }

    .extra-modal {
        padding: 1rem;
        font-size: 0.95rem;
    }
}

.extra-modal {
    display: flex;
    color: white;
    opacity: 1;
    max-width: 800px;
    margin: 0 auto;
    max-height: 70vh;
    transition: opacity 1s ease, max-height 1s ease;
    flex-direction: column;
}

/* Centramos el contenido dentro del modal */
.card.open {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    border-radius: 20px;
}

/* Ajuste en pantallas pequeñas */
@media (max-width: 768px) {
    .extra-modal {
        padding: 1rem;
        max-width: 95%;
        font-size: 0.95rem;
    }

    .card.open {
        padding: 1rem;
    }
}

.close {
    display: flex;
    max-height: 0px;
    opacity: 0;
    padding:0px;
    transition: opacity 0.4s ease, max-height 0.4s ease;
}

.card:has(.open) {
    .extra-modal {
        display: flex;
        width: 100%;
    }
}