body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styles for Study Mode */
body.study-mode .container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-top: 120px; /* Adjust padding as needed */
}

body.study-mode .flashcard {
    width: 60%;
    max-width: 800px;
    height: auto;
    min-height: 300px;
    font-size: 24px;
    flex-direction: column;
    padding: 40px;
}

body.study-mode .flashcard .front {
    flex-direction: column;
    text-align: center;
}

body.dark-mode.study-mode #card-counter {
    color: #e0e0e0;
}

.separator {
    border: none;            /* Remove default borders */
    border-top: 1px solid #ccc;  /* Add a custom top border */
    margin: 20px 0;          /* Add vertical spacing */
    width: 50%;             /* Ensure it spans the full width */
}

#card-counter {
    position: fixed;
    top: 10px;
    right: 20px;
    font-size: 20px;
    z-index: 1002;
    margin: 28px 25px 25px auto;
    width: auto;
    padding: 10px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
}

/* Fling animation for study mode */
body.study-mode .flashcard.fling {
    animation: fling 0.4s forwards;
}

@keyframes fling {
    from {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    to {
        transform: translateX(33vw) rotate(180deg);
        opacity: 0;
    }
}
 /* done */
 

#topbar {
    width: 100%;
    color: white;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1001;
}

#button-container {
    float: left;
    display: flex;
    align-items: center;
    padding-left: 25px;
}

#menu-button {
    height: 50px;
    width: 50px;
    background-color: #007bff;
    cursor: pointer;
    padding: 10px;
    margin-right: 10px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    color: white;
    pointer-events: all;
}

#limit-cards-number {
    width: 60px;
    padding: 5px;
    margin-left: 10px;
}

.bar-button {
    height: 50px;
    width: 50px;
    margin-right: 10px;
    cursor: pointer;
    padding: 10px;
    border: none;
    background-color: #007bff;
    color: white;
    font-size: 10px;
    border-radius: 50px;
    pointer-events: all;
}

.bar-button:hover {
    background-color: #0056b3;
}

#score-container {
    margin: 28px 25px 25px auto;
    width: auto;
    padding: 10px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    visibility: hidden;
}

.no-pointer-events {
    pointer-events: none;
}

#toggle-container {
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid #ccc;
    background-color: white;
    padding-top: 95px;
    min-width: 285px;
    width: auto;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.1s ease;
    visibility: hidden;
}

#toggle-container.show {
    transform: translateX(0);
    visibility: visible;
}

.toggle-option {
    display: block;
    margin: 10px 20px 10px 35px;
    font-size: 15px;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 95%;
    max-width: 1400px;
    padding-top: 95px;
    padding-bottom: 20px;
}

.flashcard {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    font-size: 18px;
    word-wrap: anywhere;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.6s, background-color 300ms; /* Add background-color transition */
    transform-style: preserve-3d;
    height: 150px;
    min-width: 225px;
}


.flashcard.flip {
    transform: rotateY(180deg);
}

.flashcard.fade-out {
    opacity: 0;
    transition: opacity 500ms ease-out;
}


