/* ============================= */
/* GLOBAL RESET & BASE STYLES    */
/* ============================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background-color: #f5f7fb;
  color: #333;
  line-height: 1.6;
}

/* ============================= */
/* NAVBAR                        */
/* ============================= */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background-color: #1e3a8a;
  color: white;
}

.logo {
  font-size: 1.4rem;
  font-weight: bold;
}

.navbar a {
  color: white;
  margin-left: 20px;
  text-decoration: none;
  font-weight: bold;
}

.navbar .btn {
  background-color: #facc15;
  color: black;
  padding: 8px 14px;
  border-radius: 4px;
}

/* ============================= */
/* HERO SECTION                  */
/* ============================= */

.hero {
  text-align: center;
  padding: 90px 20px;
  background-color: #e0e7ff;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #1e3a8a;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.cta {
  background-color: #1e3a8a;
  color: white;
  padding: 14px 28px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1rem;
}

/* ============================= */
/* INTRODUCTION SECTION          */
/* ============================= */

.intro {
  background-color: white;
  padding: 60px 80px;
}

.intro h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #1e3a8a;
}

.intro p {
  margin-bottom: 18px;
  font-size: 1rem;
}

.intro .highlight {
  background-color: #fef3c7;
  padding: 16px;
  border-left: 6px solid #facc15;
  font-weight: bold;
}

/* ============================= */
/* COURSE STRUCTURE SECTION      */
/* ============================= */

.stages-preview {
  padding: 60px 20px;
}

.stages-preview h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #1e3a8a;
}

.stage-card {
  max-width: 650px;
  margin: 12px auto;
  padding: 18px;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* =========================================
   COURSE STRUCTURE – STAGE CARDS (Index Page)
   ========================================= */

/* Base styling for all stage cards */
.stages-preview .stage-card {
  background-color: #ffffff;
  color: #1a202c;              /* readable dark text */
  padding: 18px 22px;
  margin: 12px 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-left: 6px solid #2b6cb0; /* default fallback */
}

/* Stage title text */
.stages-preview .stage-card strong {
  color: #1a365d;
}

/* -------- Individual stage colors -------- */

/* Stage 1 – Number Sense */
.stages-preview .stage1 {
  border-left-color: #2b6cb0;   /* Blue */
}

/* Stage 2 – Percentages & Ratios */
.stages-preview .stage2 {
  border-left-color: #805ad5;   /* Purple */
}

/* Stage 3 – Profit & Interest */
.stages-preview .stage3 {
  border-left-color: #38a169;   /* Green */
}

/* Stage 4 – Work & Time */
.stages-preview .stage4 {
  border-left-color: #d69e2e;   /* Gold */
}

/* Stage 5 – Motion */
.stages-preview .stage5 {
  border-left-color: #dd6b20;   /* Orange */
}

/* Stage 6 – Logical Reasoning */
.stages-preview .stage6 {
  border-left-color: #319795;   /* Teal */
}

/* Stage 7 – Advanced Reasoning */
.stages-preview .stage7 {
  border-left-color: #718096;   /* Gray */
}

/* Stage 8 – Data Interpretation */
.stages-preview .stage8 {
  border-left-color: #e53e3e;   /* Red */
}

/* ===== Course Structure Layout ===== */
.stages-preview {
  text-align: center;
}

/* Center the stage cards */
.stages-preview .stage-card {
  text-align: left;          /* text inside card */
  max-width: 700px;
  margin: 14px auto;         /* centers horizontally */
}

/* Stage title */
.stage-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 6px;
  text-align: center;
}

/* Stage description */
.stage-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #2d3748;
  text-align: center;
}



/* ============================= */
/* INSTRUCTOR SECTION            */
/* ============================= */

.instructor {
  background-color: #e0e7ff;
  padding: 50px 20px;
  text-align: center;
}

.instructor h2 {
  color: #1e3a8a;
  margin-bottom: 18px;
  text-align: center;
}

.instructor h3,
.instructor h4 {
  text-align: center;
  margin: 5px 0;   /* optional spacing */
}

.instructor p {
  font-size: 1rem;
  margin-bottom: 10px;
  text-align: center;
}

