/* ==========================================================================
   AGENTIC SYSTEMS LEARNING PLATFORM - DEEPLEARNING.AI / COURSERA STYLE
   Sleek, high-status, two-column LMS workspace with precision SVG icons.
   ========================================================================== */

/* Portal Header */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  transition: opacity 0.15s ease;
}

.nav-brand:hover {
  opacity: 0.85;
}

.nav-brand-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-blue);
  background: var(--accent-blue-subtle);
  border: 1px solid var(--accent-blue-border);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.nav-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-text-link:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
}

.nav-text-link svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-text-link:hover svg {
  color: var(--text-main);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background-color: var(--border-color);
  margin: 0 0.15rem;
}

.student-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.65rem 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 600;
  margin-left: 0.25rem;
}

.student-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.btn-logout {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  margin-left: 0.2rem;
}

.btn-logout:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* ==========================================================================
   AUTHENTICATION GATE (CLEAN DEVELOPER STYLE)
   ========================================================================== */

.auth-gate {
  display: flex;
  min-height: calc(100vh - 60px);
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: #f8fafc;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.auth-icon-wrap {
  width: 44px;
  height: 44px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.auth-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.auth-error {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  color: #92400e;
  padding: 0.85rem 1rem;
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  display: none;
  border-radius: 4px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 2.75rem !important;
  width: 100%;
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-toggle-pwd:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.btn-toggle-pwd:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 1px;
}

.auth-card #auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: all 0.2s ease;
  position: relative;
}

.auth-card #auth-submit-btn.loading {
  opacity: 0.88;
  cursor: wait;
  background: #1e293b;
}

.auth-card #auth-submit-btn.loading span {
  animation: pulseText 1.5s ease-in-out infinite;
}

/* ==========================================
   FORGOT PASSWORD RECOVERY
   ========================================== */
.forgot-wrap {
  text-align: center;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
}

.forgot-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.forgot-link:hover {
  color: #1d4ed8;
}

.recover-panel {
  margin-top: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-blue);
  border-radius: 4px;
  padding: 1.25rem;
}

.recover-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.recover-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.recover-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
  color: #991b1b;
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.85rem;
  border-radius: 4px;
}

.recover-result {
  display: none;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 3px solid #10b981;
  padding: 1rem;
  margin-top: 0.85rem;
  border-radius: 4px;
}

.recover-result-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.65rem;
}

.rec-pwd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: #ffffff;
  border: 1px solid #d1fae5;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
}

.rec-pwd-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #064e3b;
  word-break: break-all;
}

.btn-copy-pwd {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-copy-pwd:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-copy-pwd.copied {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

.recover-result-hint {
  font-size: 0.72rem;
  color: #047857;
  margin-top: 0.55rem;
}

/* ==========================================
   CHANGE PASSWORD MODAL & BUTTONS
   ========================================== */

.btn-hero-change-pwd {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.42rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn-hero-change-pwd:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-change-pwd-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-change-pwd-nav:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.05);
}

.change-pwd-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #ef4444;
  color: #991b1b;
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.85rem;
  border-radius: 4px;
}

.change-pwd-result {
  display: none;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 3px solid #10b981;
  padding: 1.1rem;
  margin-top: 0.85rem;
  border-radius: 4px;
}

.change-pwd-result-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.65rem;
}

.pending-pay-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #92400e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pending-pay-link:hover {
  color: #78350f;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 0.75s linear infinite;
  display: inline-block;
}

@keyframes pulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ==========================================================================
   LMS WORKSPACE: 2-COLUMN LAYOUT (SIDEBAR + MAIN CANVAS)
   ========================================================================== */

.portal-workspace {
  display: none;
  min-height: calc(100vh - 60px);
  background: #f8fafc;
}

.lms-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 60px);
  max-width: 1600px;
  margin: 0 auto;
}

/* Sidebar Navigation */
.lms-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
}

.sidebar-heading-group {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  display: block;
}

.sidebar-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Module Accordion & Units */
.module-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.module-group {
  border: 1px solid var(--border-color);
  border-radius: 0;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.module-group.active {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-xs);
}

.module-group-header {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}

