/**
 * InsidePiano — Simple Quiz: Quiz List, Quiz View, Results
 * Scoped to .com_simplequiz
 */

/* ==========================================================================
   Simple Quiz — Quiz List Page (table/list layout)
   .simplequiz.quiz_list
   ========================================================================== */

/* Strip Conca wrapper — quiz list page, results page, results empty state */
.demo-card:has(.sq-sections-wrapper),
.demo-card:has(.sq-sections-wrapper) .demo-card-body,
.demo-card:has(.quiz_list),
.demo-card:has(.quiz_list) .demo-card-body,
.demo-card:has(.sq-report-card),
.demo-card:has(.sq-report-card) .demo-card-body,
.demo-card:has(.sq-report-empty-state),
.demo-card:has(.sq-report-empty-state) .demo-card-body,
.demo-card:has(.sq-report-card) .com-content-article__body,
.demo-card:has(.sq-report-empty-state) .com-content-article__body {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Beat custom-core.css .p-6 !important on demo-card-body (higher specificity) */
.demo-card:has(.sq-report-card) .demo-card-body.p-6,
.demo-card:has(.sq-report-empty-state) .demo-card-body.p-6,
.demo-card:has(.sq-sections-wrapper) .demo-card-body.p-6,
.demo-card:has(.quiz_list) .demo-card-body.p-6 {
  padding: 0 !important;
}

/* Hide component heading — breadcrumb already shows "Tests" */
.com_simplequiz .componentheading.page-header {
  display: none !important;
}

/* Quiz list — replaced by .sq-sections-wrapper via JS; keep hidden as fallback */
.com_simplequiz .simplequiz.quiz_list {
  display: none;
}

/* Per-section sub-card */
.sq-section-card {
  background: #1F1F21;
  border: 1px solid #2e2e33;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

/* Quiz item — horizontal row */
.com_simplequiz .quiz_item {
  display: flex !important;
  align-items: center !important;
  padding: 14px 20px !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid #2e2e33 !important;
  background: transparent !important;
  gap: 16px;
  transition: background-color 0.15s ease;
}

.com_simplequiz .quiz_item:last-child {
  border-bottom: none !important;
}

.com_simplequiz .quiz_item:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Flatten quiz_content so image and button participate in row flex */
.com_simplequiz .quiz_content {
  display: contents;
}

/* Thumbnail / Category Badge */
.com_simplequiz .quiz_image {
  flex-shrink: 0;
  order: -2;
  margin: 0 !important;
}

.com_simplequiz .quiz_image img {
  width: 56px !important;
  height: 56px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  display: block !important;
}

/* Category color badge — replaces thumbnail via JS */
.sq-cat-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sq-cat-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--sq-cat-color) 30%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.sq-cat-badge i {
  font-size: 1.15rem;
  color: var(--sq-cat-color);
  line-height: 1;
}

.sq-cat-badge span {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sq-cat-color);
  text-transform: uppercase;
  line-height: 1;
}

/* Title — takes remaining space */
.com_simplequiz .quiz_title {
  flex: 1;
  min-width: 0;
  padding: 0 !important;
  order: -1;
}

