:root {
    --primary: #b84f4f;
    --accent: #c6f000;
    --background-dark: #f4f4f4;
    --text-light: #ffffff;
    --neutral-dark: #333333;
    --verde-oscuro: #4CAF50;
    --conchovino-oscuro: #890909;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;


    background-color: #615555;
}

h1 {
    color: var(--primary);
    font-size: 2.5rem;

}

.font-white {
    color: white;
}


h2,
h3 {
    color: var(--primary);
}






input,
button {
    margin: 5px 0;
    padding: 5px;
    width: 80%;
    box-sizing: border-box;
}

input {
    margin: 0 !important;
}


button {
    background-color: var(--primary);


    color: var(--text-light);
    border: none;
    padding: 1rem;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    transition: background 0.3s;
}

button:hover {
    background-color: #890909;
}

textarea {
    width: 80%;
    height: 150px;
    border: 2px solid #bd1212;
    border-radius: 8px;
    /* padding: 1rem; */
    font-size: 1rem;
    color: var(--neutral-dark);
    background: #e8d6d6;
}

textarea p {
    color: black;
}

@media (max-width: 600px) {
    textarea {
        width: 90%;
    }
}





ul {
    padding: 0;
    list-style-type: none;


}



#main-page,
#quiz-page,
#crossword-page,
#flashcard-page {
    width: 100%;
    /* max-width: 8px; */
    text-align: center;
    /* Center text and elements inside */
    /* padding: 20px; */
    background: white;
    /* Optional: white background for content */
    /* border-radius: 10px; */
    /* Optional: rounded corners */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    /* Optional: subtle shadow */
    background-color: #dbadad;
}



/* FLASHCARDS */

#flashcard-container {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;


}


.flashcard {
    /* perspective: 1000px; */
    width: 200px;
    height: 150px;
    margin: 20px auto;
    position: relative;
    cursor: pointer;
    font-size: 20px;



}

.flashcard-inner {
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;

}

.flipped .flashcard-inner {
    transform: rotateY(180deg);
}


.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
    -webkit-box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);

}

.flashcard-front {
    background-color: #e8d6d6;
    ;
    color: black;
}



.flashcard-back {
    background-color: var(--primary);
    transform: rotateY(180deg);
    color: white;
}

.flashcard-back span {
    margin: 0 !important;
}

.flashcard-front span {
    margin: 0 !important;
}

.hidden {
    display: none;
}


.vocab-list-container ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;

}

.vocab-list {
    padding: 1rem;
}

.vocab-list-container ul li {
    background-color: #e8d6d6;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    margin: 5px 0;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    width: 200px;
    height: 200px;
    font-size: 18px;
    border-radius: 10%;
    box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
    -webkit-box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);


}

.pronounce-btn-flashcards {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    padding: 0;
    max-width: 40%;
    margin-top: 20px;
    /* border: solid black 1px; */
    /* background-color: rgb(255, 255, 255); */
}




.container-games {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    width: 80%;
    margin: 0 auto;
    gap: 20px;
}


footer {
    margin-top: 100px;
}


.languages-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    background-color: var(--primary);
    height: 30px;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 100%;

}

.languages-container a {
    text-decoration: none;
    color: white;
}



/* Quiz */

#quiz-next-btn {
    background-color: #12bd62;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
    -webkit-box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: -2px 7px 10px -5px rgba(0, 0, 0, 0.75);
}

#quiz-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#quiz-options button {

    max-width: 40%;
    margin: 0 auto;
    margin-bottom: 20px;
    font-size: 20px;
}


#quiz-question {
    color: black;
    font-size: 25px;
    margin-bottom: 30px;

}

.quiz-word {
    color: var(--conchovino-oscuro);
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    animation: slide-in 0.5s ease-out;
}

@keyframes slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.modal-btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    margin-top: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.modal-btn:hover {
    background-color: #45a049;
}














@media only screen and (min-width: 600px) {
    .container-games {
        flex-direction: row;
        gap: 10px;
    }
}

#end-quiz-btn {
    max-width: 40% !important;
    margin: 0 auto;
    margin-top: 50px;
    background-color: #890909;
    border-radius: 20px;
}

/* Crossword */

.crossword-grid td {
    width: 30px;
    height: 30px;
    border: 1px solid #333;
    text-align: center;
}

.active-cell input {
    width: 100%;
    height: 100%;
    text-align: center;
    border: none;
    font-size: 18px;
}

.inactive-cell {
    background-color: #333;
}

.crossword-grid {
    margin: 0 auto;
    border: 2px solid var(--primary);
    border-radius: 5px;
    /* width: 700px; */
    max-width: 80%;
    border-collapse: separate;
}


.active-cell input {
    font-size: 15px;
}

.clue-number {
    font-size: 10px;
}

#crossword-clues {
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
    color: white;
}

@media (min-width: 1024px) {

    .crossword-grid {
        margin: 0 auto;
        border: 2px solid var(--primary);
        border-radius: 5px;
        width: 700px;
        max-width: 80%;
        border-collapse: separate;
    }

}

#crossword-page {
    padding: 0 !important;
}

@media (min-width: 1024px) {
    /* #crossword-clues {
        position: absolute;
        top: 50%;
        right: 60%;
        transform: translateX(-50%);
        font-size: 20px;
    } */


    .active-cell input {
        font-size: 30px;
    }

    #main-page,
    #quiz-page,
    #crossword-page,
    #flashcard-page {

        padding: 20px;

    }

    .clue-number {
        font-size: 20px;
    }


}


.correct-letter {
    background-color: #4CAF50;
    color: #fff;
}

