/* ==========================================================================
  Categories Page Styles
   ========================================================================== */

/* 🆕 ন্যাভবারের নিচে কুইজ ইন্টারফেস যেন ঢাকা না পড়ে তার জন্য টপ স্পেস */
#quiz-ui {
  padding-top: 100px; 
}

/* --- Quiz Header (Timer & Progress) --- */
.quiz-header {
  position: sticky;
  top: 70px;
  background: var(--bg); /* ডার্ক মোড সাপোর্ট করার জন্য সলিড কালার */
  z-index: 90;
  padding: 15px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.quiz-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

/* Progress Bar */
.quiz-progress-wrapper {
  flex-grow: 1;
  max-width: 600px;
}

.progress-text {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
  font-family: 'Baloo Da 2', cursive;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--surface-solid, #e2e8f0);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Progress Bar Shine Effect */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shine 2s infinite;
}

/* 3D Timer */
.quiz-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 8px 16px;
  border-radius: 30px;
  border: 2px solid var(--primary-light);
  box-shadow: 0 4px 0 var(--primary-light), 0 8px 15px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.timer-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums; 
}

/* --- 3D Quiz Board & Card --- */
.quiz-board {
  padding-top: 40px; 
  padding-bottom: 80px;
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden; 
}

.quiz-board__container {
  width: 100%;
  max-width: 800px;
  position: relative;
}

.quiz-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.4);
  position: relative;
  transform-style: preserve-3d;
}

/* Subject Tag */
.quiz-card__subject-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 20px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.05);
}

.quiz-card__question {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 30px;
}

/* --- 3D Options Container & Buttons --- */
.quiz-card__options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: var(--surface-solid, #ffffff);
  color: var(--text);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px 20px;
  border-radius: 16px;
  border: 2px solid var(--border, #e2e8f0);
  border-bottom: 6px solid var(--border, #cbd5e1);
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); 
  display: flex;
  align-items: center;
  gap: 15px;
}

.option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border-radius: 50%;
  font-weight: 700;
  color: var(--text-light);
  transition: 0.3s;
}

.option-btn:hover:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 4px;
  background: var(--bg-hover, #f8fafc);
  border-color: var(--primary-light);
}

.option-btn:active:not(:disabled) {
  transform: translateY(6px);
  border-bottom-width: 0px;
  margin-bottom: 6px; 
}

/* --- Validation States (Correct / Wrong) --- */
.option-btn.correct {
  background: #d1fae5;
  border-color: #10b981;
  border-bottom-color: #059669;
  color: #065f46;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.option-btn.correct .option-icon {
  background: #10b981;
  color: white;
}

.option-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  border-bottom-color: #b91c1c;
  color: #991b1b;
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.option-btn.wrong .option-icon {
  background: #ef4444;
  color: white;
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

/* --- Explanations --- */
.quiz-card__explanation {
  margin-top: 25px;
  padding: 20px;
  background: #f0fdf4; 
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  display: flex;
  gap: 15px;
  animation: fadeInDown 0.4s ease forwards;
}

.explanation-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.quiz-card__explanation p {
  color: #166534;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Quiz Controls --- */
.quiz-controls {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
}

.btn--next {
  font-size: 1.1rem;
  padding: 14px 30px;
  border-radius: 30px;
  box-shadow: 0 4px 0 var(--primary-dark), 0 10px 20px rgba(0,0,0,0.15);
  transform: translateY(-4px);
  animation: popIn 0.4s ease;
}

.btn--next:active {
  transform: translateY(0);
  box-shadow: 0 0 0 var(--primary-dark), 0 5px 10px rgba(0,0,0,0.1);
}


/* --- Result Modal (Pixar Style) --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.modal:not(.hidden) {
  visibility: visible;
  opacity: 1;
}

.modal__overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal__content {
  position: relative;
  background: var(--surface);
  width: 90%;
  max-width: 500px;
  border-radius: 30px;
  padding: 40px 30px;
  text-align: center;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal:not(.hidden) .modal__content {
  transform: scale(1);
}

.modal__icon {
  margin: -70px auto 20px; 
  width: 90px;
  height: 90px;
  font-size: 2.5rem;
  background: var(--surface);
  border: 5px solid var(--primary-light);
}

.modal__title {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-weight: 800;
}

.modal__subtitle {
  color: var(--text-light);
  margin-bottom: 30px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-box {
  background: var(--bg);
  padding: 15px 10px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 2px solid transparent;
}

.stat-box--correct { border-color: #10b981; background: #ecfdf5; }
.stat-box--wrong { border-color: #ef4444; background: #fef2f2; }
.stat-box--total { border-color: var(--primary); background: var(--primary-light); }

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: 'Baloo Da 2', cursive;
}

.stat-box--correct .stat-value { color: #059669; }
.stat-box--wrong .stat-value { color: #b91c1c; }
.stat-box--total .stat-value { color: var(--primary-dark); }

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
}

.modal__actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.modal__actions .btn {
  flex: 1;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.slide-in-right {
  animation: slideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.slide-out-left {
  animation: slideOutLeft 0.4s ease-in forwards;
}

@keyframes slideInRight {
  0% { transform: translateX(100%) rotateY(10deg); opacity: 0; }
  100% { transform: translateX(0) rotateY(0deg); opacity: 1; }
}

@keyframes slideOutLeft {
  0% { transform: translateX(0) rotateY(0deg); opacity: 1; }
  100% { transform: translateX(-100%) rotateY(-10deg); opacity: 0; }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInDown {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 200%; }
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .quiz-card { padding: 25px 20px; }
  .quiz-card__question { font-size: 1.3rem; }
  .option-btn { font-size: 1rem; padding: 14px 16px; }
  .quiz-header__inner { flex-direction: column; align-items: stretch; gap: 15px; }
  .quiz-timer { align-self: flex-end; }
  .result-stats { grid-template-columns: 1fr; gap: 10px; }
  .modal__actions { flex-direction: column; }
}