/* ============================= */
/* FOOTER                        */
/* ============================= */

footer {
  background-color: #1e3a8a;
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* ============================= */
/* LOGIN PAGE STYLES             */
/* ============================= */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #f5f7fb;
}

.login-box {
  background-color: white;
  padding: 40px;
  width: 380px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.login-box h2 {
  text-align: center;
  margin-bottom: 10px;
  color: #1a365d;
}

.login-info {
  text-align: center;
  font-size: 14px;
  color: #2d3748;
  margin-bottom: 20px;
  line-height: 1.6;
}

.login-box label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.login-box button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background-color: #2b6cb0;
  color: white;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.login-box button:hover {
  background-color: #1a4f8b;
}

/* Google Button */
.google-btn {
  background-color: white;
  color: #333;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-btn img {
  width: 18px;
  height: 18px;
}

.google-btn:hover {
  background-color: #f3f3f3;
}

.login-note {
  margin-top: 12px;
  font-size: 12px;
  color: #555;
  text-align: center;
}

/* Divider */
.divider {
  margin: 20px 0;
  text-align: center;
  position: relative;
}

.divider span {
  background: white;
  padding: 0 12px;
  color: #666;
  font-size: 13px;
}

.divider::before {
  content: "";
  height: 1px;
  background: #ccc;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: -1;
}


/* ============================= */
/* DASHBOARD LAYOUT */
/* ============================= */

.dashboard {
  max-width: 900px;
  margin: 60px auto;
  padding: 20px;
}

.dashboard-title {
  text-align: center;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.dashboard-subtitle {
  text-align: center;
  color: #555;
  margin-bottom: 35px;
}

/* ============================= */
/* STAGE CARD */
/* ============================= */

.stage-card {
  background: #ffffff;
  padding: 22px;
  margin-bottom: 22px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  position: relative;
}

.stage-card h2 {
  color: #1e3a8a;
  margin-bottom: 6px;
}

.stage-card p {
  margin-bottom: 14px;
  color: #444;
}

/* ============================= */
/* PROGRESS BAR */
/* ============================= */

.progress-bar {
  width: 100%;
  height: 14px;
  background-color: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c1c3, #2563eb);
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* ============================= */
/* STATUS LABEL */
/* ============================= */

.status {
  display: inline-block;
  font-weight: bold;
  font-size: 0.9rem;
}

.status.not-started {
  color: #6b7280;
}

.status.in-progress {
  color: #2563eb;
}

.status.completed {
  color: #16a34a;
}

/* ============================= */
/* AVG % + COUNTER (RIGHT SIDE) */
/* ============================= */

[id$="Percent"] {
  float: right;
  font-weight: bold;
  color: #1e3a8a;
  background: #eef2ff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* ============================= */
/* STAGE BORDER COLORS */
/* ============================= */

.stage-card.completed {
  border-left: 8px solid #16a34a;
}

.stage-card.in-progress {
  border-left: 8px solid #2563eb;
}

.stage-card.not-started {
  border-left: 8px solid #9ca3af;
  opacity: 0.9;
}

/* ============================= */
/* OPEN STAGE BUTTON */
/* ============================= */

.open-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background-color: #1e3a8a;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
}

.open-btn:hover {
  background-color: #162f6a;
}

/* ============================= */
/* USER ACTIONS (TOP RIGHT) */
/* ============================= */

.user-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.welcome {
  font-weight: bold;
  color: #e1e4ee;
}

.logout-btn {
  padding: 6px 12px;
  background: #e53e3e;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.logout-btn:hover {
  background: #c53030;
}

#certificatePanel {
  border: 2px dashed #cbd5e0;
  background: #f7fafc;
}

#certStatusText {
  font-size: 17px;
  font-weight: bold;
  margin-top: 10px;
}

#certificatePanel .btn {
  margin-top: 15px;
}


/* ============================= */
/* STAGE OVERVIEW PAGE           */
/* ============================= */

.stage-overview {
  max-width: 900px;
  margin: auto;
  padding: 50px 20px;
}

