.quiz-container {
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
  transform: scale(1.1);
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  background: #1ca6f4;
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Start Screen */
.start-screen {
  background: url(bg.png);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  padding: 90px 40px 40px 60px;
  border-radius: 15px;
  height: 480px;
  text-align: center;
}

.start-screen h1 {
  margin-bottom: 20px;
  color: #333;
}

/* Cards Stack Container */
.cards-stack {
  position: relative;
  height: 520px; /* usklađeno s visinom kartice */
  display: none;
  perspective: 1000px; /* 3D za flip */
}

/* Pozadinski kartice za stack efekt */
.stack-card {
  position: absolute;
  width: 100%;
  height: 520px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease-out;
}

.stack-card-1 {
  transform: translateY(8px) scale(0.98);
  background: #f8f8f8;
  z-index: 1;
}

.stack-card-2 {
  transform: translateY(16px) scale(0.96);
  background: #f0f0f0;
  z-index: 0;
}

/* -------------------------------
   RAZDVAJANJE TRANSFORMACIJA
   ------------------------------- */

/* 1) KONTEJNER koji se SLIDE-a / RISE-a */
.flip-container {
  position: absolute;
  width: 100%;
  height: 520px;
  z-index: 10;
  will-change: transform;
}

/* slide-out bez mijenjanja flip stanja */
.flip-container.sliding-out-explanation {
  animation: slideOutLeft 0.5s ease-in forwards;
  will-change: transform, opacity;
}

/* kartica se diže iz stoga */
.flip-container.rising {
  animation: riseFromStack 0.5s ease-out forwards;
}

/* 2) UNUTARNJI element koji se FLIP-a */
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.6s;
  will-change: transform;
}

.flip-inner.is-flipped {
  transform: rotateY(180deg);
}

/* Pomoćna klasa: reset flip-a bez tranzicije */
.flip-inner.no-transition {
  transition: none !important;
}

/* Lica kartice */
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}

.card-front {
  z-index: 2;
}

.card-back {
  transform: rotateY(180deg);
  background: #fff;
  color: #242c5f !important;
}

/* Keyframes */
@keyframes slideOutLeft {
  from {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateX(-150%) rotate(-12deg);
    opacity: 0;
  }
}

@keyframes riseFromStack {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0.8;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Question Side Content */
.question-number {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.question-title {
  font-size: 1.4rem;
  color: #333;
  margin-bottom: 30px;
  flex-shrink: 0;
}

.answers {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.answer-option {
  display: flex;
  align-items: center;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #242c5f;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.answer-option:hover {
  background: #e8e8e8;
}

.answer-option.selected {
  background: #007bff;
  color: white;
}

.answer-option input[type="radio"] {
  margin-right: 15px;
}

.answer-option label {
  cursor: pointer;
  flex-grow: 1;
}

/* Explanation Side Content */
.explanation-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.explanation-title {
  font-size: 1.5rem;
  color: #242c5f;
  margin-bottom: 20px;
}

.explanation-text {
  flex-grow: 1;
  line-height: 1.6;
  font-size: 1.5rem;
  color: #242c5f;
}

.result-indicator {
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: bold;
  text-align: center;
}

.result-correct {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.result-incorrect {
  background: #fb3e97;
  color: #fff;
  border: 1px solid #fb3e97;
}

/* Final Summary */
.summary-screen {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: none;
}

.summary-title {
  font-size: 28px;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

.summary-content {
  line-height: 1.8;
  color: #555;
  font-size: 1.2rem;
}

.summary-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-question {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

/* Buttons */
.btn {
  padding: 12px 30px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-success {
  background: #ff369a;
  color: white;
  font-weight: 700;
}

.btn-success:hover {
  background: #218838;
}

.quizlegal {
  color: #fff;

  text-align: center;
  font-size: 1.3125rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.875rem; /* 142.857% */
  max-width: 45rem;
  margin: 0 auto;
  padding-top: 1rem;
}

/* Utilities */
.hidden {
  display: none;
}

@media (max-width: 619px) {
  .start-screen {
    min-height: 100%;
    background: url(bg.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
}

@media (max-width: 479px) {
  .start-screen {
    min-height: 100%;
    background: url(bgmob.png);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
}
