/* Custom styles to override Bootstrap defaults */

/* Layout adjustments for full height and main content min-height */
html {
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

main {
  flex-grow: 1;
  min-height: 80vh; /* Minimum 80% of viewport height */
}

.page-content > h1 {
  font-family: 'Merriweather', serif;
  /* font-weight: 700; */
  margin: 1.5rem 0;
  color: #5A8CBF;
}

/* Markdown Content Styling */
.markdown-content {
  line-height: 1.6;
  color: #333;
}

/* Headers */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.markdown-content h1 { font-size: 2rem; border-bottom: 1px solid #eaecef; padding-bottom: 0.3rem; }
.markdown-content h2 { font-size: 1.5rem; border-bottom: 1px solid #eaecef; padding-bottom: 0.3rem; }
.markdown-content h3 { font-size: 1.25rem; }
.markdown-content h4 { font-size: 1rem; }
.markdown-content h5 { font-size: 0.875rem; }
.markdown-content h6 { font-size: 0.85rem; color: #6a737d; }

/* Paragraphs and spacing */
.markdown-content p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Lists */
.markdown-content ul,
.markdown-content ol {
  padding-left: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.markdown-content li {
  margin-bottom: 0.25rem;
}

.markdown-content li > ul,
.markdown-content li > ol {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Blockquotes */
.markdown-content blockquote {
  padding: 0.5rem 1rem;
  margin-left: 0;
  margin-right: 0;
  border-left: 0.25rem solid #dfe2e5;
  color: #6a737d;
}

.markdown-content blockquote > :first-child {
  margin-top: 0;
}

.markdown-content blockquote > :last-child {
  margin-bottom: 0;
}

/* Code blocks */
.markdown-content pre {
  background-color: #f6f8fa;
  border-radius: 3px;
  padding: 16px;
  overflow: auto;
  /* font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; */
  font-size: 85%;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.markdown-content code {
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  /* font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; */
  font-size: 85%;
  padding: 0.2em 0.4em;
  margin: 0;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: pre;
  overflow: visible;
}

/* Code block with syntax highlighting */
.markdown-content .code-block {
  position: relative;
  margin-bottom: 1rem;
}

.markdown-content .code-block .language-label {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: #6a737d;
  background-color: #f6f8fa;
  border-bottom-left-radius: 3px;
}

.markdown-content .highlight {
  background-color: #f6f8fa;
  border-radius: 3px;
  margin-bottom: 0;
}

/* Tables */
.markdown-content table {
  display: block;
  width: 100%;
  overflow: auto;
  border-spacing: 0;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.markdown-content table th {
  font-weight: 600;
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
  background-color: #f6f8fa;
}

.markdown-content table td {
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.markdown-content table tr {
  background-color: #fff;
  border-top: 1px solid #c6cbd1;
}

.markdown-content table tr:nth-child(2n) {
  background-color: #f6f8fa;
}

/* Links */
.markdown-content a {
  color: #0366d6;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

/* Images */
.markdown-content img {
  max-width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  border-radius: 3px;
}

/* Horizontal rule */
.markdown-content hr {
  height: 0.25em;
  padding: 0;
  margin: 24px 0;
  background-color: #e1e4e8;
  border: 0;
}

/* Custom asset elements */
.markdown-content .audio-player,
.markdown-content .video-player {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  border: 1px solid #e9ecef;
}

.markdown-content .audio-title,
.markdown-content .video-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #495057;
}

.markdown-content audio,
.markdown-content video {
  width: 100%;
  border-radius: 0.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.markdown-content video {
  max-height: 450px;
  background-color: #000;
}

.markdown-content .lesson-audio-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.markdown-content .lesson-audio-trigger {
  width: 1.45rem;
  height: 1.45rem;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f6feb;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.markdown-content .lesson-audio-trigger:hover {
  background: #0b57d0;
}

.markdown-content .lesson-audio-trigger:focus-visible {
  outline: 2px solid #0b57d0;
  outline-offset: 2px;
}

.markdown-content .lesson-audio-trigger i {
  font-size: 0.95rem;
}

.markdown-content .lesson-audio-chip.is-playing .lesson-audio-trigger {
  background: #198754;
}

.markdown-content .lesson-audio-element {
  display: none;
}

/* Breadcrumb styling */
.breadcrumb-item a {
  color: #5A8CBF; /* Darker shade of Argentina blue */
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: #75AADB; /* Argentina flag light blue */
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d; /* Bootstrap's default text-muted color */
}

/* Container widths for different screen sizes */
.container {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* For 1920x1080 screens and larger */
@media (min-width: 1600px) {
  .container {
    max-width: 1560px;
  }
}

@media (min-width: 1800px) {
  .container {
    max-width: 1740px;
  }
}

@media (min-width: 1920px) {
  .container {
    max-width: 1860px;
  }
}

/* Lab Work Cards Styling */
.lab-works-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lab-work-card {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: all 0.3s ease;
}

.lab-work-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.lab-work-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 1rem;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.lab-work-card .card-body {
  padding: 1.5rem;
}

.lab-work-card .card-header h5 {
  margin-bottom: 0;
  font-weight: 600;
  color: #495057;
}

.lab-work-card .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

/* Header colors based on user role & Footer legend swatches */
.navbar-admin, .admin-swatch {
  background-color: #343a40 !important; /* Bootstrap dark gray */
}

.navbar-teacher, .teacher-swatch {
  background-color: #198754 !important; /* Bootstrap success green */
}

.navbar-student, .student-swatch {
  background-color: #0d6efd !important; /* Bootstrap primary blue */
}

.color-swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 1px solid #6c757d; /* Muted gray border */
  margin-right: 0.25em;
  vertical-align: middle;
}

.lesson-content img {
  max-width: 100%;
  height: auto;
}
/* Dev auth: keep long impersonation lists scrollable inside each card. */
.dev-auth-user-list {
  max-height: 32rem;
  overflow-y: auto;
}
/* Lesson styles */
.lesson-list {
  list-style: none;
  padding: 0;
}

.lesson-item {
  padding-top: 1rem;
  border-bottom: 1px solid #ddd;
}

.lesson-item.completed {
  background-color: #E6F2FF; /* Very light blue, inspired by Argentina flag */
}

.lesson-item.completed .lesson-title::before {
  content: "✓ ";
  color: #F9C74F; /* Golden yellow, inspired by Argentina flag sun */
}


.lesson-content {
  font-size: 1.1rem;
  line-height: 1.6;
  column-gap: 2rem;
}

/* Column classes for different column counts */
@media (min-width: 1200px) {
  .lesson-content.columns-1 {
    columns: 1;
  }

  .lesson-content.columns-2 {
    columns: 2;
  }

  .lesson-content.columns-3 {
    columns: 3;
  }

  .lesson-content.columns-4 {
    columns: 4;
  }
}

/* Always use single column on smaller screens */
@media (max-width: 1199px) {
  .lesson-content {
    columns: 1;
  }
}

.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4,
.lesson-content h5,
.lesson-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.lesson-content ul,
.lesson-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.lesson-content blockquote {
  border-left: 4px solid #007bff;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.25rem;
}

.lesson-content code {
  background-color: #f8f9fa;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.lesson-content pre {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 * Stylesheets are required explicitly so theme-dark.css always loads last and
 * wins over the light defaults below. Add new files to this list.
 *




 */

/* Global styles */
:root {
    --bs-font-sans-serif: 'Merriweather', serif !important;
    --bs-font-serif: 'Merriweather', serif !important;
    --bs-font-monospace: 'Victor Mono', monospace !important;
}

.container {
  padding: 20px;
}

/* Header styles */
header {
  background-color: #75AADB; /* Argentina flag light blue */
  color: white;
  padding: 1rem 0;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: none;
  color: #F9C74F; /* Golden yellow, inspired by Argentina flag sun */
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Form styles */
.form-group {
  margin-bottom: 1rem;
}

label {
  font-weight: 700;
}

/* Card styles */
.card-header {
  background-color: #E6F2FF; /* Very light blue, inspired by Argentina flag */
  border-bottom: 1px solid #ddd;
}

/* Theme toggle */
.theme-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Alert styles */
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background-color: #FFF8E6; /* Very light gold */
  color: #856404;
  border: 1px solid #F9C74F; /* Golden yellow, inspired by Argentina flag sun */
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #E6F2FF; /* Very light blue, inspired by Argentina flag */
  font-weight: bold;
}

tr:hover {
  background-color: #f8f9fa;
}

/* Course styles */
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.course-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-top: 3px solid #75AADB; /* Argentina flag light blue border */
}

.course-card .card-body {
  flex-grow: 1;
}

.course-card:hover {
  box-shadow: 0 4px 8px rgba(117, 170, 219, 0.3); /* Light blue shadow on hover */
}

.level-beginner {
  background-color: #E6F2FF; /* Very light blue, inspired by Argentina flag */
  color: #5A8CBF; /* Darker shade of Argentina blue */
}

.level-intermediate {
  background-color: #FFF8E6; /* Very light gold */
  color: #856404;
}

.level-advanced {
  background-color: #75AADB; /* Argentina flag light blue */
  color: white;
}

/* Progress bar */
.progress-container {
  background-color: #e9ecef;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 20px;
  background-color: #F9C74F; /* Golden yellow, inspired by Argentina flag sun */
  border-radius: 4px;
  text-align: center;
  color: #333; /* Darker text for better readability on yellow */
  font-size: 0.875rem;
  line-height: 20px;
}

/* Dashboard styles */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  text-align: center;
  border-top: 3px solid #75AADB; /* Argentina flag light blue border */
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  margin: 0.5rem 0;
  color: #5A8CBF; /* Darker shade of Argentina blue */
}

.stat-label {
  color: #6c757d;
  font-size: 0.875rem;
}
/*
 * Dark theme overrides.
 *
 * Activated by data-bs-theme="dark" on <html> (set by
 * app/views/layouts/_theme_initializer.html.erb before first paint).
 *
 * Bootstrap 5.3 flips its own CSS variables, so components (cards, tables,
 * dropdowns, modals, forms, list groups) follow automatically. The rules below
 * only cover the hard-coded light colours used by application.css, custom.css
 * and lesson.css.
 */

[data-bs-theme="dark"] {
  --la-accent: #8ec5f5;
  --la-accent-soft: rgba(117, 170, 219, 0.18);
  --la-hover-bg: rgba(255, 255, 255, 0.05);
}

/* Headings and dashboard figures */
[data-bs-theme="dark"] .page-content > h1,
[data-bs-theme="dark"] .stat-value {
  color: var(--la-accent);
}

/* Cards */
[data-bs-theme="dark"] .card-header {
  background-color: var(--bs-tertiary-bg);
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .stat-card {
  background-color: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .stat-label {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .course-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

/* Tables */
[data-bs-theme="dark"] th {
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] th,
[data-bs-theme="dark"] td {
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] tr:hover {
  background-color: var(--la-hover-bg);
}

/* Alerts */
[data-bs-theme="dark"] .alert-danger {
  background-color: #3b1f22;
  color: #f1b0b7;
  border-color: #6d2b31;
}

[data-bs-theme="dark"] .alert-info {
  background-color: #332b12;
  color: #ffd97a;
  border-color: #7a6420;
}

/* Course level badges */
[data-bs-theme="dark"] .level-beginner {
  background-color: var(--la-accent-soft);
  color: #a6cff2;
}

[data-bs-theme="dark"] .level-intermediate {
  background-color: rgba(249, 199, 79, 0.2);
  color: #f6d58a;
}

[data-bs-theme="dark"] .level-advanced {
  background-color: #3d6f9e;
  color: #fff;
}

/* Progress bar */
[data-bs-theme="dark"] .progress-container {
  background-color: var(--bs-secondary-bg);
}

/* Markdown content */
[data-bs-theme="dark"] .markdown-content {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .markdown-content h1,
[data-bs-theme="dark"] .markdown-content h2 {
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .markdown-content h6 {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .markdown-content blockquote {
  border-left-color: var(--bs-border-color);
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .markdown-content pre,
[data-bs-theme="dark"] .markdown-content .highlight,
[data-bs-theme="dark"] .markdown-content .code-block .language-label,
[data-bs-theme="dark"] .markdown-content .audio-player,
[data-bs-theme="dark"] .markdown-content .video-player {
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .markdown-content .audio-player,
[data-bs-theme="dark"] .markdown-content .video-player {
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .markdown-content .audio-title,
[data-bs-theme="dark"] .markdown-content .video-title {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .markdown-content code {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .markdown-content pre code {
  background-color: transparent;
}

[data-bs-theme="dark"] .markdown-content table th,
[data-bs-theme="dark"] .markdown-content table td {
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .markdown-content table th {
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .markdown-content table tr {
  background-color: transparent;
  border-top-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .markdown-content table tr:nth-child(2n) {
  background-color: var(--la-hover-bg);
}

[data-bs-theme="dark"] .markdown-content img {
  background-color: transparent;
}

[data-bs-theme="dark"] .markdown-content hr {
  background-color: var(--bs-border-color);
}

/* Links */
[data-bs-theme="dark"] .markdown-content a,
[data-bs-theme="dark"] .breadcrumb-item a {
  color: var(--bs-link-color);
}

[data-bs-theme="dark"] .markdown-content a:hover,
[data-bs-theme="dark"] .breadcrumb-item a:hover {
  color: var(--bs-link-hover-color);
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: var(--bs-secondary-color);
}

/* Lab work cards */
[data-bs-theme="dark"] .lab-work-card {
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .lab-work-card .card-header {
  background-color: var(--bs-tertiary-bg);
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .lab-work-card .card-header h5 {
  color: var(--bs-body-color);
}

/* Lesson lists and content */
[data-bs-theme="dark"] .lesson-item {
  border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .lesson-item.completed {
  background-color: var(--la-accent-soft);
}

[data-bs-theme="dark"] .lesson-content blockquote,
[data-bs-theme="dark"] .lesson-content code,
[data-bs-theme="dark"] .lesson-content pre {
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .lesson-content blockquote {
  border-left-color: var(--bs-primary);
}

/* Utility classes that would otherwise stay light in dark mode */
[data-bs-theme="dark"] .bg-light {
  background-color: var(--bs-secondary-bg) !important;
}

[data-bs-theme="dark"] .bg-white {
  background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] .bg-light.text-dark,
[data-bs-theme="dark"] .bg-white.text-dark {
  color: var(--bs-body-color) !important;
}