.stage-header {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 35px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stage-header h1 {
  color: #1e3a8a;
  margin-bottom: 8px;
}

/* ============================= */
/* SUBMODULE CARDS               */
/* ============================= */

.submodule {
  background-color: white;
  padding: 22px;
  margin-bottom: 18px;
  border-radius: 8px;
  border-left: 8px solid #2563eb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.submodule.open {
  border-left: 8px solid #2563eb;
}

.submodule.completed {
  border-left: 8px solid #16a34a;
}

.submodule.locked {
  border-left: 8px solid #9ca3af;
  opacity: 0.7;
}

/* ============================= */
/* SUBMODULE BUTTONS             */
/* ============================= */

.sub-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #1e3a8a;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.sub-btn:hover {
  background-color: #162f6a;
}

/* ============================= */
/* MARK DISPLAY                  */
/* ============================= */

.marks {
  margin-top: 6px;
  font-size: 0.95rem;
  color: #065f46;
  font-weight: bold;
}

/* ============================= */
/* LOCKED TEXT                   */
/* ============================= */

.locked-text {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #555;
}



/* ============================= */
/* USERNAME CREATION PAGE        */
/* ============================= */

.username-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #f5f7fb;
}

.username-box {
  background-color: white;
  padding: 40px;
  width: 380px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.username-box h2 {
  text-align: center;
  margin-bottom: 15px;
  color: #1e3a8a;
}

.info-text {
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 20px;
  color: #555;
}

.username-box label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.username-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.username-box button {
  width: 100%;
  padding: 12px;
  background-color: #1e3a8a;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.username-box button:hover {
  background-color: #162f6a;
}

.error-text {
  font-size: 0.85rem;
  color: #dc2626;
  margin-bottom: 10px;
}


/* STAGE & SUBMODULE PAGES */

.stage-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 10px;
}

.stage-description {
  margin-bottom: 30px;
  color: #444;
  font-size: 16px;
}

.submodule {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  position: relative;
}

.submodule h3 {
  margin-bottom: 5px;
  color: #2b6cb0;
}

.submodule p {
  color: #555;
  margin-bottom: 10px;
}

.tag {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.open-tag {
  background: #c6f6d5;
  color: #22543d;
}

.locked-tag {
  background: #fed7d7;
  color: #742a2a;
}

.enter-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  background: #3182ce;
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.enter-btn:hover {
  background: #2b6cb0;
}

.enter-btn.disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

/* ===== Submodule Score Display ===== */
.score-box {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  border: 2px solid #2b6cb0;
  border-radius: 8px;
  background-color: #f0f7ff;
  font-weight: bold;
  color: #1a365d;
}

.score-main {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 6px;
}

.score-message {
  font-size: 15px;
  color: #2d3748;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.score-main {
  font-weight: bold;
  font-size: 18px;
}

.passed-badge {
  background-color: #38a169;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: bold;
}

.score-message {
  font-size: 15px;
  color: #2d3748;
}

/* ===== Completed Tick ===== */
.completed-tick {
  display: inline-block;
  margin: 6px 0;
  padding: 4px 10px;
  background-color: #e6fffa;
  color: #065f46;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
}


/* ============================= */
/* admin dashboard PAGE        */
/* ============================= */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 0.95rem;
}

.admin-table th {
  background: #f8fafc;
  font-weight: 600;
}

