/* Sruja docs – custom overrides for a polished docs-site look */

/* ---- Top nav: Sruja logo (links to home) ---- */
.sruja-nav-logo {
    display: inline-flex;
    align-items: center;
    margin-inline-end: 4px;
}

.sruja-nav-logo-img {
    display: block;
    height: 28px;
    width: auto;
}

/* ---- Home page content logo ---- */
.sruja-home-logo {
    display: block;
    margin-block-end: 1em;
}

/* ---- Typography & layout ---- */
:root {
    --content-max-width: 820px;
    --page-padding: 24px;
    --sidebar-target-width: 280px;
    --menu-bar-height: 56px;
}

/* System font stack: readable and fast */
html {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
}

/* Content area: comfortable reading */
.content {
    line-height: 1.7;
    font-size: 1.6rem;
}

.content h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-block-end: 0.5em;
    padding-block-end: 0.4em;
    border-block-end: 2px solid var(--table-border-color);
}

.content h2 {
    font-size: 1.85rem;
    font-weight: 600;
    margin-block-start: 2.2em;
    margin-block-end: 0.6em;
}

.content h3 {
    font-size: 1.45rem;
    font-weight: 600;
    margin-block-start: 2em;
}

.content p {
    margin-block-end: 1.2em;
}

/* ---- Light theme: warm, clean docs feel ---- */
.light {
    --bg: hsl(36, 20%, 98%);
    --fg: hsl(220, 15%, 18%);
    --sidebar-bg: hsl(36, 15%, 96%);
    --sidebar-fg: hsl(220, 12%, 28%);
    --sidebar-active: hsl(220, 65%, 45%);
    --sidebar-non-existant: hsl(220, 8%, 55%);
    --sidebar-spacer: hsl(36, 12%, 92%);
    --links: hsl(220, 65%, 42%);
    --inline-code-color: hsl(260, 45%, 38%);
    --quote-bg: hsl(36, 25%, 94%);
    --quote-border: hsl(36, 20%, 85%);
    --table-border-color: hsl(36, 15%, 90%);
    --table-header-bg: hsl(36, 15%, 92%);
    --table-alternate-bg: hsl(36, 18%, 97%);
    --theme-popup-bg: hsl(36, 15%, 96%);
    --theme-popup-border: hsl(36, 12%, 88%);
    --theme-hover: hsl(36, 18%, 92%);
    --searchbar-bg: hsl(36, 15%, 96%);
    --searchresults-li-bg: hsl(220, 40%, 96%);
    --search-mark-bg: hsl(45, 90%, 88%);
    --sidebar-header-border-color: hsl(220, 65%, 45%);
}

/* ---- Dark (navy) theme: easy on the eyes ---- */
.navy {
    --bg: hsl(224, 22%, 9%);
    --fg: hsl(220, 15%, 88%);
    --sidebar-bg: hsl(224, 20%, 12%);
    --sidebar-fg: hsl(220, 12%, 82%);
    --sidebar-active: hsl(200, 70%, 55%);
    --quote-bg: hsl(224, 18%, 14%);
    --quote-border: hsl(224, 18%, 22%);
    --links: hsl(200, 75%, 55%);
    --inline-code-color: hsl(160, 45%, 75%);
}

/* ---- Code blocks ---- */
.content pre {
    border-radius: 8px;
    padding: 1.2em 1.4em;
    margin-block: 1.4em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.light .content pre {
    background: hsl(220, 14%, 96%);
    border: 1px solid hsl(220, 12%, 90%);
}

.content pre code {
    font-size: 0.9em;
    line-height: 1.55;
}

.content :not(pre) > code {
    padding: 0.18em 0.45em;
    border-radius: 4px;
    font-size: 0.9em;
}

.light .content :not(pre) > code {
    background: hsl(36, 25%, 92%);
    border: 1px solid hsl(36, 15%, 88%);
}

.navy .content :not(pre) > code {
    background: hsl(224, 18%, 18%);
    border: 1px solid hsl(224, 18%, 25%);
}

/* ---- Blockquotes & callouts ---- */
.content blockquote {
    border-inline-start-width: 4px;
    border-radius: 0 6px 6px 0;
    padding: 1em 1.2em;
    margin-block: 1.4em;
}

/* ---- Menu bar: subtle but clear ---- */
#mdbook-menu-bar {
    box-shadow: 0 1px 0 var(--table-border-color);
}

