* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: playfair-display;
    src: url(fonts/PlayfairDisplay-VariableFont_wght.ttf);
}

@font-face {
    font-family: open-sans;
    src: url(fonts/OpenSans-VariableFont_wdth\,wght.ttf);
}

:root {
    --bg-color: #f8e7d5;
    --text-color: #190e09;
    --heading-color: #124c15;
    --card-bg-color: #fff8ef;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --card-glow: rgba(18, 76, 21, 0.4);
    --button-active: #9bbf9d;
    --button-text: #190e09;
  }
  
.dark-mode {
    --bg-color: #242120;
    --text-color: #f4e6dd;
    --heading-color: #ffaa75;
    --card-bg-color: #403c38;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --card-glow: rgba(255, 170, 117, 0.4);
    --button-active: #6c5647;
    --button-text: #f4e6dd;
}

#loader {
    border: 5px solid var(--card-bg-color);
    border-radius: 50%;
    border-top: 5px solid var(--heading-color);
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
}
.center {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    font-family: open-sans;
    scroll-behavior: smooth;
}
h1, h2 {
    font-family: playfair-display;
    color: var(--heading-color);
}
h1 {
    font-weight: 400;
    margin-bottom: 1rem;
}
h2 {
    font-weight: 100;
    margin-top: -1rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.7rem;
}

a {
    background-color: var(--card-bg-color);
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 1000px;
    box-shadow: 0 4px 8px var(--card-shadow);
    cursor: pointer;

    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

a#darkModeToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
  }
  
#darkModeToggle svg {
    display: block;
}

nav {
    display: flex;
    justify-content: space-between;
}

.nav-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.3rem;
}
.nav-fixed a {
    background-color: var(--button-active);
    color: var(--button-text);
}

#next-card {
    background-color: var(--heading-color);
    color: var(--bg-color);
    box-shadow: 0 0 8px var(--card-glow);
    font-family: playfair-display;
}

.header {
    margin-top: 2rem;
    font-family: opensans;
}

.footer {
    font-family: playfair-display;
    color: var(--card-bg-color);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.flashcards-container {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.flashcard {
    position: relative;
    perspective: 1000px;
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--card-bg-color);
    box-shadow: 0 4px 8px var(--card-shadow);
    cursor: pointer;

    width: 90%; /* Adjust as needed */
    max-width: 900px; /* Keep max width for larger screens */
    height: 80vh;
}
@media (max-width: 720px) {
.flashcard {
    width: 90vw;
    /* height: 130vw; */
}
}
@media (min-width: 721px) {
.flashcard {
    width: 648px;
    /* height: 400px; */
}
}
@media (min-width: 1001px) {
.flashcard {
    width: 900px;
}
}

.front, .back {
  position: absolute;
  width: 90%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.back {
  transform: rotateY(180deg);
}

.flipped .front {
  transform: rotateY(180deg);
}

.flipped .back {
  transform: rotateY(0deg);
}