.status-clean { color: #16a34a; font-weight: bold; }
.status-warning { color: #d97706; font-weight: bold; }
.status-risk { color: #dc2626; font-weight: bold; }

/* Student Profile Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 12px rgba(0,0,0,0.15);
  padding: 20px;
  overflow-y: auto;
  z-index: 1000;
}

.drawer.hidden {
  display: none;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.drawer-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.drawer-content section {
  margin-bottom: 20px;
}

.drawer-content ul {
  padding-left: 18px;
}

.drawer-content li {
  margin-bottom: 6px;
}

.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

/* ================================
   Admin Dashboard – Executive Metrics
================================ */

.exec-metrics {
  margin: 30px 0;
}

.exec-metrics h2 {
  margin-bottom: 15px;
  color: #2b6cb0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.metric-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.metric-value {
  font-size: 36px;
  font-weight: bold;
  color: #2d3748;
}

.metric-label {
  margin-top: 8px;
  font-size: 14px;
  color: #555;
}

.metric-card.risk .metric-value {
  color: #c53030;
}

.metric-card.time .metric-value {
  color: #2f855a;
}

#highestDropoff {
  font-size: 36px;
  font-weight: 700;
  color: #c53030;   /* Red = risk signal */
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* Responsive behavior */
@media (max-width: 900px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================
   Admin Dashboard – Stage Peformance Table
============================================= */

.stage-analytics {
  margin: 40px 0;
}

.stage-analytics h2 {
  margin-bottom: 15px;
  color: #2b6cb0;
}

.stage-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.stage-table th,
.stage-table td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.stage-table th {
  background: #f7fafc;
  color: #333;
  font-weight: 600;
}

.risk-low {
  color: #2f855a;
  font-weight: bold;
}

.risk-medium {
  color: #d69e2e;
  font-weight: bold;
}

.risk-high {
  color: #c53030;
  font-weight: bold;
}


/* ====================================
   Admin Dashboard – Learning Funnel
======================================= */

.learning-funnel {
  margin: 40px 0;
}

.learning-funnel h2 {
  color: #2b6cb0;
  margin-bottom: 5px;
}

.funnel-subtext {
  font-size: 13px;
  color: #666;
  margin-bottom: 20px;
}

.funnel-stage {
  margin-bottom: 20px;
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.funnel-title {
  font-weight: bold;
  margin-bottom: 8px;
}

.funnel-bar {
  height: 18px;
  border-radius: 6px;
  margin: 6px 0;
  transition: width .4s ease;
}

.funnel-attempted {
  background: #3182ce;
}

.funnel-completed {
  background: #38a169;
}

.funnel-label {
  font-size: 12px;
  color: #444;
}

.dropoff {
  margin-top: 6px;
  font-size: 13px;
  font-weight: bold;
}

/* =======================================
   Admin Dashboard – Difficulty Ranking
=========================================== */

.difficulty-ranking {
  margin: 40px 0;
}

.difficulty-ranking h2 {
  color: #2b6cb0;
  margin-bottom: 15px;
}

.difficulty-card {
  background: white;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.diff-left {
  display: flex;
  align-items: center;
}

.diff-rank {
  font-size: 24px;
  font-weight: bold;
  margin-right: 15px;
  color: #2b6cb0;
}

.diff-stage {
  font-weight: bold;
  font-size: 16px;
}

.diff-meta {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

.diff-level {
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
}

.level-easy {
  background: #c6f6d5;
  color: #22543d;
}

.level-medium {
  background: #fefcbf;
  color: #744210;
}

.level-hard {
  background: #fed7d7;
  color: #742a2a;
}


/* ================================
   Admin Dashboard – Search Bar
================================ */

.admin-search-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  margin: 10px 0 16px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
}

/* ===============================
   ADMIN ANALYTICS CHART SIZING
================================ */

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-box {
  background: #f9fafb;
  border-radius: 10px;
  padding: 15px;
  height: 240px;   /* 🔥 Controls chart height */
}

.chart-box.wide {
  grid-column: 1 / 3;
  height: 280px;  /* 🔥 Bigger for stage trend */
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===============================
   STUDENTS TABLE SCROLL SYSTEM
================================ */

.table-scroll {
  max-height: 420px;   /* 🔥 Controls how many rows visible */
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* Sticky Header */
.table-scroll thead th {
  position: sticky;
  top: 0;
  background: #f7fafc;
  z-index: 2;
}

/* Pending Certificate style */

.pending-badge {
  background: #f6ad55;
  color: #1a202c;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: bold;
  margin-left: auto;
  margin-right: 15px;
}

.pending-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.pending-row b {
  color: #2b6cb0;
}

.issue-fast-btn {
  background: #38a169;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.issue-fast-btn:hover {
  background: #2f855a;
}

/* Audit Panel Styles */
.audit-row {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.audit-row b {
  color: #2b6cb0;
}

.risk-low { color: green; font-weight: bold; }
.risk-medium { color: orange; font-weight: bold; }
.risk-high { color: red; font-weight: bold; }

body {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.quiz-question label {
  user-select: none;
}