.com_simplequiz .quiz_title h3.title {
  margin: 0 !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.com_simplequiz .quiz_title h3.title a.quiz_link {
  color: #e0e0e5 !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.com_simplequiz .quiz_title h3.title a.quiz_link:hover {
  color: #9f92fe !important;
}

/* Button — ghost purple, compact, pushed right */
.com_simplequiz a.btn-take-quiz {
  background: rgba(115, 103, 240, 0.15) !important;
  color: #7367f0 !important;
  border: 1px solid rgba(115, 103, 240, 0.55) !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  margin: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  white-space: nowrap;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.com_simplequiz a.btn-take-quiz:hover {
  background: rgba(115, 103, 240, 0.28) !important;
  color: #9f92fe !important;
  border-color: rgba(115, 103, 240, 0.7) !important;
  box-shadow: 0 0 0 1px rgba(115, 103, 240, 0.25);
}

/* Play icon inside button */
.com_simplequiz a.btn-take-quiz .fa-play {
  font-size: 0.65rem;
}

/* Items without images — fallback (JS adds badges, but just in case) */
.com_simplequiz .quiz_item:not(:has(.quiz_image)) {
  padding-left: 84px !important; /* 20px padding + 48px badge + 16px gap */
}

/* ==========================================================================
   Simple Quiz — Quiz View (single quiz / question page)
   .sq_instance.com_simplequiz > form.sq_quiz
   ========================================================================== */

/* Quiz view — use Conca wrapper as the card with visible border */
.demo-card:has(.sq_quiz) {
  border: 1px solid #2e2e33 !important;
}

.demo-card:has(.sq_quiz) .demo-card-body {
  padding: 28px 32px !important;
}

/* --- Quiz Title (show it on quiz view as card header) --- */
.com_simplequiz .simplequiz_componentheading.page-header {
  /* Override the list-page hide — show on quiz view */
}
/* Keep it hidden — breadcrumb shows quiz name is enough */

/* --- Question Block --- */
.com_simplequiz .simplequiz_question {
  padding: 0;
}

/* Question number + text */
.com_simplequiz .simplequiz_question > p:first-child {
  margin-bottom: 8px !important;
}

.com_simplequiz .simplequiz_question_count {
  color: #e0e0e5 !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  margin-right: 6px;
}

.com_simplequiz .simplequiz_question > p:first-child span strong {
  color: #e0e0e5 !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
}

/* --- Audio Player --- */
.sq-audio-wrap {
  filter: invert(1);
  width: fit-content;
  margin: 0;
  padding-bottom: 20px;
}

.sq-audio-wrap audio {
  display: block;
  width: 100%;
  min-width: 280px;
  max-width: 360px;
  margin: 0;
  border-radius: 8px;
}

/* Restore the p that contains audio/video/iframe */
.com_simplequiz .simplequiz_question > p:has(audio),
.com_simplequiz .simplequiz_question > p:has(video),
.com_simplequiz .simplequiz_question > p:has(iframe) {
  display: block !important;
  margin: 4px 0 20px 0 !important;
  padding: 0 !important;
  line-height: normal !important;
  font-size: 1rem !important;
  height: auto !important;
  overflow: visible !important;
}

/* --- Question Images --- */
.com_simplequiz .simplequiz_question img {
  max-width: 280px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #2e2e33;
  margin: 8px 0 16px 0;
  display: block;
}

/* --- Radio Labels — dark pill style --- */
.com_simplequiz label.sq_label {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  padding: 10px 16px !important;
  margin: 0 0 6px 0 !important;
  background: #1a1a1c !important;
  border: 1px solid #2e2e33 !important;
  border-radius: 8px !important;
  color: #c8c8cd !important;
  font-size: 0.925rem !important;
  font-weight: 400 !important;
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 360px;
}

.com_simplequiz label.sq_label:hover {
  background: #242428 !important;
  border-color: rgba(115, 103, 240, 0.4) !important;
  color: #e0e0e5 !important;
}

/* Selected state */
.com_simplequiz label.sq_label:has(input:checked) {
  background: rgba(115, 103, 240, 0.12) !important;
  border-color: rgba(115, 103, 240, 0.55) !important;
  color: #9f92fe !important;
}

/* --- Custom Radio Appearance --- */
.com_simplequiz input.sq_field[type="radio"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  border: 2px solid #57575a !important;
  border-radius: 50% !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.com_simplequiz input.sq_field[type="radio"]:checked {
  border-color: #7367f0 !important;
  background: #7367f0 !important;
  box-shadow: inset 0 0 0 3px #1a1a1c !important;
}

/* Remove empty <p> spacers between labels — only truly empty ones */
.com_simplequiz .simplequiz_question > p:empty {
  display: none !important;
}

/* Spacer <p> tags that only contain whitespace/br (between labels) */
.com_simplequiz .simplequiz_question > p:not(:has(.simplequiz_question_count)):not(:has(img)):not(:has(label)):not(:has(audio)):not(:has(video)):not(:has(iframe)) {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Restore the p that contains the question text */
.com_simplequiz .simplequiz_question > p:has(.simplequiz_question_count) {
  display: block !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.5 !important;
  font-size: 1rem !important;
  height: auto !important;
  overflow: visible !important;
}

/* Restore the p that contains images */
.com_simplequiz .simplequiz_question > p:has(img) {
  display: block !important;
  margin-bottom: 4px !important;
  line-height: normal !important;
  font-size: 1rem !important;
  height: auto !important;
  overflow: visible !important;
}

/* --- Pagination / Next Button --- */
.com_simplequiz .sq_pagination {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #2e2e33;
}

.com_simplequiz a.next_link {
  background: rgba(115, 103, 240, 0.15) !important;
  color: #7367f0 !important;
  border: 1px solid rgba(115, 103, 240, 0.55) !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.com_simplequiz a.next_link:hover {
  background: rgba(115, 103, 240, 0.28) !important;
  color: #9f92fe !important;
  border-color: rgba(115, 103, 240, 0.7) !important;
  box-shadow: 0 0 0 1px rgba(115, 103, 240, 0.25);
}

/* --- Complete Test Section (user details + submit) --- */
.com_simplequiz .sq-complete-test {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #2e2e33;
}

/* User details fieldset — hidden by component when logged in */
.com_simplequiz .simplequiz_user_fieldset {
  border: 1px solid #2e2e33 !important;
  border-radius: 8px !important;
  padding: 16px 20px !important;
  background: #1a1a1c !important;
  margin-bottom: 20px;
}

.com_simplequiz .simplequiz_user_fieldset legend {
  color: #939397 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 0 8px !important;
}

.com_simplequiz .simplequiz_user_table {
  background: transparent !important;
}

.com_simplequiz .simplequiz_user_table td {
  border: none !important;
  padding: 6px 8px !important;
}

.com_simplequiz .simplequiz_user_table label {
  color: #939397 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

.com_simplequiz .simplequiz_user_table input[type="text"],
.com_simplequiz .simplequiz_user_table input[type="email"] {
  background: #161618 !important;
  border: 1px solid #2e2e33 !important;
  border-radius: 6px !important;
  color: #c8c8cd !important;
  padding: 8px 12px !important;
  font-size: 0.875rem !important;
}

.com_simplequiz .simplequiz_user_table input:focus {
  border-color: rgba(115, 103, 240, 0.55) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(115, 103, 240, 0.15) !important;
}

/* Anti-spam question */
.com_simplequiz .anti_spam_question {
  margin-bottom: 20px;
}

.com_simplequiz .anti_spam_question label {
  color: #939397 !important;
  font-size: 0.8rem !important;
  display: block;
  margin-bottom: 6px;
}

.com_simplequiz .anti_spam_question input.anti_spam {
  background: #161618 !important;
  border: 1px solid #2e2e33 !important;
  border-radius: 6px !important;
  color: #c8c8cd !important;
  padding: 8px 12px !important;
  font-size: 0.875rem !important;
  width: 80px !important;
}

.com_simplequiz .anti_spam_question input.anti_spam:focus {
  border-color: rgba(115, 103, 240, 0.55) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(115, 103, 240, 0.15) !important;
}

/* Submit / Complete button — ghost purple */
.com_simplequiz button.sq_complete_button {
  background: rgba(115, 103, 240, 0.15) !important;
  color: #7367f0 !important;
  border: 1px solid rgba(115, 103, 240, 0.55) !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.com_simplequiz button.sq_complete_button:hover {
  background: rgba(115, 103, 240, 0.28) !important;
  color: #9f92fe !important;
  border-color: rgba(115, 103, 240, 0.7) !important;
  box-shadow: 0 0 0 1px rgba(115, 103, 240, 0.25);
}

/* ==========================================================================
   Simple Quiz — Results Page
   .simplequiz_detailed_results > .simplequiz_question_result
   ========================================================================== */

/* Results page also uses Conca wrapper as card */
.demo-card:has(.simplequiz_detailed_results) {
  border: 1px solid #2e2e33 !important;
}

.demo-card:has(.simplequiz_detailed_results) .demo-card-body {
  padding: 28px 32px !important;
}

/* --- Results Header --- */
.simplequiz_componentheading.page-header {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #e0e0e5 !important;
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  border: none !important;
}

.simplequiz_results {
  font-size: 1.05rem;
  color: #c8c8cd;
  margin-bottom: 12px;
}

/* Pass/Fail feedback text */
.simplequiz_fail_text,
.simplequiz_pass_text {
  color: #939397;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #2e2e33;
}

/* Hide stray <br> between fail text and detailed results */
.demo-card-body > br {
  display: none;
}

/* Gap between pass/fail feedback and first question result card.
   Using :first-of-type because intermediate <br>/<p> nodes break the + selector. */
.demo-card:has(.simplequiz_detailed_results) .simplequiz_question_result:first-of-type {
  margin-top: 28px !important;
}

/* --- Individual Question Result Cards --- */
.simplequiz_question_result {
  background: #1a1a1c;
  border: 1px solid #2e2e33;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 12px;
}

.simplequiz_question_result:last-child {
  margin-bottom: 0;
}

/* Question text ("1. ¿Cuál es la Tonalidad?") */
.simplequiz_question_result > p:first-child {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  color: #e0e0e5 !important;
  margin: 0 0 12px 0 !important;
  line-height: 1.4 !important;
}

/* Question number must match the question text size */
.simplequiz_question_result .simplequiz_question_count {
  font-size: inherit !important;
  font-weight: 600 !important;
  color: #e0e0e5 !important;
}

/* Question image */
.simplequiz_question_result > p:nth-child(2) img {
  max-width: 200px;
  height: auto;
  border-radius: 6px;
  border: 1px solid #2e2e33;
  display: block;
  margin-bottom: 14px;
}

/* Hide empty spacer <p> tags in results */
.simplequiz_question_result > p:empty {
  display: none !important;
}

/* Collapse non-empty spacer <p> tags (contain only an image or whitespace) */
.simplequiz_question_result > p:not(:first-child) {
  margin: 0 !important;
  padding: 0 !important;
}

/* --- Answer Options with Icons --- */
/* Hide the ugly 12x12 GIF images and replace with styled circles */
.simplequiz_question_result > img {
  width: 18px !important;
  height: 18px !important;
  vertical-align: -3px;
  margin-right: 10px;
  border-radius: 50% !important;
  border: none !important;
  object-fit: none !important;
  object-position: -9999px -9999px !important; /* hide GIF content */
}

/* Correct answer — green circle with checkmark */
.simplequiz_question_result > img.sq_correct_answer {
  background: #28c76f !important;
  box-shadow: inset 0 0 0 2px #28c76f, 0 0 0 1px rgba(40, 199, 111, 0.3);
}

/* Wrong answer — red circle with X */
.simplequiz_question_result > img.sq_wrong_answer {
  background: #ea5455 !important;
  box-shadow: inset 0 0 0 2px #ea5455, 0 0 0 1px rgba(234, 84, 85, 0.3);
}

/* Neutral/unselected answer — subtle empty circle */
.simplequiz_question_result > img:not(.sq_correct_answer):not(.sq_wrong_answer) {
  background: transparent !important;
  box-shadow: inset 0 0 0 2px #3a3a3f;
}

/* Make answer text nodes visible — can't style text nodes directly,
   but we can make the empty <p> between answers act as block separators */
.simplequiz_question_result > p:empty {
  display: block !important;
  height: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide the stray <div> and <br> before result span */
.simplequiz_question_result > div:empty,
.simplequiz_question_result > br {
  display: none !important;
}

/* --- Result Badge (Correcto / Incorrecto) --- */
.simplequiz_question_result .sq_result {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Correcto — green tint (default) */
.simplequiz_question_result .sq_result {
  background: rgba(40, 199, 111, 0.12);
  color: #28c76f;
  border: 1px solid rgba(40, 199, 111, 0.3);
}

/* Incorrecto — red tint (parent has .sq_wrong_answer img) */
.simplequiz_question_result:has(.sq_wrong_answer) .sq_result {
  background: rgba(234, 84, 85, 0.12);
  color: #ea5455;
  border: 1px solid rgba(234, 84, 85, 0.3);
}

/* Correct question card — subtle green left border accent */
.simplequiz_question_result:not(:has(.sq_wrong_answer)) {
  border-left: 3px solid rgba(40, 199, 111, 0.5);
}

/* Incorrect question card — subtle red left border accent */
.simplequiz_question_result:has(.sq_wrong_answer) {
  border-left: 3px solid rgba(234, 84, 85, 0.4);
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 576px) {
  /* Quiz list responsive */
  .com_simplequiz .simplequiz.quiz_item {
    padding: 12px 14px !important;
    gap: 12px;
  }

  .com_simplequiz .quiz_image img {
    width: 44px !important;
    height: 44px !important;
  }

  .com_simplequiz a.btn-take-quiz {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
  }

  /* Quiz view responsive */
  .demo-card:has(.sq_quiz) .demo-card-body,
  .demo-card:has(.simplequiz_detailed_results) .demo-card-body {
    padding: 20px 16px !important;
  }

  .simplequiz_question_result {
    padding: 16px !important;
  }

  .com_simplequiz .simplequiz_question img {
    max-width: 100%;
  }

  .com_simplequiz label.sq_label {
    max-width: 100%;
  }
}


/* ==========================================================================
   Simple Quiz — Report Card / Evaluaciones (Itemid 5174)
   Template override: conca/html/com_simplequiz/results/default.php
   ========================================================================== */

/* Strip Conca wrapper */
.itemid-5174 .demo-card:has(.sq-report-card),
.itemid-5174 .demo-card:has(.sq-report-card) .demo-card-body {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Strip .moduletable wrapper */
.itemid-5174 .moduletable {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* Strip Simple Quiz module padding (must beat .moduletable > :not(h3):not(.card-header) at 0,3,1) */
.itemid-5174 .com-content-article__body .moduletable > .mod_simplequiz {
  padding: 0 !important;
}

/* Hide article chrome */
.itemid-5174 .com-content-article .page-header,
.itemid-5174 .pagenavigation {
  display: none !important;
}

/* --- Report Card Container --- */
.sq-report-card {
  /* no wrapper card — table and chart are standalone */
}

/* --- Welcome Text --- */
.sq-report-welcome {
  color: #939397;
  font-size: 0.9rem;
  margin: 0 0 24px 0;
}

/* --- Coeficiente Musical — Horizontal Bar --- */
.sq-coeficiente-wrap {
  background: #1F1F21;
  border: 1px solid #2e2e33;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.sq-coeficiente-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.sq-coeficiente-label {
  color: #e0e0e5;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.sq-coeficiente-score {
  color: #939397;
  font-size: 0.8rem;
  font-weight: 500;
}

.sq-coeficiente-pct {
  color: #7367f0;
  font-size: 0.95rem;
  font-weight: 700;
}

.sq-coeficiente-bar {
  height: 10px;
  background: rgba(115, 103, 240, 0.12);
  border-radius: 5px;
  overflow: hidden;
}

.sq-coeficiente-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #5F4AFE, #7367f0);
  transition: width 0.8s ease;
}

/* --- Chart Section Title --- */
.sq-chart-title {
  color: #939397;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 8px 4px 12px;
}

/* --- Chart Wrapper --- */
.sq-report-chart-wrap {
  background: #1F1F21;
  border: 1px solid #2e2e33;
  border-radius: 12px;
  padding: 20px 16px 8px 8px;
  margin-bottom: 20px;
}

/* --- Results Table --- */
.sq-report-table-wrap {
  background: #1F1F21;
  border: 1px solid #2e2e33;
  border-radius: 12px;
  overflow: hidden;
}

.sq-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

/* Header */
.sq-report-table thead th {
  background: rgba(255, 255, 255, 0.03);
  color: #939397;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #2e2e33;
}

/* Rows */
.sq-report-table tbody tr {
  border-bottom: 1px solid #2e2e33;
  transition: background-color 0.15s ease;
}

.sq-report-table tbody tr:last-child {
  border-bottom: none;
}

.sq-report-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Cells */
.sq-report-table tbody td {
  padding: 14px 16px;
  color: #c8c8cd;
  vertical-align: middle;
}

/* Column: # */
.sq-col-num {
  width: 48px;
  text-align: center !important;
  color: #57575a !important;
}

.sq-report-table tbody td.sq-col-num {
  color: #57575a;
  font-weight: 500;
}

/* Column: Name */
.sq-col-name {
  font-weight: 500;
  color: #e0e0e5;
}

.sq-report-table tbody td.sq-col-name {
  color: #e0e0e5;
  font-weight: 500;
}

/* Column: Score */
.sq-col-score {
  width: 100px;
}

/* Column: Percentage badge */
.sq-col-pct {
  width: 120px;
}

.sq-pct-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.sq-pct-pass {
  background: rgba(40, 199, 111, 0.12);
  color: #28c76f;
  border: 1px solid rgba(40, 199, 111, 0.25);
}

.sq-pct-fail {
  background: rgba(234, 84, 85, 0.12);
  color: #ea5455;
  border: 1px solid rgba(234, 84, 85, 0.25);
}

/* --- Coeficiente row highlight in table --- */
.sq-row-coeficiente {
  background: rgba(115, 103, 240, 0.04);
}

.sq-row-coeficiente td.sq-col-name {
  color: #9f92fe !important;
}

/* --- Section Summary Bars --- */
.sq-section-summary {
  background: #1F1F21;
  border: 1px solid #2e2e33;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sq-summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sq-summary-label {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 90px;
  flex-shrink: 0;
}

.sq-summary-label i {
  font-size: 0.9rem;
}

.sq-summary-label span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sq-summary-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.sq-summary-bar-fill {
  height: 100%;
  border-radius: 4px;
  opacity: 0.75;
  transition: width 0.8s ease;
}

.sq-summary-pct {
  font-size: 0.8rem;
  font-weight: 700;
  width: 42px;
  text-align: right;
  flex-shrink: 0;
}

/* Results page — section headers above each table card (reuse tests page sq-section-header) */
.itemid-5174 .sq-section-header {
  padding-top: 1.2rem;
  padding-bottom: 0.5rem;
  font-size: 1rem;
}
.itemid-5174 .sq-section-header:first-of-type {
  padding-top: 0;
}

/* --- Empty state --- */
.sq-report-empty {
  color: #57575a;
  font-size: 0.9rem;
  text-align: center;
  padding: 40px 20px;
}

/* --- "VOLVER A QUIZZES" Button (in article body, outside module) --- */
.itemid-5174 .com-content-article__body > p:has(.button-link) {
  margin-top: 20px;
  text-align: left !important;
}

.itemid-5174 .button-link {
  text-decoration: none !important;
}

.itemid-5174 .button-news {
  background: rgba(115, 103, 240, 0.15) !important;
  color: #7367f0 !important;
  border: 1px solid rgba(115, 103, 240, 0.55) !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.itemid-5174 .button-news:hover {
  background: rgba(115, 103, 240, 0.28) !important;
  color: #9f92fe !important;
  border-color: rgba(115, 103, 240, 0.7) !important;
  box-shadow: 0 0 0 1px rgba(115, 103, 240, 0.25);
}

/* --- Responsive --- */
@media (max-width: 576px) {
  .sq-report-table thead th,
  .sq-report-table tbody td {
    padding: 10px 12px;
    font-size: 0.825rem;
  }

  .sq-col-num {
    width: 36px;
  }

  .sq-col-score,
  .sq-col-pct {
    width: auto;
  }

  .sq-report-chart-wrap {
    padding: 12px 8px 4px 0;
  }
}

/* Tests page — Section headers */
.sq-section-header {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 1.5rem 20px 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #57575a;
  list-style: none;
  /* no border — the card's rounded top and row separators provide enough structure */
}
.sq-section-header:first-child {
  padding-top: 1rem;
}
.sq-section-header i {
  font-size: 1rem;
}
/* Per-section accent color */
.sq-section-general { color: #ea5455; }
.sq-section-general i { color: #ea5455; }
.sq-section-teoria { color: #7367f0; }
.sq-section-teoria i { color: #7367f0; }
.sq-section-oido { color: #00cfe8; }
.sq-section-oido i { color: #00cfe8; }
.sq-section-teclado { color: #28c76f; }
.sq-section-teclado i { color: #28c76f; }

/* Results page — empty state */
.sq-report-empty-state {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 28px 28px 24px;
  background: #1F1F21;
  border: 1px solid #2e2e33;
  border-left: 4px solid #2e2e33;
  border-radius: 12px;
}

.sq-report-empty-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(115, 103, 240, 0.12);
  color: #7367f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.sq-report-empty-body {
  flex: 1;
  min-width: 0;
}

.sq-report-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: #c8c8cd;
  margin: 0 0 6px 0;
}

.sq-report-empty-text {
  font-size: 0.875rem;
  color: #939397;
  margin: 0 0 18px 0;
  line-height: 1.5;
}

.sq-report-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  background: rgba(115, 103, 240, 0.15);
  border: 1px solid rgba(115, 103, 240, 0.55);
  color: #7367f0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sq-report-empty-btn:hover {
  background: rgba(115, 103, 240, 0.28);
  border-color: rgba(115, 103, 240, 0.7);
  color: #9f92fe;
  box-shadow: 0 0 0 1px rgba(115, 103, 240, 0.25);
}

/* Quiz question text — spacing between question and first answer */
.simplequiz_question > p:nth-child(2) {
    margin-bottom: 12px !important;
}

/* Tests page — Ver mis resultados link */
.sq-results-link-wrap {
  margin-top: 1.5rem;
  text-align: right;
}
.sq-results-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.9rem;
  color: #7367f0;
  text-decoration: none;
  transition: color 0.2s ease;
}
.sq-results-link:hover {
  color: #9f92fe;
}
.sq-results-link i {
  font-size: 1rem;
}
