/**
 * Jazda po zysk — Tutor LMS dark mode contrast fixes
 *
 * Root cause: Nori core.css sets global
 *   table tbody tr:nth-child(even) { background: #f5f7f8; }
 * which paints light zebra rows over Tutor tables while Tutor dark theme
 * uses light text → unreadable. Also course-info headings stay dark on dark bg.
 */
/* --- Tables / zebra rows --- */
html[data-tutor-theme="dark"] table.tutor-table tbody tr:nth-child(even),
html[data-tutor-theme="dark"] .tutor-table tbody tr:nth-child(even),
html[data-tutor-theme="dark"] .tutor-table-wrapper table tbody tr:nth-child(even),
html[data-tutor-theme="dark"] .tutor-course-info-table table tbody tr:nth-child(even),
body.dark-mode-on table.tutor-table tbody tr:nth-child(even),
body.dark-mode-on .tutor-table tbody tr:nth-child(even),
body.dark-mode-on .tutor-table-wrapper table tbody tr:nth-child(even),
body.dark-mode-on .tutor-course-info-table table tbody tr:nth-child(even),
body.tutor-screen-course-learning table.tutor-table tbody tr:nth-child(even),
body.tutor-screen-course-learning .tutor-table-wrapper table tbody tr:nth-child(even) {
  background: var(--tutor-surface-l2, #2d3039) !important;
  background-color: var(--tutor-surface-l2, #2d3039) !important;
}

html[data-tutor-theme="dark"] table.tutor-table tbody tr:nth-child(odd),
html[data-tutor-theme="dark"] .tutor-table tbody tr:nth-child(odd),
html[data-tutor-theme="dark"] .tutor-table-wrapper table tbody tr:nth-child(odd),
body.dark-mode-on table.tutor-table tbody tr:nth-child(odd),
body.dark-mode-on .tutor-table-wrapper table tbody tr:nth-child(odd),
body.tutor-screen-course-learning .tutor-table-wrapper table tbody tr:nth-child(odd) {
  background: transparent !important;
  background-color: transparent !important;
}

html[data-tutor-theme="dark"] table.tutor-table,
html[data-tutor-theme="dark"] .tutor-table,
html[data-tutor-theme="dark"] .tutor-table-wrapper table,
body.dark-mode-on table.tutor-table,
body.dark-mode-on .tutor-table-wrapper table,
body.tutor-screen-course-learning .tutor-table-wrapper table {
  background-color: var(--tutor-surface-l1, #1f242f) !important;
  color: var(--tutor-text-primary, #f0f1f1) !important;
  border-color: var(--tutor-border-idle, #333741) !important;
}

html[data-tutor-theme="dark"] table.tutor-table td,
html[data-tutor-theme="dark"] table.tutor-table th,
html[data-tutor-theme="dark"] .tutor-table td,
html[data-tutor-theme="dark"] .tutor-table th,
html[data-tutor-theme="dark"] .tutor-table-wrapper td,
html[data-tutor-theme="dark"] .tutor-table-wrapper th,
body.dark-mode-on table.tutor-table td,
body.dark-mode-on table.tutor-table th,
body.dark-mode-on .tutor-table-wrapper td,
body.dark-mode-on .tutor-table-wrapper th,
body.tutor-screen-course-learning .tutor-table-wrapper td,
body.tutor-screen-course-learning .tutor-table-wrapper th {
  color: var(--tutor-text-primary, #f0f1f1) !important;
  border-color: var(--tutor-border-idle, #333741) !important;
}

html[data-tutor-theme="dark"] .tutor-course-info-table tr:hover,
body.dark-mode-on .tutor-course-info-table tr:hover,
body.tutor-screen-course-learning .tutor-course-info-table tr:hover {
  background-color: var(--tutor-surface-l1-hover, #2d3039) !important;
}

/* --- Course info / about content headings --- */
html[data-tutor-theme="dark"] .tutor-course-info,
html[data-tutor-theme="dark"] .tutor-course-info-content,
html[data-tutor-theme="dark"] .tutor-course-details-content,
body.dark-mode-on .tutor-course-info,
body.dark-mode-on .tutor-course-info-content,
body.tutor-screen-course-learning .tutor-course-info {
  color: var(--tutor-text-secondary, #cecfd2) !important;
}

html[data-tutor-theme="dark"] .tutor-course-info h1,
html[data-tutor-theme="dark"] .tutor-course-info h2,
html[data-tutor-theme="dark"] .tutor-course-info h3,
html[data-tutor-theme="dark"] .tutor-course-info h4,
html[data-tutor-theme="dark"] .tutor-course-info h5,
html[data-tutor-theme="dark"] .tutor-course-info h6,
html[data-tutor-theme="dark"] .tutor-course-info strong,
html[data-tutor-theme="dark"] .tutor-course-info b,
html[data-tutor-theme="dark"] .tutor-course-info .tutor-course-intro,
html[data-tutor-theme="dark"] .tutor-course-details-content h1,
html[data-tutor-theme="dark"] .tutor-course-details-content h2,
html[data-tutor-theme="dark"] .tutor-course-details-content h3,
html[data-tutor-theme="dark"] .tutor-course-details-content h4,
html[data-tutor-theme="dark"] .tutor-course-details-content strong,
body.dark-mode-on .tutor-course-info h1,
body.dark-mode-on .tutor-course-info h2,
body.dark-mode-on .tutor-course-info h3,
body.dark-mode-on .tutor-course-info h4,
body.dark-mode-on .tutor-course-info h5,
body.dark-mode-on .tutor-course-info h6,
body.dark-mode-on .tutor-course-info strong,
body.dark-mode-on .tutor-course-details-content h1,
body.dark-mode-on .tutor-course-details-content h2,
body.dark-mode-on .tutor-course-details-content h3,
body.dark-mode-on .tutor-course-details-content strong,
body.tutor-screen-course-learning .tutor-course-info h1,
body.tutor-screen-course-learning .tutor-course-info h2,
body.tutor-screen-course-learning .tutor-course-info h3,
body.tutor-screen-course-learning .tutor-course-info h4,
body.tutor-screen-course-learning .tutor-course-info strong {
  color: var(--tutor-text-primary, #f0f1f1) !important;
}

html[data-tutor-theme="dark"] .tutor-course-info a,
html[data-tutor-theme="dark"] .tutor-course-intro a,
body.dark-mode-on .tutor-course-info a,
body.tutor-screen-course-learning .tutor-course-info a {
  color: var(--tutor-text-brand, #4979e8) !important;
}

/* Meta labels / muted text that Nori leaves too dark */
html[data-tutor-theme="dark"] .tutor-course-info .tutor-meta-value,
html[data-tutor-theme="dark"] .tutor-color-muted,
html[data-tutor-theme="dark"] .tutor-color-black,
html[data-tutor-theme="dark"] .tutor-color-secondary,
body.dark-mode-on .tutor-color-muted,
body.dark-mode-on .tutor-color-black,
body.tutor-screen-course-learning .tutor-color-muted,
body.tutor-screen-course-learning .tutor-color-black {
  color: var(--tutor-text-secondary, #cecfd2) !important;
}

/* System theme: when OS prefers dark but attr still "system", rely on prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  html[data-tutor-theme="system"] table.tutor-table tbody tr:nth-child(even),
  html[data-tutor-theme="system"] .tutor-table-wrapper table tbody tr:nth-child(even),
  html[data-tutor-theme="system"] .tutor-course-info-table table tbody tr:nth-child(even) {
    background: var(--tutor-surface-l2, #2d3039) !important;
    background-color: var(--tutor-surface-l2, #2d3039) !important;
  }
  html[data-tutor-theme="system"] .tutor-course-info h1,
  html[data-tutor-theme="system"] .tutor-course-info h2,
  html[data-tutor-theme="system"] .tutor-course-info h3,
  html[data-tutor-theme="system"] .tutor-course-info h4,
  html[data-tutor-theme="system"] .tutor-course-info strong,
  html[data-tutor-theme="system"] .tutor-course-details-content h2,
  html[data-tutor-theme="system"] .tutor-course-details-content h3 {
    color: var(--tutor-text-primary, #f0f1f1) !important;
  }
}
/* Broader Tutor LMS shell (learning area uses body.tutor-lms) */
body.tutor-lms table.tutor-table tbody tr:nth-child(even),
body.tutor-lms .tutor-table tbody tr:nth-child(even),
body.tutor-lms .tutor-table-wrapper table tbody tr:nth-child(even),
body.tutor-lms .tutor-course-info-table table tbody tr:nth-child(even) {
  background: var(--tutor-surface-l2, #2d3039) !important;
  background-color: var(--tutor-surface-l2, #2d3039) !important;
}
html[data-tutor-theme="light"] body.tutor-lms table.tutor-table tbody tr:nth-child(even),
html[data-tutor-theme="light"] body.tutor-lms .tutor-table-wrapper table tbody tr:nth-child(even) {
  /* keep light zebra only in explicit light theme */
  background: #f5f7f8 !important;
  background-color: #f5f7f8 !important;
}
/* When dark theme OR system+dark: override Nori core.css white zebra */
html[data-tutor-theme="dark"] body.tutor-lms table tbody tr:nth-child(even),
html[data-tutor-theme="dark"] body.tutor-lms table tbody tr:nth-child(even) td,
body.tutor-lms[data-tutor-theme="dark"] table tbody tr:nth-child(even),
body.dark-mode-on.tutor-lms table tbody tr:nth-child(even),
body.dark-mode-on.tutor-lms table tbody tr:nth-child(even) td {
  background: var(--tutor-surface-l2, #2d3039) !important;
  background-color: var(--tutor-surface-l2, #2d3039) !important;
  color: var(--tutor-text-primary, #f0f1f1) !important;
}
body.tutor-lms.dark-mode-on .tutor-course-info h1,
body.tutor-lms.dark-mode-on .tutor-course-info h2,
body.tutor-lms.dark-mode-on .tutor-course-info h3,
body.tutor-lms.dark-mode-on .tutor-course-info h4,
body.tutor-lms.dark-mode-on .tutor-course-info strong,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-course-info h1,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-course-info h2,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-course-info h3,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-course-info h4,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-course-info strong {
  color: #f0f1f1 !important;
}
/* Quiz summary / reviews: bump low-contrast subdued text in dark mode */
html[data-tutor-theme="dark"] body.tutor-lms .tutor-text-subdued,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-quiz-summary .tutor-sm-text-tiny,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-quiz-result-static-item,
body.tutor-lms.dark-mode-on .tutor-text-subdued,
body.dark-mode-on.tutor-lms .tutor-text-subdued {
  color: #b8bcc8 !important;
}
html[data-tutor-theme="dark"] body.tutor-lms .tutor-quiz-result-static-item.correct,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-quiz-result-static-item.incorrect,
html[data-tutor-theme="dark"] body.tutor-lms .tutor-quiz-result-static-item.total {
  color: #c5c9d4 !important;
}