/* HTMX indicators */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }

/* Content body styles (rich HTML from editor) */
.content-body h1 { font-size: 1.75em; font-weight: 700; margin: 0.5em 0; }
.content-body h2 { font-size: 1.4em; font-weight: 700; margin: 0.6em 0; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.3em; }
.content-body h3 { font-size: 1.2em; font-weight: 600; margin: 0.6em 0; }
.content-body h4 { font-size: 1.05em; font-weight: 600; margin: 0.6em 0; }
.content-body p { margin: 0.6em 0; line-height: 1.7; }
.content-body a { color: var(--c-600); text-decoration: underline; }
.content-body a:hover { color: var(--c-800); }
.content-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 0.75em 0; }
.content-body ul, .content-body ol { padding-left: 1.25em; margin: 0.6em 0; }
.content-body li { margin: 0.2em 0; line-height: 1.6; }

/* Responsive tables */
.content-body table { border-collapse: collapse; width: 100%; margin: 0.75em 0; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.content-body td, .content-body th { border: 1px solid #d1d5db; padding: 6px 10px; text-align: left; white-space: nowrap; }
.content-body th { background-color: #f3f4f6; font-weight: 600; }

.content-body blockquote { border-left: 4px solid var(--c-500); padding-left: 1em; margin: 0.75em 0; color: #4b5563; font-style: italic; }

/* Responsive code blocks */
.content-body pre { background: #1e293b; color: #e2e8f0; padding: 0.75em; border-radius: 8px; overflow-x: auto; margin: 0.75em 0; font-size: 0.85em; -webkit-overflow-scrolling: touch; }
.content-body code { background: #f1f5f9; padding: 2px 5px; border-radius: 4px; font-size: 0.85em; word-break: break-word; }
.content-body pre code { background: none; padding: 0; word-break: normal; }
.content-body hr { border: none; border-top: 2px solid #e5e7eb; margin: 1.5em 0; }
.content-body figure { margin: 0.75em 0; text-align: center; }
.content-body figcaption { font-size: 0.875em; color: #6b7280; margin-top: 0.5em; }

/* Responsive videos and iframes */
.content-body video, .content-body iframe { max-width: 100%; height: auto; margin: 0.75em 0; border-radius: 8px; }
.content-body video { width: 100%; }

.content-body-mini p { margin: 0.25em 0; line-height: 1.5; }

/* Mobile font adjustments */
@media (max-width: 640px) {
    .content-body h1 { font-size: 1.5em; }
    .content-body h2 { font-size: 1.25em; }
    .content-body h3 { font-size: 1.1em; }
    .content-body p, .content-body li { font-size: 0.95em; }
    .content-body td, .content-body th { padding: 4px 8px; font-size: 0.85em; }
    .content-body pre { font-size: 0.8em; padding: 0.6em; }
}

/* Player sidebar */
.player-sidebar { transition: width 0.2s ease, opacity 0.2s ease; }
.player-sidebar.collapsed { width: 0; opacity: 0; overflow: hidden; padding: 0; }

/* Accordion arrow rotation */
details[open] > summary .accordion-arrow { transform: rotate(180deg); }
.accordion-arrow { transition: transform 0.2s ease; }

/* Course card hover */
.course-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); }

/* Progress bar animation */
.progress-fill { transition: width 0.5s ease; }

/* Theme swatch selector */
.theme-swatch { width: 2.5rem; height: 2.5rem; border-radius: 9999px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; border: 3px solid transparent; }
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: #1f2937; box-shadow: 0 0 0 2px white, 0 0 0 4px #1f2937; }

/* AI chat message formatting */
.ai-msg strong { font-weight: 600; color: #111827; }
.ai-msg em { font-style: italic; }
.ai-msg a { color: var(--c-600); text-decoration: underline; }
.ai-msg a:hover { color: var(--c-800); }
.ai-msg code { font-size: 0.85em; background: #f1f5f9; padding: 1px 4px; border-radius: 3px; }
.ai-msg ul, .ai-msg ol { margin-top: 6px; }
.ai-msg li { margin-bottom: 3px; }
.ai-msg p + p { margin-top: 8px; }