.module-group.active .module-group-header {
  border-bottom-color: var(--border-subtle);
  background: #ffffff;
}

.mod-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mod-index-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mod-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.mod-status-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mod-status-badge.unlocked,
.mod-status-badge.available {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.mod-status-badge.locked,
.mod-status-badge.upcoming {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.mod-status-badge.upcoming-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.mod-status-badge.upcoming-countdown svg {
  width: 12px;
  height: 12px;
  color: #d97706;
  flex-shrink: 0;
}

/* Material Unit Links */
.unit-list {
  display: flex;
  flex-direction: column;
  padding: 0.4rem;
}

.unit-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.93rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}

.unit-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.unit-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.unit-btn.active {
  background: #eff6ff;
  color: var(--accent-blue);
  font-weight: 600;
  border-left: 3px solid var(--accent-blue);
}

.unit-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.unit-btn.active .unit-icon {
  color: var(--accent-blue);
}

/* ==========================================================================
   MAIN LEARNING CANVAS
   ========================================================================== */

.lms-canvas {
  padding: 1.75rem 2.25rem 4rem;
  overflow-y: auto;
}

/* Canvas Header & Breadcrumbs */
.canvas-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.canvas-header-info {
  flex: 1;
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}

.breadcrumb-sep {
  color: #cbd5e1;
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 700;
}

.canvas-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 0.35rem;
  word-break: break-word;
}

.canvas-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.45;
}

.canvas-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.25rem;
  white-space: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: var(--bg-secondary);
  border-color: #cbd5e1;
}

.action-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

/* Content Container */
.canvas-content-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

/* Presentation Frame */
.deck-frame-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0f172a;
  position: relative;
}

.deck-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Markdown Reader (Textbook / Handbook / Lab) */
.markdown-reader {
  padding: 3rem 4rem;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.8;
  color: #1e293b;
  font-size: 0.95rem;
}

.markdown-reader h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: #0f172a;
}

.markdown-reader h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  color: #0f172a;
}

.markdown-reader h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: #0f172a;
}

.markdown-reader p {
  margin-bottom: 1.25rem;
  color: #334155;
}

.markdown-reader ul, .markdown-reader ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #334155;
}

.markdown-reader li {
  margin-bottom: 0.4rem;
}

.markdown-reader .code-block-wrap {
  position: relative;
  margin: 1.5rem 0;
}

.markdown-reader .code-block-wrap pre {
  margin: 0;
}

.markdown-reader pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.25rem 1.5rem;
  border-radius: 0;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.markdown-reader code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 0;
  color: #0369a1;
}

.markdown-reader pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Copy button */
.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
  z-index: 1;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.22);
}

.code-copy-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.code-copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.markdown-reader blockquote {
  border-left: 3px solid #64748b;
  background: #f8fafc;
  padding: 0.9rem 1.25rem;
  border-radius: 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
}

.markdown-reader blockquote p {
  margin: 0.4rem 0;
}

.markdown-reader blockquote p:first-child {
  margin-top: 0;
}

.markdown-reader blockquote p:last-child {
  margin-bottom: 0;
}

/* GitHub Alert Style Callouts */
.callout-alert {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid;
  border-radius: 0;
  background: #ffffff;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  font-family: var(--font-sans);
}

.callout-icon {
  display: inline-flex;
  align-items: center;
}

.callout-body {
  font-size: 0.92rem;
  line-height: 1.6;
}

.callout-body p {
  margin: 0.4rem 0;
}

.callout-body p:first-child {
  margin-top: 0;
}

.callout-body p:last-child {
  margin-bottom: 0;
}

/* Callout Variants */
.callout-note {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
}
.callout-note .callout-header {
  color: #1d4ed8;
}

.callout-tip {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #14532d;
}
.callout-tip .callout-header {
  color: #15803d;
}

.callout-important {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #4c1d95;
}
.callout-important .callout-header {
  color: #6d28d9;
}

.callout-warning {
  border-color: #d97706;
  background: #fffbeb;
  color: #78350f;
}
.callout-warning .callout-header {
  color: #b45309;
}

.callout-caution {
  border-color: #dc2626;
  background: #fef2f2;
  color: #7f1d1d;
}
.callout-caution .callout-header {
  color: #b91c1c;
}