.light #mdbook-menu-bar {
    border-block-end-color: hsl(36, 15%, 90%);
}

/* ---- Sidebar ---- */
.chapter-item.active > .chapter-item-flex {
    font-weight: 600;
}

/* ---- Tables ---- */
.content table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content thead th {
    padding: 0.65em 1em;
    font-weight: 600;
}

.content tbody td {
    padding: 0.6em 1em;
}

/* ---- Lists ---- */
.content ul,
.content ol {
    margin-block-end: 1.2em;
    padding-inline-start: 1.6em;
}

.content li {
    margin-block-end: 0.35em;
}

/* ---- Links ---- */
.content a {
    text-underline-offset: 2px;
}

.content a:hover {
    text-decoration-thickness: 2px;
}

/* ---- Horizontal rule ---- */
.content hr {
    border: none;
    border-block-start: 1px solid var(--table-border-color);
    margin-block: 2em;
}

/* ---- Sruja code-block preview (rendered markdown) ---- */
.sruja-preview.sruja-preview-rendered {
    font-size: 0.95em;
    line-height: 1.6;
}

.sruja-preview.sruja-preview-rendered h1,
.sruja-preview.sruja-preview-rendered h2,
.sruja-preview.sruja-preview-rendered h3 {
    margin-block-end: 0.4em;
    font-weight: 600;
}

.sruja-preview.sruja-preview-rendered h1 {
    font-size: 1.4em;
}
.sruja-preview.sruja-preview-rendered h2 {
    font-size: 1.2em;
}
.sruja-preview.sruja-preview-rendered h3 {
    font-size: 1.1em;
}

.sruja-preview.sruja-preview-rendered p {
    margin-block-end: 0.8em;
}

.sruja-preview.sruja-preview-rendered ul,
.sruja-preview.sruja-preview-rendered ol {
    padding-inline-start: 1.4em;
    margin-block-end: 0.8em;
}

.sruja-preview.sruja-preview-rendered pre {
    background: var(--bg);
    padding: 10px 12px;
    border-radius: 6px;
    overflow: auto;
    margin-block: 0.8em;
}

.sruja-preview.sruja-preview-rendered code {
    font-size: 0.9em;
}

.sruja-preview.sruja-preview-rendered :not(pre) > code {
    background: var(--quote-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

/* ---- Course Progress Tracking ---- */

/* Progress container */
#sruja-progress-container {
    margin-block-end: 1.5em;
    padding: 1em;
    border-radius: 8px;
    background: var(--quote-bg);
    border: 1px solid var(--quote-border);
}

.light #sruja-progress-container {
    background: hsl(36, 25%, 94%);
    border-color: hsl(36, 20%, 85%);
}

.navy #sruja-progress-container {
    background: hsl(224, 18%, 14%);
    border-color: hsl(224, 18%, 22%);
}

/* Progress header with title and reset button */
.sruja-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-block-end: 0.75em;
}

.sruja-progress-title {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--fg);
}

.sruja-reset-btn {
    background: transparent;
    border: 1px solid var(--inline-code-color);
    border-radius: 4px;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    cursor: pointer;
    color: var(--fg);
    transition: all 0.2s ease;
}

.sruja-reset-btn:hover {
    background: var(--inline-code-color);
    color: white;
}

/* Progress bar container */
.sruja-progress-bar-container {
    height: 8px;
    background: var(--table-border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-block-end: 0.5em;
}

.light .sruja-progress-bar-container {
    background: hsl(36, 15%, 90%);
}

.navy .sruja-progress-bar-container {
    background: hsl(224, 18%, 22%);
}

/* Progress bar */
.sruja-progress-bar {
    height: 100%;
    transition:
        width 0.3s ease,
        background-color 0.3s ease;
    border-radius: 4px;
}

/* Progress states */
.sruja-progress-bar.sruja-progress-low {
    background: hsl(25, 85%, 55%);
}

.sruja-progress-bar.sruja-progress-medium {
    background: hsl(45, 90%, 55%);
}

.sruja-progress-bar.sruja-progress-high {
    background: hsl(145, 65%, 45%);
}

/* Progress text */
.sruja-progress-text {
    font-size: 0.85em;
    color: var(--sidebar-fg);
    text-align: center;
}

/* Lesson indicators in sidebar */
.sruja-lesson-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-inline-start: 0.5em;
    font-size: 0.75em;
    border-radius: 50%;
    font-weight: 600;
}

