/* Quiz Plugin Styles */
.quiz-container-wrapper .quiz-container {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
}

.quiz-container-wrapper .question-section {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  transition: all 0.3s ease;
  background: #fff;
  z-index: 10;
}

.quiz-container-wrapper .stats-section {
  width: 350px;
  padding: 15px;
  overflow-y: auto;
  background: #f8f9fa;
  border-left: 1px solid #ddd;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  z-index: 5;
}

.quiz-container-wrapper .stats-section.collapsed {
  transform: translateX(100%);
  opacity: 0;
  width: 0;
  padding: 0;
  border: none;
}

.quiz-container-wrapper .question-section.expanded {
  width: 100%;
}

.quiz-container-wrapper .toggle-stats-btn {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  width: 30px;
  height: 30px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
}

.quiz-container-wrapper .toggle-stats-btn::before {
  content: '\25C0';
  font-size: 18px;
  transition: all 0.3s;
}

.quiz-container-wrapper .toggle-stats-btn.expanded::before {
  content: '\25B6';
}

.quiz-container-wrapper .main-content {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.quiz-container-wrapper .mcq { 
  border: 5px solid #ccc; 
  padding: 15px; 
  margin-bottom: 20px; 
  border-radius: 8px; 
  display: none; 
  width: 100%;
}

.quiz-container-wrapper .mcq.active { display: block; }
.quiz-container-wrapper .mcq h4 { margin-bottom: 10px; }
.quiz-container-wrapper .mcq label { 
  display: block; 
  margin: 8px 0; 
  border: 1px solid #ddd; 
  border-radius: 5px; 
  overflow: hidden; 
  cursor: pointer; 
}

.quiz-container-wrapper .mcq input[type="radio"] { display: none; }
.quiz-container-wrapper .mcq label span { 
  display: block; 
  padding: 10px; 
  background: #f5f5f5; 
}

.quiz-container-wrapper .mcq input[type="radio"]:checked + span { background: #dceeff; }
.quiz-container-wrapper .correct span { background-color: #d1e7dd !important; border-color: #0f5132 !important; font-weight: bold; }
.quiz-container-wrapper .incorrect span { background-color: #f8d7da !important; border-color: #842029 !important; }
.quiz-container-wrapper .feedback { font-weight: bold; margin-top: 8px; }

.quiz-container-wrapper .nav-buttons { 
  display: flex; 
  justify-content: center; 
  gap: 20px; 
  margin-top: 20px; 
  flex-wrap: wrap;
}

.quiz-container-wrapper .nav-buttons button { 
  padding: 10px 20px; 
  font-size: 16px; 
  background: #007bff; 
  color: #fff; 
  border: none; 
  border-radius: 6px; 
  cursor: pointer;
  flex: 1 1 120px;
}

.quiz-container-wrapper .nav-buttons button:disabled { background: #ccc; cursor: not-allowed; }
.quiz-container-wrapper .result { text-align: center; margin-top: 20px; font-weight: bold; display: none; }

.quiz-container-wrapper .quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 5px 0;
  padding: 2px;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.quiz-container-wrapper .question-number {
  font-weight: bold;
  font-size: 18px;
  margin: 0;
}

.quiz-container-wrapper .timer-box {
  color: #d63333;
  font-weight: bold;
  margin: 0;
}

.quiz-container-wrapper .explanation-box {
  text-align: justify;
  color: #000;
  background: #f9f9f9;
  padding: 15px;
  border: 5px solid #ccc;
  border-radius: 6px;
  font-style: normal;
  display: none;
  margin-top: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quiz-container-wrapper .progress-category {
  margin-bottom: 10px;
}

.quiz-container-wrapper .progress-category h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #333;
  font-size: 16px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.quiz-container-wrapper .question-status-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-bottom: 15px;
}

.quiz-container-wrapper .question-status-grid span {
  width: 25px;
  height: 25px;
  line-height: 25px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
}

.quiz-container-wrapper .unanswered { 
  background: #e9ecef; 
  border: 2px solid #adb5bd; 
  color: #495057;
}

.quiz-container-wrapper .answered { 
  background: #4dabf7; 
  border: 2px solid #1971c2; 
  color: white;
}

.quiz-container-wrapper .correct-answer { 
  background: #40c057; 
  border: 2px solid #2b8a3e; 
  color: white;
}

.quiz-container-wrapper .wrong-answer { 
  background: #fa5252; 
  border: 2px solid #c92a2a; 
  color: white;
}

.quiz-container-wrapper .current-question { 
  box-shadow: 0 0 0 3px #ffd43b;
  transform: scale(1.1);
  transition: all 0.2s;
}

.quiz-container-wrapper .stats-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.quiz-container-wrapper .stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

.quiz-container-wrapper .stat-indicator {
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.quiz-container-wrapper .stat-answered { background-color: #4dabf7; }
.quiz-container-wrapper .stat-unanswered { background-color: #e9ecef; }
.quiz-container-wrapper .stat-correct { background-color: #40c057; }
.quiz-container-wrapper .stat-wrong { background-color: #fa5252; }

.quiz-container-wrapper .stats-value {
  font-weight: bold;
}

.quiz-container-wrapper .quiz-intro {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 20px;
}

.quiz-container-wrapper .time-up {
  color: #d63333;
  font-weight: bold;
  animation: blink 1s infinite;
}

.quiz-container-wrapper .quiz-results {
  display: none;
  margin-top: 20px;
  padding: 15px;
  background: #f0f8ff;
  border-radius: 8px;
}

.quiz-container-wrapper .quiz-results h3 {
  color: #2c3e50;
  margin-top: 0;
  text-align: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

.quiz-container-wrapper .quiz-results p {
  margin: 8px 0;
  font-size: 14px;
}

.quiz-container-wrapper .quiz-results strong {
  color: #27ae60;
}

.quiz-container-wrapper .submit-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.quiz-container-wrapper .submit-btn:hover {
  background: #218838;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.quiz-container-wrapper .quiz-loading-message {
  text-align: center;
  padding: 20px;
  font-size: 18px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.quiz-container-wrapper .progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 98;
  display: none;
}

.quiz-container-wrapper .mcq.locked label {
  cursor: default;
}

.quiz-container-wrapper .mcq.locked label span {
  opacity: 0.9;
}

.quiz-container-wrapper .fullscreen-btn {
  position: fixed;
  right: 50px;
  top: 10px;
  z-index: 1000;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.quiz-container-wrapper .fullscreen-btn:hover {
  background: #0069d9;
}

.quiz-container-wrapper .fullscreen-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

:fullscreen .quiz-container-wrapper .quiz-container,
:-webkit-full-screen .quiz-container-wrapper .quiz-container,
:-moz-full-screen .quiz-container-wrapper .quiz-container,
:-ms-fullscreen .quiz-container-wrapper .quiz-container {
  width: 100% !important;
  height: 100% !important;
  background: white;
}

:fullscreen .quiz-container-wrapper .fullscreen-btn,
:-webkit-full-screen .quiz-container-wrapper .fullscreen-btn,
:-moz-full-screen .quiz-container-wrapper .fullscreen-btn,
:-ms-fullscreen .quiz-container-wrapper .fullscreen-btn {
  display: none;
}

/* Image styling for questions, options, and explanations */
.quiz-container-wrapper .mcq img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
  border-radius: 4px;
}

.quiz-container-wrapper .mcq h4 img {
  margin: 5px 0;
}

.quiz-container-wrapper .mcq label span img {
  margin: 5px 0;
  max-height: 150px;
}

.quiz-container-wrapper .explanation-box img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
  border-radius: 4px;
}

/* Ranking display styles */
.quiz-container-wrapper .ranking-display {
  margin-top: 15px;
  padding: 15px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.quiz-container-wrapper .ranking-display h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
}

.quiz-container-wrapper .rank-value {
  font-size: 32px;
  font-weight: bold;
  margin: 10px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.quiz-container-wrapper .performance-bar {
  height: 20px;
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  margin: 10px 0;
  overflow: hidden;
  position: relative;
}

.quiz-container-wrapper .performance-fill {
  height: 100%;
  background: #ffd43b;
  border-radius: 10px;
  width: 0%;
  transition: width 1s ease-in-out;
}

.quiz-container-wrapper .performance-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 5px;
}

.quiz-container-wrapper .ranking-details {
  margin-top: 15px;
  text-align: left;
  font-size: 14px;
  background: rgba(255,255,255,0.2);
  padding: 10px;
  border-radius: 6px;
}

.quiz-container-wrapper .ranking-details h4 {
  margin: 0 0 8px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 5px;
}

.quiz-container-wrapper .ranking-details div {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .quiz-container-wrapper .question-section {
    padding: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  .quiz-container-wrapper .stats-section {
    position: fixed;
    right: -350px;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    max-height: 80vh;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding: 15px;
    transition: right 0.3s ease;
    z-index: 99;
  }
  
  .quiz-container-wrapper .stats-section.visible {
    right: 20px;
  }
  
  .quiz-container-wrapper .toggle-stats-btn {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
  }
  
  .quiz-container-wrapper .toggle-stats-btn::before {
    content: '\25C0' !important;
  }
  
  .quiz-container-wrapper .toggle-stats-btn.expanded::before {
    content: '\25B6' !important;
  }
  
  .quiz-container-wrapper .quiz-header {
    flex-direction: row;
    gap: 3px;
    padding: 3px;
    align-items: center;
  }
  
  .quiz-container-wrapper .question-number,
  .quiz-container-wrapper .timer-box {
    width: auto;
    text-align: left;
    margin: 0;
    font-size: 14px;
  }
  
  .quiz-container-wrapper .mcq {
    width: 100%;
    padding: 10px;
  }
  
  .quiz-container-wrapper .question-status-grid {
    grid-template-columns: repeat(auto-fill, minmax(25px, 1fr));
    gap: 3px;
  }
  
  .quiz-container-wrapper .question-status-grid span {
    width: 25px;
    height: 25px;
    line-height: 25px;
    font-size: 11px;
  }
  
  .quiz-container-wrapper .nav-buttons {
    gap: 10px;
  }
  
  .quiz-container-wrapper .nav-buttons button {
    flex: 1 1 100px;
    padding: 8px 10px;
    font-size: 14px;
  }
  
  .quiz-container-wrapper .explanation-box {
    padding: 10px;
  }
  
  .quiz-container-wrapper .mcq label img {
    max-height: 100px;
  }
  
  .quiz-container-wrapper .stats-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }
  
  .quiz-container-wrapper .stat-item {
    flex: 1 1 45%;
    min-width: 120px;
    margin-bottom: 5px;
    font-size: 12px;
    justify-content: space-between;
  }
  
  .quiz-container-wrapper .stat-indicator {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
  }
  
  .quiz-container-wrapper .stats-value {
    margin-left: auto;
    padding-left: 5px;
  }
  
  .quiz-container-wrapper .fullscreen-btn {
    display: none;
  }
  
  .quiz-container-wrapper .ranking-display {
    padding: 10px;
  }
  
  .quiz-container-wrapper .rank-value {
    font-size: 24px;
  }
  
  .quiz-container-wrapper .ranking-details {
    font-size: 12px;
  }
}