.markdown-reader table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
}

.markdown-reader th, .markdown-reader td {
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.9rem;
  text-align: left;
}

.markdown-reader th {
  background: #f8fafc;
  font-weight: 700;
}

/* Math & LaTeX Expressions */
.math-inline {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.math-fraction {
  display: inline-flex;
  flex-direction: column;
  vertical-align: -0.6em;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.1;
  padding: 0 0.3rem;
  color: #0f172a;
}

.math-fraction .math-num {
  border-bottom: 1.5px solid #0f172a;
  padding-bottom: 1px;
  font-weight: 600;
}

.math-fraction .math-denom {
  padding-top: 1px;
  font-weight: 600;
}

.math-fraction .math-bar {
  display: none;
}

/* Footnotes & Citations */
.footnote-ref {
  font-size: 0.68em;
  line-height: 0;
  margin-left: 0.1rem;
}

.footnote-ref a {
  color: var(--text-muted);
  font-weight: 400;
  text-decoration: none;
}

.footnote-ref a:hover,
.footnote-ref a:focus-visible {
  color: var(--accent-blue);
  text-decoration: underline;
}

.markdown-footnotes {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footnotes-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

.footnotes-list {
  padding-left: 1.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footnote-item {
  line-height: 1.6;
  scroll-margin-top: 5rem;
  padding: 0.25rem 0.5rem;
  transition: background-color 0.4s ease;
}

.footnote-item:target,
.footnote-item.footnote-flash {
  background-color: #fef08a;
  border-left: 3px solid #ca8a04;
}

.footnote-backref {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 700;
  margin-left: 0.4rem;
  display: inline-block;
  transition: transform 0.15s;
}

.footnote-backref:hover {
  transform: translateX(-2px);
}

/* Mermaid Architecture Diagram Viewer with Pan & Zoom */
.mermaid-diagram-wrap {
  margin: 2rem 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  position: relative;
}

.mermaid-diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mermaid-header-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mermaid-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mermaid-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.45rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s;
  height: 24px;
}

.mermaid-ctrl-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.mermaid-ctrl-btn:active {
  background: #e2e8f0;
}

.mermaid-ctrl-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.mermaid-zoom-level {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
  user-select: none;
}

.mermaid-diagram-body {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #ffffff;
  min-height: 320px;
  max-height: 620px;
  position: relative;
  cursor: grab;
  user-select: none;
}

.mermaid-diagram-body.is-panning {
  cursor: grabbing !important;
}

.mermaid-zoom-stage {
  transform-origin: center center;
  transition: transform 0.05s ease-out;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  will-change: transform;
}

.mermaid-diagram-body svg {
  /* Sizing is pinned per-SVG to its intrinsic viewBox size by portal.js
     (renderMermaidDiagrams) — percentage widths collapse to 0 inside the
     shrink-to-fit zoom stage. Only neutralize mermaid's own max-width. */
  max-width: none !important;
  display: block;
}

.mermaid-src-fallback {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #92400e;
  background: #fffbeb;
  border: 1px dashed #fde68a;
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  align-self: stretch;
  overflow: auto;
}

.mermaid-hint {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-color);
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   COURSE LANDING PAGE & DASHBOARD
   ========================================================================== */

.course-landing-wrap {
  padding: 2.5rem 3rem;
  max-width: 1040px;
  margin: 0 auto;
}

.portal-dashboard {
  min-height: calc(100vh - 60px);
  background: #f8fafc;
  padding: 3rem 2rem;
  display: block;
}

.course-landing-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.landing-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 2.75rem 3rem;
  border: 1px solid #334155;
  margin-bottom: 2.5rem;
  position: relative;
  border-radius: 0;
}

.landing-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.25);
  padding: 0.25rem 0.65rem;
  margin-bottom: 1.25rem;
}

.landing-hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
  line-height: 1.2;
}

.landing-hero-desc {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.65;
  max-width: 840px;
  margin-bottom: 1.75rem;
}

.landing-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.landing-metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.landing-metric-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
}

