/* Container for the entire flashcard section */
.flashcard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Styling for the title */
.flashcard-container h1 {
    font-size: 2em;
    margin-bottom: 20px;
    margin-top: 10%;
}

.deck_name {
    color: #092540;
    font-size: 35px;
}

/* Grid for flashcards */
.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px; /* Space between the flashcards */
    width: 95%;
    max-width: 1200px; /* Set max width for the grid */
    margin-top: 5%;
}

/* Flashcard styling */
.flashcard {
    position: relative; /* Ensure the delete button stays in the corner */
    width: 100%; /* Let the grid handle the sizing */
    height: 200px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Flashcard front and back styling */
.flashcard-front, .flashcard-back {
    font-size: 16px;
}

.flashcard-front {
    font-weight: bold;
}

.flashcard-back {
    margin-top: 10px;
}

/* Styling for the Add Flashcard button */
#addFlashcardButton {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    background: rgb(99, 85, 218);
    width: 200px;
    height: 40px; 
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease-in-out;
    margin-top: 5%;
    margin-bottom: 5%;
}

#addFlashcardButton:hover {
    background: rgb(99, 85, 218, 0.85);
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(9, 37, 64, 0.4); /* Black w/ opacity */
    z-index: 99;
}

.modal-content {
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    text-align: left;
    background-color: #fefefe;
    border: 1px solid #092540;
    border-radius: 10px;
}

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

.close:hover, .close:focus, .delete-flashcard:hover, .delete-flashcard:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content form {
    display: flex;
    flex-direction: column;
}

.modal-content label {
    margin-top: 10px;
}

.modal-content textarea {
    width: 100%;
    height: 100px;
    margin-top: 5px;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    resize: none;
    outline: none;
}

.modal-content button {
    margin-top: 20px;
    padding: 10px 15px;
    background-color: rgb(99, 85, 218);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background .2s ease-in-out;
    width: 100%;
    height: 40px;
}

.modal-content button:hover {
    background: rgb(99, 85, 218, 0.85);
}

/* Delete button styles */
.delete-flashcard {
    position: absolute;
    top: 5px;
    right: 10px;
    color:#092540;
    border-radius: 5px;
    border: 1px solid rgba(9, 37, 64, 0.5);
    width: 25px;
    height: 25px;
    background-color: white;
    transition: background-color .2s ease-in-out;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
}

.delete-flashcard:hover {
    background-color: rgba(9, 37, 64, 0.25);
}

@media (max-width: 800px) {
    .flashcard-container {
        margin-top: 10%;
    }
}

@media (max-width: 500px) {
    .flashcard-container {
        margin-top: 20%;
    }
}
