/* ===== RESET ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f7fa;
  color: #333;
}

/* ===== LINKS ===== */
a {
  color: inherit;
}

/* ===== HEADER ===== */
.site-header {
  background: #0b3d62;
  color: white;
  border-bottom: 4px solid #07263d;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand a {
  color: white;
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: bold;
}

.top-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.top-nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.top-nav a:hover {
  text-decoration: underline;
}

/* ===== LAYOUT ===== */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
}

.sidebar {
  background: white;
  border-radius: 10px;
  padding: 20px;
  height: fit-content;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.sidebar h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.sidebar-user {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.sidebar-user p {
  margin: 0;
}

.sidebar-role {
  margin-top: 4px !important;
  color: #666;
  font-size: 0.95rem;
}

.module-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.module-nav li {
  margin-bottom: 10px;
}

.module-nav a {
  color: #0b3d62;
  text-decoration: none;
  line-height: 1.4;
}

.module-nav a:hover {
  text-decoration: underline;
}

.main-content {
  background: white;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 2.2rem;
  margin-top: 0;
  margin-bottom: 12px;
}

h2 {
  margin-top: 30px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 8px;
  font-size: 1.8rem;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

p,
li {
  line-height: 1.6;
}

/* ===== CALLOUT BOXES ===== */
.box {
  padding: 18px;
  border-radius: 8px;
  margin: 20px 0;
}

.objective {
  background-color: #e8f4ff;
  border-left: 5px solid #0077cc;
}

.reflection {
  background-color: #fff4e5;
  border-left: 5px solid #ff9800;
}

.key-point {
  background-color: #eaf7ea;
  border-left: 5px solid #4caf50;
}

/* ===== BUTTONS ===== */
.button,
.primary-button,
.inline-button {
  display: inline-block;
  padding: 10px 16px;
  background-color: #0077cc;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.button:hover,
.primary-button:hover,
.inline-button:hover {
  background-color: #005fa3;
  text-decoration: none;
}

.secondary-button {
  background-color: #6c757d;
}

.secondary-button:hover {
  background-color: #565e64;
}

/* ===== LESSON NAV ===== */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* ===== SCREEN READER ONLY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== QUIZ STYLES ===== */
.two-column-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.quiz-question {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.quiz-question.correct {
  background: #e8f7ec;
  border-left: 6px solid #2e7d32;
}

.quiz-question.incorrect {
  background: #fdecec;
  border-left: 6px solid #c62828;
}

.quiz-option {
  display: block;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 8px 0;
  cursor: pointer;
}

.quiz-option.correct-answer {
  border: 2px solid #2e7d32;
  background: #e8f7ec;
}

.quiz-option.wrong-answer {
  border: 2px solid #c62828;
  background: #fdecec;
}

.feedback-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #ddd;
}

.score-box {
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
}

.score-pass {
  background: #e8f7ec;
  border: 1px solid #2e7d32;
}

.score-fail {
  background: #fdecec;
  border: 1px solid #c62828;
}

.status-box {
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
  background: #fff8e1;
  border: 1px solid #b7791f;
}

.status-box.pass {
  background: #e8f7ec;
  border: 1px solid #2e7d32;
}

.next-module-lock {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #ddd;
}

.next-module-lock.pass {
  background: #e8f7ec;
  border: 1px solid #2e7d32;
}

.sidebar-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.rubric-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.rubric-table th,
.rubric-table td {
  border: 1px solid #ddd;
  padding: 10px;
}

.rubric-table th {
  background: #eef4fa;
}

/* ===== AI TUTOR ===== */
.tutor-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tutor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.tutor-header h1 {
  margin-bottom: 8px;
}

.tutor-subtitle {
  margin-top: 0;
  color: #555;
}

.tutor-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.tutor-panel {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chat-window {
  min-height: 350px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
}

/* ===== AUTH PAGES (MINIMAL ADDITIONS) ===== */
.auth-section {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: white;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.auth-header {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0077cc;
}

.auth-text {
  color: #555;
}

.auth-form {
  margin-top: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

.full-width {
  width: 100%;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
}

.auth-footer p,
.auth-note p {
  margin: 6px 0;
}

.text-link {
  color: #0077cc;
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.auth-note {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: #555;
  font-size: 0.95rem;
}

/* ===== FLASH MESSAGES (MINIMAL ADDITIONS) ===== */
.flash-stack {
  margin-bottom: 18px;
}

.flash-message {
  background: #fff8e1;
  border: 1px solid #e0c36c;
  color: #6b5200;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

/* ===== TABLES / ADMIN / PROGRESS (MINIMAL ADDITIONS) ===== */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.data-table th,
.data-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.data-table th {
  background: #eef4fa;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge.complete {
  background: #e8f7ec;
  color: #2e7d32;
}

.status-badge.progress {
  background: #fff8e1;
  color: #b7791f;
}

.status-badge.danger {
  background: #fdecec;
  color: #c62828;
}

.meta-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef4fa;
  color: #0b3d62;
  font-size: 0.84rem;
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .two-column-layout {
    grid-template-columns: 1fr;
  }

  .tutor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-nav {
    justify-content: flex-start;
  }
}

/* ===== BOOTSTRAP PHASE 1 COMPATIBILITY LAYER ===== */
/* Bootstrap is loaded first. These rules preserve the LMS identity while allowing Bootstrap utilities/components. */

:root {
  --gwi-blue: #0b3d62;
  --gwi-blue-dark: #07263d;
  --gwi-link: #0077cc;
  --gwi-soft-bg: #f5f7fa;
  --gwi-border: #dbe3ec;
  --gwi-shadow: 0 1px 4px rgba(0,0,0,0.08);
  --gwi-radius: 10px;
}

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

.page-shell {
  flex: 1 0 auto;
  padding: 24px 0;
}

.site-footer {
  background: #eef4fa;
  color: #475569;
  border-top: 1px solid #dbe3ec;
  margin-top: auto;
}

.footer-inner {
  padding: 16px 24px;
  text-align: center;
}

.footer-inner p {
  margin: 0;
}

.brand-block,
.brand {
  min-width: 240px;
}

.brand-link,
.brand a {
  color: white;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-link:hover,
.brand a:hover {
  color: white;
  text-decoration: none;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 500;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.main-nav a,
.top-nav a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.top-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}

.main-nav .nav-button,
.nav-button {
  background: #ffffff;
  color: var(--gwi-blue) !important;
  border-radius: 999px;
  padding: 8px 14px;
}

.main-nav .nav-button:hover,
.nav-button:hover {
  background: #e8f4ff;
  color: var(--gwi-blue) !important;
}

/* Keep custom buttons in control even when Bootstrap btn classes are also present. */
.button.btn,
.primary-button.btn,
.inline-button.btn {
  background-color: #0077cc;
  border-color: #0077cc;
  color: #fff;
  box-shadow: none;
}

.button.btn:hover,
.primary-button.btn:hover,
.inline-button.btn:hover {
  background-color: #005fa3;
  border-color: #005fa3;
  color: #fff;
}

.secondary-button.btn,
.button.secondary-button.btn {
  background-color: #6c757d;
  border-color: #6c757d;
}

.secondary-button.btn:hover,
.button.secondary-button.btn:hover {
  background-color: #565e64;
  border-color: #565e64;
}

.quiz-layout-single {
  grid-template-columns: 1fr;
}

/* Dashboard Phase 1 */
.dashboard-page .eyebrow,
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0077cc;
}

.dashboard-lead {
  color: #475569;
  font-size: 1.05rem;
}

.dashboard-actions {
  margin-top: 14px;
}

.dashboard-card {
  background: white;
  border: 1px solid var(--gwi-border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--gwi-shadow);
}

.dashboard-card-green {
  background: linear-gradient(135deg, #ffffff, #eaf7ea);
  border-left: 5px solid #4caf50;
}

.dashboard-card-blue {
  background: linear-gradient(135deg, #ffffff, #e8f4ff);
  border-left: 5px solid #0077cc;
}

.dashboard-card-title {
  margin: 0 0 8px;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 1.2rem;
}

.dashboard-metric {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1;
  color: #1f2937;
}

.dashboard-metric-muted {
  font-size: 1.45rem;
  color: #475569;
}

.dashboard-progress {
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.dashboard-progress .progress-bar {
  background-color: #1f3b63;
}

.table.table-hover > tbody > tr:hover > * {
  background-color: #f8fafc;
}

.data-table.table {
  margin-top: 10px;
  margin-bottom: 0;
  border-color: #ddd;
}

.data-table.table th {
  background: #eef4fa;
}

/* Keep Bootstrap forms from becoming too generic inside LMS pages. */
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #0077cc;
  box-shadow: 0 0 0 0.2rem rgba(0, 119, 204, 0.15);
  outline: none;
}

/* Small screen polish */
@media (max-width: 700px) {
  .page-shell {
    padding: 16px 0;
  }

  .brand-block,
  .brand {
    min-width: 0;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-subtitle {
    font-size: 0.82rem;
  }

  .main-nav,
  .top-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .main-nav a,
  .top-nav a {
    padding: 7px 9px;
  }

  .layout {
    padding: 16px;
  }

  .main-content {
    padding: 20px;
  }
}

/* ===== QUIZ LAYOUT FIX ===== */
/* quiz_base.html uses this class so quiz pages use the full content width instead of
   falling back to the default two-column .layout grid. */
.quiz-layout-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.quiz-layout-single .main-content {
  width: 100%;
  max-width: none;
}

/* Radio/checkbox controls should not inherit the global full-width input style. */
input[type="radio"],
input[type="checkbox"] {
  width: auto !important;
  min-width: 16px;
  height: auto !important;
  margin-right: 8px;
  padding: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Keep generated quiz answer labels readable without forcing the entire quiz into a narrow column. */
.quiz-option label,
.quiz-question label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  margin: 6px 0;
}