.sruja-lesson-visited {
    color: hsl(45, 90%, 55%);
}

.sruja-lesson-complete {
    color: hsl(145, 65%, 45%);
    font-size: 0.85em;
}

/* Hover effect on chapter items with progress */
.chapter-item:hover .sruja-lesson-indicator {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* ---- Interactive Quiz Styles (Markdown Checkboxes) ---- */

/* Quiz question container */
.quiz-question {
    margin-block: 2em;
    padding: 1.5em;
    border-radius: 8px;
    background: var(--quote-bg);
    border: 1px solid var(--quote-border);
}

.light .quiz-question {
    background: hsl(36, 25%, 94%);
    border-color: hsl(36, 20%, 85%);
}

.navy .quiz-question {
    background: hsl(224, 18%, 14%);
    border-color: hsl(224, 18%, 22%);
}

/* Question text */
.quiz-question strong:first-child {
    display: block;
    font-size: 1.1em;
    margin-block-end: 1em;
    font-weight: 600;
}

/* Quiz list (ul/ol with checkboxes) */
.content ul:has(input[type="checkbox"]),
.content ol:has(input[type="checkbox"]) {
    list-style: none;
    padding: 0;
    margin-block-end: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

/* Quiz option li */
.content ul li:has(input[type="checkbox"]),
.content ol li:has(input[type="checkbox"]) {
    padding: 0.75em 1em;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.light .content ul li:has(input[type="checkbox"]):hover,
.light .content ol li:has(input[type="checkbox"]):hover {
    background: hsl(36, 30%, 92%);
}

.navy .content ul li:has(input[type="checkbox"]):hover,
.navy .content ol li:has(input[type="checkbox"]):hover {
    background: hsl(224, 20%, 18%);
}

/* Checkbox input */
input[type="checkbox"] {
    cursor: pointer;
    margin-inline-end: 0.75em;
    transform: scale(1.2);
}

/* Correct option styling */
li.correct-option {
    border-color: hsl(145, 65%, 45%);
    background: hsl(145, 65%, 97%, 0.3);
}

.navy li.correct-option {
    background: hsl(145, 65%, 25%, 0.2);
}

/* Incorrect option styling */
li.incorrect-option {
    border-color: hsl(25, 85%, 55%);
    background: hsl(25, 85%, 97%, 0.3);
}

.navy li.incorrect-option {
    background: hsl(25, 85%, 25%, 0.2);
}

/* Check answer button */
.check-answer-btn {
    display: inline-block;
    padding: 0.6em 1.2em;
    background: hsl(220, 65%, 50%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-block-end: 1em;
}

.check-answer-btn:hover:not(:disabled) {
    background: hsl(220, 65%, 40%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.check-answer-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Answer feedback container */
.answer-feedback {
    display: none;
    padding: 1em;
    border-radius: 6px;
    margin-block-start: 1em;
    animation: fadeIn 0.3s ease;
}

.light .answer-feedback {
    background: hsl(220, 14%, 96%);
}

.navy .answer-feedback {
    background: hsl(224, 18%, 18%);
}

/* Feedback text */
.feedback-text {
    font-size: 1em;
    margin-block-end: 0.5em;
    font-weight: 600;
}

.feedback-correct {
    color: hsl(145, 65%, 45%);
}

.feedback-incorrect {
    color: hsl(25, 85%, 55%);
}

/* Explanation text */
.explanation {
    display: none;
    padding-top: 0.75em;
    border-top: 1px solid var(--table-border-color);
    font-size: 0.95em;
    line-height: 1.6;
    margin-block-start: 0.5em;
    color: var(--fg);
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
