/* Dodaj na początek pliku */
:root {
  --bg-color: #f8f9fa;
  --text-color: #1d1d1f;
  --card-bg: white;
  --header-gradient: linear-gradient(135deg, #8e2de2, #4a00e0, #ff6b6b, #ffa3a3);
  --selection-bg: #202020;
  --selection-text: #e0e0e0;
  --border-gradient: linear-gradient(135deg, #ff6b6b, #8e2de2, #4a00e0);
}

[data-theme="dark"] {
  --bg-color: #202020;
  --text-color: #f0f0f0;
  --card-bg: #282828;
  --header-gradient: linear-gradient(135deg, #4a00e0, #2d00a0, #8e2de2);
  --selection-bg: #282828;
  --selection-text: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  text-align: center;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--header-gradient);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Selection boxes */
.selection > div {
  background: var(--selection-bg);
  padding: 20px;
  border-radius: 18px;
  margin: 10px;
  width: 200px;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.selection > div::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--border-gradient);
  border-radius: 18px;
  z-index: -1;
}

.selection h2 {
  color: var(--selection-text);
  margin-bottom: 15px;
}

/* Responsive images */
#flashcard img, #quiz-image {
  width: 100%;
  max-width: 250px;
  height: 180px;
  object-fit: contain;
  margin: 15px auto;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 20px auto;
  }

  .selection {
    flex-direction: column;
    align-items: center;
  }

  .flashcard {
    width: 90%;
    height: auto;
    min-height: 400px;
  }

  .header-container {
    padding: 20px;
    margin-bottom: 20px;
  }
}

/* Reszta istniejących styli pozostaje bez zmian */
/* Zmiana w sekcji body */
body {
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-color);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="3" fill="%231d1d1f" opacity="0.1"/><circle cx="80" cy="30" r="4" fill="%231d1d1f" opacity="0.1"/><circle cx="50" cy="70" r="5" fill="%231d1d1f" opacity="0.1"/></svg>');
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text-color);
}

[data-theme="dark"] body {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="3" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="30" r="4" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="70" r="5" fill="%23ffffff" opacity="0.1"/></svg>');
}

/* Reszta styli pozostaje bez zmian */

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.header-container {
  background: var(--header-gradient);
  background-size: 300% 300%;
  animation: gradientBG 8s ease infinite;
  padding: 30px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(142, 45, 226, 0.3);
  color: white;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.header-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

h1 {
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="3" fill="%23ff7675" opacity="0.2"/><circle cx="80" cy="30" r="4" fill="%2374b9ff" opacity="0.2"/><circle cx="50" cy="70" r="5" fill="%2355efc4" opacity="0.2"/></svg>');
  z-index: -1;
}

/* Zastąp lub uzupełnij istniejącą sekcję .back-button */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #0071e3;
  transition: transform 0.3s;
  z-index: 1000; /* dzięki temu jest zawsze nad innymi elementami */
}

/* Hover efekt pozostaje taki sam */
.back-button:hover {
  transform: translateX(-5px);
}

/* W ciemnym motywie zmień kolor strzałki */
[data-theme="dark"] .back-button {
  color: #4aa8ff;
}

/* Jeśli chcesz, aby na bardzo małych ekranach (np. < 480px)
   przycisk był nieco mniejszy, możesz dodać: */
@media (max-width: 480px) {
  .back-button {
    font-size: 20px;
    top: 15px;
    left: 15px;
  }
}


.container {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}

h1, h2 {
  font-weight: 500;
  color: var(--text-color);
}

/* ---- Flashcard: większa wysokość, perspektywa, responsywność ---- */
.flashcard {
  width: 100%;
  max-width: 350px;
  height: 500px;         /* ↑ wcześniej było 400px, teraz 450px */
  margin: 30px auto;
  perspective: 1000px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: var(--card-bg);
}

/* Przód i tył karty */
.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  box-sizing: border-box;
  background: var(--card-bg);
  border-radius: 18px;
}

.flashcard-back {
  transform: rotateY(180deg);
  background: var(--bg-color);
}

/* Klasa, która odwraca cały kontener .flashcard-inner */
.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

/* Dodatkowe wyrównanie obrazka w karcie (opcjonalne) */
.flashcard-face img {
  width: 100%;
  max-width: 250px;
  height: 180px;
  object-fit: contain;
  margin: 15px 0;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}



.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

button {
  background: #0071e3;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: #0077ed;
  transform: scale(1.02);
}

button:active {
  transform: scale(0.98);
}

#play-audio {
  background: #34c759;
  margin-top: 15px;
}

.progress-counter {
  font-size: 14px;
  color: #86868b;
  margin-bottom: 20px;
}

.selection {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
}

.selection a {
  display: inline-block;
  margin: 10px;
  padding: 12px 24px;
  background: #0071e3;
  color: white;
  text-decoration: none;
  border-radius: 24px;
  transition: all 0.2s;
}

.selection a:hover {
  background: #0077ed;
  transform: translateY(-2px);
}

#quiz-container {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 500px;
  margin: 0 auto;
}

.option-btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  text-align: center;
}

#feedback {
  margin: 20px 0;
  font-size: 18px;
}

/* Dark theme adjustments for content boxes */
[data-theme="dark"] .card-face {
  background: #282828;
  color: #f0f0f0;
}

[data-theme="dark"] .flashcard-back {
  background: #202020;
}

[data-theme="dark"] #quiz-container {
  background: #282828;
  color: #f0f0f0;
}

[data-theme="dark"] .selection > div {
  background: #383838;
}

[data-theme="dark"] .selection h2 {
  color: #ffffff;
}

[data-theme="dark"] body {
  background: #202020;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="3" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="30" r="4" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="70" r="5" fill="%23ffffff" opacity="0.1"/></svg>');
}
/* 1) Upewnij się, że .site-footer zawsze ma width:100% */
.site-footer {
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  background: var(--card-bg);
  color: var(--text-color);
  padding: 20px;
  text-align: center;
  font-size: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

/* 2) Na mobilkach (<768px) – pozycja statyczna i pełna szerokość */
@media (max-width: 767px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0; /* usuń padding-bottom, żeby nic nie przesuwało stopki */
  }
  .site-content {
    flex: 1;
  }
  .site-footer {
    position: static;
    width: 100%; /* na pewno cała szerokość */
    left: 0;
    bottom: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
  }
}

/* 3) Na desktopie (≥768px) – stopka fixed */
@media (min-width: 768px) {
  .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
  }
  body {
    padding-bottom: 80px; /* aby treść nie była zasłonięta */
  }
}

/* 4) Dark mode */
[data-theme="dark"] .site-footer {
  background: #1c1c1c;
  color: #ccc;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .site-footer .footer-links a {
  color: #4aa8ff;
}
[data-theme="dark"] .site-footer .footer-links a:hover {
  color: #7ecaff;
}
