@font-face {
  font-family: 'IRANSansX';
  src: url('../../fonts/IRANSansX.woff2') format('woff2');
}

@font-face {
  font-family: 'Morabba';
  src: url('../../fonts/Morabba.woff2') format('woff2');
}

body {
  margin: 0;
  background-color: #E8E9FE;
  font-family: 'IRANSansX', sans-serif;
  direction: rtl;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.main-content {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 40px;
}

.quiz-container {
  width: 100%;
  max-width: 600px;
  background-color: rgba(108, 101, 255, 0.85);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 25px 30px 30px 30px;
  box-shadow: 0 10px 40px rgba(108, 101, 255, 0.4);
  box-sizing: border-box;
}

.quiz-progress-bar {
  width: 100%;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: visible;
  margin-bottom: 20px;
  direction: ltr;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: #E8E9FE;
  border-radius: 5px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-circle {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translate(-50%, -50%);
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #6C65FF;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 8px rgba(108, 101, 255, 0.25);
  font-family: 'Morabba';
  font-weight: 800;
  font-size: 10px;
  color: #fff;
  user-select: none;
}

.question-text {
  font-family: 'IRANSansX', sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #FFFFFF;
  margin: 20px 0 30px 0;
  line-height: 1.8;
  text-align: justify;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  background-color: #e1ddfe;
  border: 2px solid #e1ddfe;
  border-radius: 12px;
  text-align: right;
  font-family: 'IRANSansX', sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  min-height: 55px;
}

.option-btn:not(:disabled):hover {
  border-color: #FFFFFF;
  background-color: #FFFFFF;
}

.option-btn.correct {
  background-color: #28a745;
  border-color: #28a745;
  color: #FFFFFF;
}

.option-btn.incorrect {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #FFFFFF;
}

.option-btn.disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.option-btn.correct,
.option-btn.incorrect {
  opacity: 1;
}

.option-btn .option-prefix {
  font-family: 'Morabba', serif;
  font-size: 18px;
  margin-left: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.option-btn .option-text {
  line-height: 1.6;
  word-break: break-word;
}

.quiz-footer {
  margin-top: 25px;
}

.quiz-hint {
  text-align: center;
  margin-bottom: 20px;
}

#hint-btn {
  background: none;
  border: none;
  color: #E8E9FE;
  font-family: 'Morabba', serif;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.8;
  padding: 10px;
}
#hint-btn:hover {
  opacity: 1;
}

#hint-text {
  font-size: 14px;
  color: #E8E9FE;
  margin-top: 10px;
  line-height: 1.6;
  background: rgba(0,0,0,0.2);
  padding: 10px;
  border-radius: 8px;
}

.quiz-feedback {
  padding: 15px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: #FFFFFF;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 15px;
}

.next-btn {
  background-color: #E8E9FE;
  color: #6C65FF;
  font-family: 'Morabba', serif;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.next-btn:hover {
  background-color: #FFFFFF;
}

.hidden {
  display: none;
}

.info-fab-shadow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(108,101,255,.25);
  backdrop-filter: blur(22px);
  transition: opacity .3s ease;
  z-index: 25;
}
.info-fab-shadow.active {
  opacity: 1;
}

.info-box {
  position: fixed;
  top: 88px;
  right: 24px;
  width: 300px;
  max-width: calc(100% - 48px);
  border-radius: 22px;
  padding: 22px 20px;
  background: rgba(108,101,255,.55);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 10px 35px rgba(108,101,255,.35),0 10px 28px rgba(0,0,0,.15);
  color: #fff;
  transform: translateX(28px) translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease,transform .35s cubic-bezier(.4,.2,.2,1);
  font-family: 'Morabba';
  z-index: 30;
}
.info-box[aria-hidden="false"] {
  transform: translateX(0) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.info-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35),0 8px 18px rgba(0,0,0,.12);
  color: #F7F7FE;
  font-weight: 400;
  font-size: 20px;
}
.label {
  font-size: 20px;
  opacity: .95;
}
.value-badge {
  min-width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.35);
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  letter-spacing: .2px;
}

.export-btn,
.back-btn {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: 16px;
  font-family: 'Morabba';
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(108,101,255,.38);
  color: #fff;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.32);
  transition: all .25s ease;
  margin-top: 14px;
}

.export-btn:hover,
.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(108,101,255,.45);
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(108,101,255,.4);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  font-family: 'IRANSansX';
}
.popup.show {
  opacity: 1;
  pointer-events: auto;
}
.popup-content {
  background: linear-gradient(135deg,#6C65FF 0%,#928CFF 100%);
  color: #fff;
  border-radius: 24px;
  padding: 34px 26px 28px;
  text-align: center;
  box-shadow: 0 10px 45px rgba(108,101,255,.55),0 4px 12px rgba(0,0,0,.2);
  width: 90%;
  max-width: 340px;
  transform: scale(.95);
  transition: transform .3s ease;
}
.popup.show .popup-content {
  transform: scale(1);
}
.popup-content h2 {
  font-family: 'Morabba';
  margin: 0 0 12px;
  font-size: 23px;
}
.popup-content p {
  font-size: 16px;
  opacity: .95;
  margin-bottom: 26px;
}
.popup-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.popup-buttons button {
  font-family: 'IRANSansX';
  background: rgba(255,255,255,.92);
  color: #6C65FF;
  border: none;
  border-radius: 14px;
  padding: 11px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
  box-shadow: 0 4px 12px rgba(255,255,255,.15),0 3px 10px rgba(0,0,0,.1);
}
.popup-buttons button:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(108,101,255,.4);
}

@media (max-width: 768px) {
  body {
    padding: 10px;
    display: block;
  }
  .main-content {
    margin-top: 10px;
  }
  .quiz-container {
    padding: 20px 15px 25px 15px;
  }
  .question-text {
    font-size: 17px;
    margin: 15px 0 25px 0;
  }
  .option-btn {
    padding: 12px 10px;
    font-size: 14px;
  }
  .option-btn .option-prefix {
    font-size: 16px;
    margin-left: 8px;
  }
}