/* ==========================================================================
   BRAND BUZZER ACADEMY — DESIGN SYSTEM & STYLESHEET
   Documentation Aesthetic (Stripe / Vercel / Linear inspired)
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --primary: #111111;
  --accent: #FF6B00;
  --accent-hover: #E05E00;
  --accent-light: rgba(255, 107, 0, 0.08);
  --bg: #FFFFFF;
  --surface: #FAFAFA;
  --surface-hover: #F4F4F5;
  --border: #EAEAEA;
  --border-strong: #D4D4D8;
  
  --text-main: #18181B;
  --text-muted: #71717A;
  --text-light: #A1A1AA;
  
  --success: #16A34A;
  --success-bg: rgba(22, 163, 74, 0.08);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --info: #2563EB;
  --info-bg: rgba(37, 99, 235, 0.08);

  /* Layout Sizes */
  --header-height: 64px;
  --sidebar-width: 280px;
  --toc-width: 240px;
  --content-max-width: 860px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Dark Mode Tokens */
[data-theme="dark"] {
  --primary: #F4F4F5;
  --accent: #FF7B1A;
  --accent-hover: #FF8F39;
  --accent-light: rgba(255, 123, 26, 0.15);
  --bg: #09090B;
  --surface: #141417;
  --surface-hover: #1F1F23;
  --border: #27272A;
  --border-strong: #3F3F46;
  
  --text-main: #F4F4F5;
  --text-muted: #A1A1AA;
  --text-light: #71717A;

  --success-bg: rgba(22, 163, 74, 0.18);
  --warning-bg: rgba(245, 158, 11, 0.18);
  --danger-bg: rgba(220, 38, 38, 0.18);
  --info-bg: rgba(37, 99, 235, 0.18);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

/* Top Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .top-header {
  background: rgba(9, 9, 11, 0.9);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  border: 1px solid var(--accent);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.95rem;
  line-height: 1.1;
  font-weight: 800;
}

.academy-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.header-center {
  flex: 1;
  max-width: 420px;
  margin: 0 20px;
}

.search-trigger {
  width: 100%;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-trigger:hover {
  border-color: var(--accent);
  background: var(--bg);
  color: var(--text-main);
}

.shortcut-key {
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-pill-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 107, 0, 0.2);
}

/* Layout */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
}

.sidebar-search-box {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-search-box input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.sidebar-search-box input:focus {
  border-color: var(--accent);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 0 10px 8px;
}

.nav-module-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

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

.nav-module-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.nav-module-link .module-status-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.nav-module-link.completed .module-status-icon {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.agency-mini-info {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.agency-mini-info strong {
  color: var(--text-main);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: calc(100% - var(--sidebar-width) - var(--toc-width));
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
}

.content-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .sep {
  color: var(--text-light);
}

.breadcrumbs .active {
  color: var(--text-main);
  font-weight: 600;
}

.content-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Module Article View */
.module-view {
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

.module-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.module-badge-num {
  background: var(--primary);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
}

.module-read-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-main);
}

.module-lead-text {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
  font-weight: 400;
}

/* Content Typography */
.module-view h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 40px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-main);
}

.module-view h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.module-view h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text-main);
}

.module-view p {
  margin-bottom: 16px;
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.7;
}

.module-view ul, .module-view ol {
  margin: 0 0 20px 24px;
  color: var(--text-main);
}

.module-view li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Callout Boxes */
.callout {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  border-left: 4px solid;
  display: flex;
  gap: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.callout-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-body {
  flex: 1;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.callout-tip {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--text-main);
}

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--text-main);
}

.callout-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--text-main);
}

.callout-sop {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text-main);
}

/* Code & Copy Blocks */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 20px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.code-content {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Interactive Checklist */
.checklist-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 32px 0;
}

.checklist-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  user-select: none;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.checklist-item.checked .checklist-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.checklist-item.checked span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Resource Cards Grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.resource-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.resource-icon {
  font-size: 1.5rem;
}

.resource-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.resource-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
}

/* Interactive Quiz Section */
.quiz-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 40px 0;
}

.quiz-header {
  margin-bottom: 20px;
}

.quiz-header h3 {
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.quiz-question-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.quiz-question-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.quiz-option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.quiz-option-btn.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
}

