/* 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: 360px;   /* było 250px – powiększamy */
  height: 260px;      /* było 180px – powiększamy */
  object-fit: contain;
  margin: 0 auto 20px auto;
  display: block;
}


/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 20px auto;
  }

  .selection {
    flex-direction: column;
    align-items: center;
  }

  .flashcard {
    width: 100%;
    max-width: 380px;
    height: auto;
    min-height: 520px; /* było 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%;
  /* brak animacji tła */
  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;
}

.back-button:hover {
  transform: translateX(-5px);
}

[data-theme="dark"] .back-button {
  color: #4aa8ff;
}

@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 ---- */
.flashcard {
  width: 100%;
  max-width: 380px;  /* było 350px */
  height: 580px;     /* było 500px */
  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);
}

.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* było center */
  padding: 30px;
  box-sizing: border-box;
  background: var(--card-bg);
  border-radius: 18px;
}


.flashcard-back {
  transform: rotateY(180deg);
  background: var(--bg-color);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.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);
}

/* KARTA QUIZU */
#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;
  position: relative;   /* potrzebne, żeby pasek przykleić do dolnej krawędzi */
}

/* Układ odpowiedzi jak w Milionerach – 2x2 */
#options {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 kolumny */
  gap: 12px 12px;
  margin-top: 20px;
}

.option-btn {
  padding: 14px 10px;
  font-size: 16px;
  border-radius: 16px;
  background: #0071e3;
  color: white;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  width: 100%;
}

.option-btn:hover {
  background: #0b7bf0;
  transform: translateY(-1px);
}

.option-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}


#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>');
}

/* Stopka */
.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);
}

@media (max-width: 767px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
  }
  .site-content {
    flex: 1;
  }
  .site-footer {
    position: static;
    width: 100%;
    left: 0;
    bottom: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
  }
}

@media (min-width: 768px) {
  .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
  }
  body {
    padding-bottom: 80px;
  }
}

[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;
}

/* PASEK CZASU – rozszerza się od środka na boki */
#answer-timer-container {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  overflow: visible;
  pointer-events: none;
  display: none;
}

#answer-timer-bar {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 100%;               /* końcowa szerokość */
  background: #ffffff;
  opacity: 0.95;

  transform-origin: center;  /* rozszerzanie od środka */
  transform: translateX(-50%) scaleX(0); /* start: 0% */

  transition: transform 5s linear; /* 5 sekund do pełnego rozszerzenia */
}