.landing-metric-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.landing-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.module-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 2rem 2.25rem;
  border-radius: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.module-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.module-card-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.2rem 0.55rem;
}

.module-meet-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}

.module-meet-link:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.1);
}

.module-meet-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.module-meet-link .ext-ico {
  opacity: 0.65;
}

.module-waiting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0;
  letter-spacing: 0.02em;
}

.module-waiting-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #d97706;
}

/* Calendar Dropdown in Module Cards */
.calendar-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.calendar-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s ease;
  user-select: none;
}

.calendar-dropdown-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--accent-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.calendar-dropdown-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

.calendar-dropdown-btn .cal-icon {
  width: 13px;
  height: 13px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.calendar-dropdown-btn .cal-chevron {
  width: 11px;
  height: 11px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.calendar-dropdown-btn[aria-expanded="true"] {
  background: #f8fafc;
  border-color: var(--accent-blue);
}

.calendar-dropdown-btn[aria-expanded="true"] .cal-chevron {
  transform: rotate(180deg);
}

.calendar-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  padding: 0.35rem 0;
  z-index: 50;
  flex-direction: column;
  animation: calDropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-dropdown-menu.active {
  display: flex;
}

@keyframes calDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calendar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
  font-family: var(--font-sans);
  box-sizing: border-box;
}

.calendar-menu-item:hover {
  background: #f8fafc;
  color: var(--accent-blue);
}

.calendar-menu-item:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}

.calendar-menu-item svg:not(.ext-ico) {
  width: 15px;
  height: 15px;
  color: #64748b;
  flex-shrink: 0;
}

.calendar-menu-item:hover svg:not(.ext-ico) {
  color: var(--accent-blue);
}

.calendar-menu-item .ext-ico {
  margin-left: auto;
  opacity: 0.45;
  color: var(--text-muted);
}

.admin-mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.admin-mode-toggle-btn.admin-active {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #9d174d;
}

.admin-mode-toggle-btn.sim-active {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.admin-mode-toggle-btn:hover {
  filter: brightness(0.96);
}

.unit-chip-btn.chip-locked {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.75;
}

.unit-chip-btn.chip-locked svg {
  color: #94a3b8;
}

.material-lock-screen {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 4rem 2.5rem;
  text-align: center;
  max-width: 680px;
  margin: 3rem auto;
}

.material-lock-screen .lock-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.material-lock-screen h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.material-lock-screen p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.material-lock-screen .lock-countdown {
  display: inline-block;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.material-lock-screen .lock-date {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 2rem;
}

.module-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.module-card-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

/* 1-Liner Unit Menu: Exactly 5 columns in one clean row */
.module-card-units {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.unit-chip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-chip-btn:hover {
  background: #eff6ff;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.unit-chip-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.unit-chip-btn:hover svg {
  color: var(--accent-blue);
}

/* Breadcrumbs Back Button */
.bc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s;
}

.bc-back-btn:hover {
  background: #eff6ff;
  color: var(--accent-blue);
  border-color: #bfdbfe;
}

/* ==========================================================================
   INTERACTIVE QUIZ ENGINE (DEEPLEARNING.AI STYLE)
   ========================================================================== */

.quiz-wrapper {
  padding: 3rem 4rem;
  max-width: 860px;
  margin: 0 auto;
}

.quiz-info-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.quiz-info-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.quiz-info-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.85rem;
  align-items: center;
  font-family: var(--font-mono);
}

.quiz-q-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.quiz-q-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.quiz-q-card.has-error {
  border-color: #ef4444;
  background: #fffcfc;
}

.q-top-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.q-num-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: #0f172a;
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: 0;
}

.q-taxo-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background: #eff6ff;
  color: var(--accent-blue);
  padding: 0.15rem 0.5rem;
  border-radius: 0;
  border: 1px solid #bfdbfe;
}

.q-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.q-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.q-option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.q-option-label:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.q-option-label:focus-within {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.q-option-label.selected {
  background: #f0fdf4;
  border-color: #10b981;
  box-shadow: 0 0 0 1px #10b981;
}

.q-option-input {
  margin-top: 0.2rem;
  cursor: pointer;
  accent-color: #0f172a;
}

.q-option-text {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.45;
  flex: 1;
}

/* Quiz Feedback States */
.q-option-label.is-correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
}