.quiz-option-btn.incorrect {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.quiz-explanation {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  font-size: 0.85rem;
  color: var(--text-main);
  display: none;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
}

/* Pagination Footer */
.module-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-pagination {
  flex: 1;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pagination:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.btn-pagination.btn-next {
  text-align: right;
  justify-content: flex-end;
}

.pagination-text {
  display: flex;
  flex-direction: column;
}

.pagination-text .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.pagination-text .title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Table of Contents (Right) */
.toc-sidebar {
  width: var(--toc-width);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 8px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.toc-link:hover, .toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-link.toc-h3 {
  padding-left: 18px;
}

.quick-support-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.8rem;
}

.quick-support-card h5 {
  font-size: 0.85rem;
  margin: 4px 0;
}

.quick-support-card p {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Profile Form & Manager Dashboard Styling */
.profile-modal-content {
  max-width: 520px;
}

.profile-intro-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.manager-modal-content {
  max-width: 900px;
}

.manager-modal-body {
  padding: 20px;
}

.manager-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.manager-btn-group {
  display: flex;
  gap: 8px;
}

.manager-table-container {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.team-submissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.team-submissions-table th {
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.team-submissions-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.status-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;

}

.status-badge.correct-badge {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge.incorrect-badge {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Buttons Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  line-height: 1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-accent:hover {
  background: var(--accent-light);
}

.btn-outline-success {
  background: transparent;
  color: var(--success);
  border-color: var(--success);
}
.btn-outline-success:hover {
  background: var(--success-bg);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 99px;
}

.hidden { display: none !important; }

/* Dialog Modals */
.modal-dialog {
  border: none;
  background: transparent;
  padding: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.modal-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
}

/* Search Modal */
.search-modal-content {
  max-width: 650px;
}

.search-input-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.search-input-header input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text-main);
  outline: none;
}

.close-modal-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.search-filter-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.search-tab {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.search-tab.active {
  background: var(--primary);
  color: var(--bg);
  font-weight: 600;
}

.search-results-list {
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--surface-hover);
}

.search-result-item h4 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 2px;
}

.search-result-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.search-empty-state {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.profile-modal-body {
  padding: 20px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--primary);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   MOBILE & CROSS-DEVICE OPTIMIZATION SYSTEM
   ========================================================================== */

/* Fix global overflow and text wrapping across mobile screens */
body, html {
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img, video, iframe, canvas, svg {
  max-width: 100%;
  height: auto;
}

.mobile-only { display: none; }

/* Tablet & Mobile Layout Rules (<= 1024px) */
@media (max-width: 1024px) {
  .desktop-only { display: none !important; }

  .app-layout {
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
  }

  .main-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 20px 16px !important;
    margin: 0 !important;
  }

  .module-view {
    max-width: 100% !important;
    width: 100% !important;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 290px;
    height: calc(100vh - var(--header-height));
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 998;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .top-header {
    padding: 0 14px;
    gap: 8px;
  }

  .header-center {
    max-width: 180px;
    margin: 0 8px;
  }
}

/* Sidebar Mobile Drawer Header Styling */
.sidebar-mobile-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-card-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}

.mobile-drawer-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
}

/* Smartphone Layout Rules (<= 768px) */
@media (max-width: 768px) {
  .top-header {
    height: 54px !important;
    padding: 0 12px !important;
    gap: 8px;
  }

  .brand-logo-img {
    height: 30px;
  }

  .progress-pill-badge {
    padding: 4px 10px !important;
    font-size: 0.75rem !important;
    height: 32px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 99px;
  }

  .module-hero-title {
    font-size: 1.75rem !important;
    line-height: 1.25 !important;
    margin-bottom: 12px;
  }

  .welcome-hero-title {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 12px;
  }

  .welcome-hero-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin-bottom: 24px;
  }

  .welcome-hero-banner {
    padding: 32px 18px !important;
    border-radius: 18px !important;
    margin-bottom: 24px !important;
  }

  .welcome-hero-logo {
    height: 52px;
  }

  .welcome-cta-group {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .btn-hero-primary, .btn-hero-secondary {
    width: 100% !important;
    font-size: 0.95rem !important;
    padding: 12px 18px !important;
    text-align: center;
    box-sizing: border-box;
  }

  .welcome-features-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
    margin-bottom: 24px;
  }

  .welcome-feature-card {
    padding: 20px 16px !important;
    border-radius: 14px !important;
  }

  .resource-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .callout {
    padding: 14px;
    gap: 10px;
    font-size: 0.88rem;
  }

  .code-block {
    margin: 14px 0;
  }

  .code-content {
    font-size: 0.8rem;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .quiz-section {
    padding: 16px 12px !important;
    margin: 24px 0;
  }

  .quiz-question-card {
    padding: 14px !important;
  }

  .quiz-option-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .module-pagination {
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
  }

  .btn-pagination {
    max-width: 100% !important;
    width: 100% !important;
  }

  .btn-pagination.btn-next {
    text-align: left;
    justify-content: flex-start;
  }

  .content-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .content-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .header-center {
    display: none;
  }

  .header-right {
    gap: 6px;
  }

  .btn-sm {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .progress-pill-badge span {
    font-size: 0.7rem;
  }

  .modal-content {
    width: 95vw !important;
    max-height: 90vh !important;
    padding: 12px !important;
  }

  .team-submissions-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

.btn-full-width {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
}

/* ==========================================================================
   WELCOME HERO INTRO PAGE STYLES
   ========================================================================== */
.welcome-hero-banner {
  background: linear-gradient(135deg, #FF6B00 0%, #E05E00 100%);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  color: #FFFFFF;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: 0 12px 32px rgba(255, 107, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.welcome-hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.welcome-badge-tag {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

.welcome-hero-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
  animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.welcome-hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 14px;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.welcome-hero-subtitle {
  font-size: 1.15rem;
  max-width: 620px;
  line-height: 1.6;
  opacity: 0.95;
  margin-bottom: 32px;
  font-weight: 400;
}

.welcome-cta-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-hero-primary {
  background: #FFFFFF;
  color: #FF6B00;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 14px 32px;
  border-radius: 99px;
  border: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  background: #FFF5EE;
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.welcome-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.welcome-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  transition: all 0.2s ease;
}

.welcome-feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.welcome-feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.welcome-feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}


