/* ==========================
   GLOBAL RESET & BASE
========================== */
body {
  font-family: 'Quicksand', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}

/* ==========================
   FLASHCARD CONTAINER
========================== */
#flashcard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

/* ==========================
   FLASHCARD STRUCTURE
========================== */
.flashcard {
  width: 100%;
  max-width: 1024px;
  height: 450px;
  margin: 20px 0;
  position: relative;
  perspective: 1000px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
  position: relative;
}

.flashcard-inner.flipped {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: auto;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
}

.flashcard-front {
  background: #fff;
  color: #000;
}

.flashcard-back {
  background: #e0e0e0;
  color: #000;
  transform: rotateY(180deg);
}

/* ==========================
   QUESTION AND IMAGE
========================== */
.flashcard-question {
  font-size: 18px;
  margin-bottom: 15px;
  color: #222;
  width: 100%;
}

.flashcard-image {
  width: 100%;
  margin-top: 10px;
}

.flashcard-image img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* ==========================
   CONTROLS
========================== */
.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.controls button {
  background: #2c3e50;
  color: #fff;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.controls button:hover {
  background: #34495e;
}

:fullscreen .controls,
:-webkit-full-screen .controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================
   FULLSCREEN ADJUSTMENTS
========================== */
:fullscreen .flashcard,
:-webkit-full-screen .flashcard {
  width: 100vw;
  height: 100vh;
  font-size: 24px;
}

/* Hide Google Ads in fullscreen */
:fullscreen .adsbygoogle,
:-webkit-full-screen .adsbygoogle {
  display: none !important;
}

/* ==========================
   FLASHCARD SET GRID
========================== */
.flashcard-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

.flashcard-set-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.flashcard-set-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.flashcard-set-item h4 {
  font-size: 16px;
  margin-bottom: 10px;
}

.view-set {
  background: #007BFF;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

.view-set:hover {
  background: #0056b3;
}

/* ==========================
   FLASHCARD CATEGORY GRID
========================== */
.flashcard-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 20px;
}

.flashcard-category-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.flashcard-category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.flashcard-category-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.flashcard-category-card p {
  font-size: 14px;
  color: #666;
}

/* ==========================
   PAGINATION
========================== */
.pagination ul {
  display: flex;
  gap: 10px;
  justify-content: center;
  list-style: none;
  padding: 0;
}

.pagination li a,
.pagination li span {
  padding: 8px 14px;
  font-size: 15px;
  border: 1px solid #007bff;
  color: #007bff;
  border-radius: 5px;
  text-decoration: none;
  transition: 0.3s;
}

.pagination li span.current,
.pagination li a:hover {
  background: #007bff;
  color: #fff;
}

/* ==========================
   RESPONSIVE DESIGN
========================== */
@media (max-width: 1024px) {
  .flashcard {
    height: 400px;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .flashcard {
    height: 350px;
    padding: 18px;
  }

  .flashcard-front,
  .flashcard-back {
    font-size: 16px;
    padding: 20px;
  }

  .controls button {
    font-size: 14px;
    padding: 8px 16px;
  }

  .flashcard-set-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .flashcard {
    height: 320px;
    padding: 15px;
  }

  .flashcard-front,
  .flashcard-back {
    font-size: 16px;
  }

  .flashcard-question {
    font-size: 18px;
  }
}