.q-option-label.is-wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

.q-option-label.is-missed-correct {
  background: #f0fdf4 !important;
  border: 2px dashed #10b981 !important;
}

.q-explanation-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.55;
  display: none;
}

/* Scorecard Banner */
.quiz-score-banner {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 0;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
  display: none;
}

.quiz-score-banner.passed {
  border-color: #10b981;
  background: #f0fdf4;
}

.quiz-score-banner.failed {
  border-color: #f59e0b;
  background: #fffbeb;
}

.score-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.quiz-score-banner.passed .score-number { color: #059669; }
.quiz-score-banner.failed .score-number { color: #d97706; }

.score-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 0;
  margin-bottom: 0.85rem;
}

.quiz-score-banner.passed .score-pill {
  background: #d1fae5;
  color: #065f46;
}

.quiz-score-banner.failed .score-pill {
  background: #fef3c7;
  color: #92400e;
}

.quiz-submit-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   LOCKED MODULE CARD
   ========================================================================== */

.locked-card {
  padding: 5rem 2rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.lock-shield-icon {
  width: 56px;
  height: 56px;
  background: #f1f5f9;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin-bottom: 1.25rem;
}

.locked-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.locked-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

.locked-upgrade-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 1.1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

/* Fullscreen Mode */
.canvas-content-box:fullscreen,
.canvas-content-box.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  border: none !important;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

.canvas-content-box:fullscreen #viewer-content-container,
.canvas-content-box.is-fullscreen #viewer-content-container {
  flex: 1;
  overflow-y: auto;
}

/* Schedule Notice Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: #ffffff;
  border-radius: 0;
  max-width: 520px;
  width: 100%;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.canvas-content-box:fullscreen .deck-frame-container,
.canvas-content-box.is-fullscreen .deck-frame-container {
  height: 100vh;
  min-height: 100vh;
  aspect-ratio: auto;
}

@media (max-width: 960px) {
  .lms-layout {
    grid-template-columns: 1fr;
  }
  .lms-sidebar {
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .markdown-reader, .quiz-wrapper {
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 640px) {
  .canvas-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .canvas-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0;
  }
}

/* ==========================================================================
   GLOBAL FOCUS VISIBILITY (A11Y)
   Ensures keyboard navigation is always clearly visible.
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--accent-blue, #1d4ed8);
  outline-offset: 2px;
}

/* Remove default outline only when focus-visible is used */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   SESSION RECORDINGS & NOTES STYLES
   ========================================================================== */

/* Module Card Resources Row */
.module-card-resources {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
  flex-wrap: wrap;
}

.module-card-resources .resources-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm, 4px);
  transition: all 0.15s ease;
  cursor: pointer;
}

.resource-pill svg:not(.ext-ico) {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.resource-pill .ext-ico {
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.resource-pill:hover .ext-ico {
  transform: translate(1px, -1px);
}

.resource-pill.recording-pill {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.resource-pill.recording-pill:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.1);
}

.resource-pill.recording-pill svg:not(.ext-ico) {
  color: #dc2626;
}

.resource-pill.notes-pill {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.resource-pill.notes-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.1);
}

.resource-pill.notes-pill svg:not(.ext-ico) {
  color: #2563eb;
}

/* Sidebar Session Assets Divider & Link */
.sidebar-resource-divider {
  margin: 0.75rem 0.4rem 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unit-btn.unit-resource-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm, 4px);
  text-decoration: none;
}

.unit-btn.unit-resource-link:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.unit-btn.unit-resource-link .ext-ico {
  margin-left: auto;
  opacity: 0.5;
}

.unit-btn.unit-resource-link:hover .ext-ico {
  opacity: 0.9;
}

/* Header Canvas Recording & Notes Action Buttons */
.action-btn.action-recording-btn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.action-btn.action-recording-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.action-btn.action-recording-btn svg:not(.ext-ico) {
  color: #dc2626;
}

.action-btn.action-notes-btn {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.action-btn.action-notes-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.action-btn.action-notes-btn svg:not(.ext-ico) {
  color: #2563eb;
}