.flashcard .front, .flashcard .back {
    backface-visibility: hidden;
    transform: rotateX(0deg);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.flashcard .back {
    transform: rotateY(180deg);
}

.flashcard input {
    width: 80%;
    padding: 5px;
    margin-top: 10px;
    text-align: center;
    cursor: text;
    border:1px solid #989898;
    border-radius: 5px;
}

.flashcard input:focus {
    outline: none !important;
    border:1px solid #007bff;
    box-shadow: 0 0 2px #007bff;
}

.flashcard.selected {
    border: 2px solid #007bff; /* Highlight selected cards */
}

.flashcard.correct {
    background-color: #d4edda;
}

.flashcard.incorrect {
    background-color: #ffb4b4;
}

/* Styles specific to Match Mode */
.container.match-mode .flashcard {
    transition: transform 0.6s, background-color 300ms;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.container.match-mode .flashcard .front,
.container.match-mode .flashcard .back {
    backface-visibility: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
}

.container.match-mode .flashcard .front {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.container.match-mode .flashcard .front div {
    font-size: 20px;
    font-weight: bold;
}

.container.match-mode .flashcard .back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.container.match-mode .flashcard.flipped {
    transform: rotateY(180deg);
}

.container.match-mode .flashcard.flipped .front {
    display: none;
}

.container.match-mode .flashcard.flipped .back {
    display: flex;
}

.container.match-mode .flashcard.correct {
    background-color: #d4edda; /* Green for correct */
}

.container.match-mode .flashcard.incorrect {
    background-color: #ffb4b4; /* Red for incorrect */
}

.container.match-mode .separator {
    border: none;
    border-top: 1px solid #ccc;
    width: 100%;
}

/* Import dialogue style */

.url-dialog {
    display: none;
    position: fixed;
    bottom: 0px;
    width: 100%;
    height: 50px;
    background: #fff;
    padding-top: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-weight: bold;
    align-content: center;
    z-index: 1000;
    background-color: #d4edda;
}

#generated-url {
    display: inline;
    margin: 0px;
    padding: 0px;
    text-decoration: none;
}

#close-url-button {
    display: inline;
    float: right;
    background: none;
    border: none;
    margin: -3px 10px 0px 0px;
    padding: 0px;
    cursor: pointer;
    font-size: 20px;
}


/* Dark mode styles for Match Mode */
body.dark-mode .container.match-mode .flashcard {
    background: #333;
    border-color: #555;
    color: white;
}

body.dark-mode .container.match-mode .flashcard.correct {
    background-color: #375437;
}

body.dark-mode .container.match-mode .flashcard.incorrect {
    background-color: #592e2e;
}

#message {
    display: none;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-size: 17px;
    margin-bottom: 20px;
    margin-top: 90px;
    max-width: 1200px;
}

#about, #hints {
    width: 100%;
    font-size: 14px;
    text-align: left;
}

/* Dark mode, because my eyes need a break */
body.dark-mode {
    background-color: #181818;
    color: #e0e0e0;
}

body.dark-mode a {
    color:#3e9afd
}

body.dark-mode #toggle-container {
    background-color: #282828;
    border-color: #333;
}

body.dark-mode #menu-button,
body.dark-mode .bar-button,
body.dark-mode  #card-counter,
body.dark-mode #score-container{
    background-color: #333;
    color: white;
    border: 1px solid grey;
}

body.dark-mode .flashcard {
    background: #333;
    border-color: #555;
}

body.dark-mode .flashcard.selected {
    border: 2px solid #3e9afd;
}

body.dark-mode #close-url-button {
    color: white;
}

body.dark-mode .flashcard.correct {
    background-color: #375437;
}

body.dark-mode .flashcard.incorrect {
    background-color: #592e2e;
}

body.dark-mode #message {
    background-color: #282828;
    border-color: #555;
}

/* Styles for inputs, checkboxes, and radio buttons */

body.dark-mode input:focus {
    outline: none !important;
    border:1px solid #7a7a7a;
    box-shadow: 0 0 5px #7a7a7a;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
    background-color: #565555;
    border: 1px solid #7a7a7a;
    color: white;
}

body.dark-mode input[type="text"]::placeholder {
    color: #bbb;
}

body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
    accent-color: #565555; /* Customize this to your preferred accent color */
}


body.dark-mode input[type="checkbox"]:checked,
body.dark-mode input[type="radio"]:checked {
    background-color: #565555;
}

body.dark-mode .toggle-option {
    color: #e0e0e0;
}

body.dark-mode .url-dialog{
    background-color: #0b0b0b;
    color: white;
}

/* Media query for mobile devices */
@media (max-width: 999px) {

    .flashcard {
        width: 90%; /* Take up all available width */
        height: 150px; /* Adjust height if needed */
    }

    #message {
        padding: 20px;
        margin-top: 90px;
    }
}

/* Media query for mobile devices */
@media (max-width: 675px) {
    .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px;
        padding-top: 70px;
    }

    #button-container {
        padding: 5px 0px 5px 15px;
    }

    #toggle-container {
        min-width: 260px;
    }

    #score-container {
        margin: 16px 15px 15px auto;
    }


    .flashcard {
        width: 90%; /* Take up all available width */
        height: 150px; /* Adjust height if needed */
    }

    #message {
        padding: 20px;
        margin-top: 70px;
    }
}
