/* Grundlegendes Layout und Farbschema */
* {
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  background: linear-gradient(to right, #663573, #225668 );
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: linear-gradient(45deg, #663573, #225668, #6643a7);
  background-size: 300% 300%;
  animation: gradientAnimation 20s infinite;
}
@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
footer {
  margin-top: 5%;
}
h1 {
  font-size: 2.5rem;
  margin: 1rem 0;
  color: #e3ecf6;
}
h3 {
  font-size: 1.2rem;
  margin: 1rem 0;
  color: #dfebee;
}
#otherPageBtn {
  top: 8%;
  left: 50%;
  padding: 11px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: rgba(183, 135, 93, 0.01);
  color: white;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  margin-top: 2%;
}
#otherPageBtn:hover {
  background-color: #d79a48;
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#otherPageBtn:active {
  background-color: #d79a48;
  transform: scale(1);
}
/* Karten-Design */
.card {
  width: 90%;
  max-width: 200px;
  height: min-content;
  transition: all .3s;
  position: relative;
  border-radius: .5rem 2rem;
  box-shadow: 0px 15px 20px -5px rgba(0, 0, 0, 0.5);
}

.card:hover {
  transform: scale(1.03);
}

/* Beschreibung */
.description {
  position: absolute;
  bottom: .5rem;
  left: .5rem;
  text-align: start;
  padding: .5rem 1em;
  width: 90%;
  transition: all 0.5s ease;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(.1rem);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: .5rem 2rem;
}

.description:hover {
  transform: perspective(100px) translateX(7px) rotateX(3deg) rotateY(3deg) scale(1);
  box-shadow: none;
}

/* Header */
header {
  padding: 1rem;
  color: rgb(169, 186, 247);
}

/* Suchfeld */
#searchInput {
  padding: 0.5rem;
  border-radius: 5px;
  border: none;
  margin-top: 1rem;
  width: 80%;
  max-width: 300px;
  background: linear-gradient(135deg, #292941, #494975);
  color: white;
  font-size: 1rem;
  box-shadow: 0 0 5px #fff;
}

/* Quiz-Container */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
  width: 100%;
}

/* Kategorien */
.category {
  width: 100%;
}

.category h2 {
  color: #d1daec;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Flexbox für Karten */
.quiz-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2% 4%;
}

/* Karten-Design */
.quiz-card {
  width: 90%;
  max-width: 220px;
  height: 250px;
  perspective: 1000px;
  cursor: pointer;
}

.quiz-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.quiz-card:hover .quiz-card-inner {
  transform: rotateY(180deg);
}

.quiz-card-front, .quiz-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
}

.quiz-card-front {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.quiz-card-back {
  background: rgba(75, 12, 78, 0.1);
  color: white;
  transform: rotateY(180deg);
  padding: 1rem;
}


/* Modal für Quiz-Vorschau */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #444;
  padding: 2rem;
  text-align: center;
  border-radius: 10px;
}

/* Buttons */
button {
  padding: 0.8rem 1.5rem;
  border: none;
  background-color: #800080;
  color: white;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 1rem;
}

button:hover {
  background-color: #5e006d;
}

@media (max-width: 768px) {
  #searchInput {
    width: 90%;
  }

  .quiz-cards {
    flex-direction: column;
    align-items: center;
  }

  .quiz-card {
    width: 100%;
    max-width: 180px;
    height: 220px;
  }

  .quiz-container {
    padding: 1rem;
  }

  .category h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
  }

  .quiz-container {
    padding: 0.5rem;
  }

  .quiz-card {
    max-width: 160px;
    height: 200px;
  }

  .quiz-card-front, .quiz-card-back {
    font-size: 0.9rem;
  }

  .category h2 {
    font-size: 1.1rem;
  }

  #searchInput {
    width: 95%;
    font-size: 0.9rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
}