/* ===========================
   POPUP CONTAINER
=========================== */
#charmed-quiz-popup-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    font-family: 'Segoe UI', sans-serif;
}

#charmed-quiz-popup-content {
    background: #1e1e1e;
    color: #fff;
    border-radius: 12px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    position: relative;
    max-height: 90vh; /* Imposta un'altezza massima per il contenitore del popup */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quiz-title {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-align: center;
}

.quiz-subtitle {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 20px;
    text-align: center;
}

#charmed-quiz-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* ===========================
   PROGRESS BAR
=========================== */
.quiz-progress-bar {
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 15px; /* Aggiunto spazio tra il sottotitolo e la progress bar */
}
.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
    width: 0;
    transition: width 0.3s ease;
}

/* ===========================
   QUESTION TEXT
=========================== */
.quiz-question {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
}
.quiz-question-number {
    font-size: 16px;
    font-weight: bold;
    color: #888;
    margin-right: 8px;
    flex-shrink: 0;
}
.quiz-question-text {
    display: inline;
    margin-right: 15px; /* Spazio a destra del testo della domanda */
}

/* ===========================
   ANSWERS LIST
=========================== */
.quiz-answers {
    margin-top: 20px;
}
.quiz-answer {
    background: #2a2a2a;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column; /* Imposta la direzione dei flex in colonna */
}
.quiz-answer:hover {
    background: #3a3a3a;
}
.quiz-answer.correct {
    border: 2px solid #4caf50;
    background: #1b3d1b;
}
.quiz-answer.incorrect {
    border: 2px solid #e53935;
    background: #3b1b1b;
}
.quiz-answer-content {
    display: flex;
    align-items: center;
}
.quiz-answer-content .icon {
    margin-right: 10px;
    font-size: 18px;
}
.answer-feedback {
    font-size: 14px;
    margin-top: 5px;
    color: #ccc;
    margin-left: 32px; /* Allinea il feedback con il testo della risposta */
}
.answer-feedback.correct {
    color: #4caf50;
    font-weight: 500;
}
.answer-feedback.incorrect {
    color: #e53935;
    font-weight: 500;
}

/* ===========================
   NAV BUTTONS
=========================== */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.quiz-button {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}
.quiz-button.next {
    background: #1976d2;
    color: white;
}
.quiz-button.next:hover {
    background: #1565c0;
}
.quiz-button.back {
    background: transparent;
    color: #bbb;
}
.quiz-button.back:hover {
    background: rgba(255,255,255,0.08);
}

/* ===========================
   RISULTATI & CLASSIFICA
=========================== */
.results-scrollable {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 20px;
    padding-right: 10px;
    max-height: 400px;
}
.results-scrollable .result-item {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
}
.results-scrollable .question-text {
    font-weight: bold;
    margin-bottom: 4px;
}
.results-scrollable .correct-answer,
.results-scrollable .your-answer {
    font-size: 13px;
}
.leaderboard-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
    text-align: center;
}
.leaderboard-list {
    list-style: none;
    padding: 0;
}
.leaderboard-item {
    background: #2a2a2a;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}
.leaderboard-item .user-score {
    font-weight: bold;
    color: #4caf50;
}
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.results-table th, .results-table td {
    padding: 8px;
    border: 1px solid #444;
    text-align: left;
}
.results-table th {
    background: #333;
    font-weight: bold;
}
.results-table td.superato {
    color: #4caf50;
}
.results-table td.non-superato {
    color: #e53935;
}
/* Stili per il progress bar circolare */
#quiz-progress-bar-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.circular-progress {
  width: 140px;
  height: 140px;
  position: relative;
}
.circular-chart {
  display: block;
  margin: auto;
  max-width: 100%;
  max-height: 140px;
}
.circle-bg {
  fill: none;
  stroke: #eee;
  stroke-width: 3.8;
}
.circle {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  animation: progress 1s ease-out forwards;
}
.circle.correct {
  stroke: #00ff6a;
  stroke-opacity: 0.9;
}
.circle.wrong {
  stroke: #ff1a1a;
  stroke-opacity: 0.9;
}
.percentage-text {
  font-size: 0.45em;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #fff;
  font-weight: bold;
  dy: 0.1em; 
}
@keyframes progress {
  0% { stroke-dasharray: 0 100; }
}

.quiz-congrats {
  color: #f1f1f1;
  font-size: 16px;
  text-align: center;
  margin-bottom: 15px;
}

.leaderboard-container {
  max-height: 300px;   /* oppure 400px se vuoi più spazio */
  overflow-y: auto;
  margin-top: 15px;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.3);
}