.incorrect-letter {
    background-color: #890909;
    color: #fff;
}

/* Layout for crossword grid and clues */
#crossword-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

#crossword-clues {
    max-width: 300px;
    color: black;
}

#crossword-clues div {
    background-color: #e8d6d6;
    padding: 5px 8px;
    margin-bottom: 5px;
    border-radius: 5px;

}

@media (min-width: 768px) {
    #crossword-wrapper {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
    }

    #crossword-container {
        margin-right: 20px;
    }

    .languages-container {

        max-width: 80%;

    }


    input {
        /* margin: 5px 0; */
        padding: 10px;
        /* width: 80%;
    box-sizing: border-box; */
    }
}

#check-crossword-btn {
    margin-top: 20px !important;
}


#niveles-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    /* flex-wrap: wrap; */
    /* Opcional: permite que los botones bajen si hay muchos */
    gap: 8px;
    /* Espacio entre botones */
    margin-bottom: 16px;
    width: 200px;
    /* Espacio abajo del grupo de botones */
}

#niveles-container button {
    /* Opcional: mejora el estilo de los botones */
    padding: 10px 18px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #aaa;
    background: #bd1212;
    cursor: pointer;
    transition: background 0.2s;
}

#niveles-container button:hover {
    background: #840d0d;
}

#categorias-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0 auto 16px auto;
    width: 200px;
    max-width: 40%;
    flex-wrap: wrap;
    /* Permite que bajen si hay muchas */
}

#categorias-container button {
    padding: 9px 16px;
    font-size: 0.98rem;
    border-radius: 7px;
    border: 1px solid #bd1212;
    background: #fff5f5;
    color: #bd1212;
    cursor: pointer;
    margin-bottom: 4px;
    box-shadow: 1px 2px 6px rgba(189, 18, 18, 0.07);
    transition: background 0.2s, color 0.2s;
}

#categorias-container button:hover,
#categorias-container button.active {
    background: #bd1212;
    color: #fff;
}


#vocabulario-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px auto 0 auto;
    width: 90%;
    max-width: 95%;
    /* background: #d56641; */
    border: #000 solid 1px;

    border-radius: 16px;
    box-shadow: 0 2px 10px 0 rgba(189, 18, 18, 0.08);
    padding: 18px 16px;
    margin-bottom: 30px;
}

#vocabulario-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
    /* width: 80%; */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    /* max-width: 600px; */
    flex-wrap: wrap;
    gap: 5px;

}

#vocabulario-container li {
    /* background: #2dc98b; */
    margin-bottom: 10px;
    border-radius: 8px;
    border: #000 solid 1px;
    box-shadow: 0 1px 6px 0 rgba(189, 18, 18, 0.08);
    padding: 10px 14px;
    font-size: 1rem;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;


}

#vocabulario-container li:last-child {
    margin-bottom: 0;
}

#copiar-vocabulario-btn {
    width: 200px;
}

.contenedor-idiomas-copiar {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0 auto 16px auto;
    width: 200px;
    max-width: 40%;
    flex-wrap: wrap;
    /* Permite que bajen si hay muchas */
}



/* *Botones edicion y eliminacion vocab */


.edit-vocab-btn-flashcard {
    position: absolute;
    top: 10px;
    left: 10px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #b84f4f;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 5px;
    width: 28px;
    height: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.delete-vocab-btn-flashcard {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #e55555;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 5px;
    width: 28px;
    height: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.edit-vocab-btn-flashcard:hover,
.edit-vocab-btn-flashcard:focus {
    background: #fbecec;
    color: #890909;
}

.delete-vocab-btn-flashcard:hover,
.delete-vocab-btn-flashcard:focus {
    background: #fae5e5;
    color: #bd1212;
}

.flashcard-back {
    position: relative;
}




.vocab-btn-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    /* o el espacio que prefieras entre los botones */
    margin-top: 10px;
}





.edit-vocab-btn,
.delete-vocab-btn {
    background: transparent;
    border: none;
    /* border-radius: 50%; */
    font-size: 1.25rem;
    cursor: pointer;
    padding: 2px 5px;
    width: 28px;
    height: 28px;
    margin: 8px 2px 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    vertical-align: top;
}

.edit-vocab-btn {
    color: #b84f4f;
}

.delete-vocab-btn {
    color: #e55555;
}

.edit-vocab-btn:hover,
.edit-vocab-btn:focus {
    background: #fbecec;
    color: #890909;
}

.delete-vocab-btn:hover,
.delete-vocab-btn:focus {
    background: #fae5e5;
    color: #bd1212;
}

#vocabulary-list li {
    font-size: 1.35rem;

    text-align: center;
}




.vocab-btn-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    /* o el espacio que prefieras */
    margin-top: 10px;
}


.pronounce-btn-vocabylary-list {
    background: transparent;
    border: none;
    /* border-radius: 50%; */
    color: #333;
    font-size: 1.25rem;
    padding: 2px 5px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;

    font-size: 1.25rem;
    line-height: 1;
    /* padding: 0; */
    margin: 0;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

.pronounce-btn-vocabylary-list:hover {
    background: #eee;
    color: #b84f4f;
}

.cleared-ok {
    /* background: #bbf5d1 !important; */
    color: #148c42 !important;
    border-color: #7bddb7 !important;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.clue-completed {
    text-decoration: line-through;
    color: #aaa;
    transition: color 0.2s;
}


#flip-all-btn {
    background-color: #b84f4f;
    border: none;
    color: white;
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#flip-all-btn:hover {
    background-color: #890909;
}