/* ============================================================
   ASCENDS TECH REVIEW CENTER - MAIN STYLESHEET
   ============================================================ */

:root {
  --primary:      #1a3c6e;
  --primary-dark: #122a52;
  --primary-light:#2a5298;
  --accent:       #f5a623;
  --accent-dark:  #d4891a;
  --success:      #28a745;
  --danger:       #dc3545;
  --warning:      #ffc107;
  --info:         #17a2b8;
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --body-bg:      #f0f4f8;
  --card-shadow:  0 2px 12px rgba(0,0,0,.08);
  --radius:       10px;
  --font:         'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--body-bg); color: #2d3748; font-size: 14px; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--primary); }

/* ---- LINKS ---- */
a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

/* ============================================================
   LANDING / AUTH PAGES
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #1e5fad 100%);
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo img { height: 60px; object-fit: contain; }
.auth-logo h1 { font-size: 20px; color: var(--primary); margin-top: 10px; line-height: 1.3; }
.auth-logo p  { color: #718096; font-size: 13px; }

.auth-card .form-label { font-weight: 600; font-size: 13px; color: #4a5568; }
.auth-card .form-control {
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .2s;
}
.auth-card .form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,.15);
}

.btn-primary-custom {
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 11px 24px;
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  transition: background .2s, transform .15s;
}
.btn-primary-custom:hover { background: var(--primary-dark); transform: translateY(-1px); color: #fff; }

/* ============================================================
   LAYOUT - DASHBOARD (STUDENT & ADMIN)
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand img { height: 38px; }
.sidebar-brand-text { font-size: 13px; font-weight: 700; line-height: 1.3; }
.sidebar-brand-sub { font-size: 11px; opacity: .7; font-weight: 400; }

.sidebar-menu { flex: 1; padding: 10px 0; }
.sidebar-menu-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: .5;
  padding: 14px 20px 4px;
  font-weight: 700;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar-menu a i { width: 18px; text-align: center; font-size: 14px; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  opacity: .6;
}

/* ---- MAIN CONTENT AREA ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle { background: none; border: none; font-size: 18px; color: #718096; cursor: pointer; display: none; }
.page-title { font-size: 16px; font-weight: 700; color: var(--primary); margin: 0; }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-notif { position: relative; color: #718096; font-size: 18px; cursor: pointer; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.topbar-username { font-size: 13px; font-weight: 600; color: #2d3748; }

/* ---- PAGE CONTENT ---- */
.page-content { flex: 1; padding: 24px; }

/* ============================================================
   CARDS & STATS
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: none;
}
.card-header {
  background: none;
  border-bottom: 1px solid #f0f4f8;
  padding: 16px 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue  { background: rgba(26,60,110,.1);  color: var(--primary); }
.stat-icon.green { background: rgba(40,167,69,.1);  color: var(--success); }
.stat-icon.orange{ background: rgba(245,166,35,.15); color: var(--accent-dark); }
.stat-icon.red   { background: rgba(220,53,69,.1);  color: var(--danger); }
.stat-icon.teal  { background: rgba(23,162,184,.1); color: var(--info); }

.stat-value { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 12px; color: #718096; margin-top: 3px; font-weight: 500; }

/* ============================================================
   COURSE CARDS
   ============================================================ */
.course-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.course-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.course-card-thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}
.course-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,60,110,.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-card-thumb-overlay i { font-size: 48px; color: rgba(255,255,255,.8); }
.course-price-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 20px;
}
.course-card-body { padding: 16px; }
.course-card-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.course-card-desc { font-size: 12.5px; color: #718096; margin-bottom: 12px; }

/* ============================================================
   LESSON LIST
   ============================================================ */
.lesson-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  border: 1px solid #f0f4f8;
  margin-bottom: 8px;
}
.lesson-item:hover { background: #f7faff; }
.lesson-item.locked { opacity: .5; cursor: not-allowed; }
.lesson-item.completed .lesson-num { background: var(--success); }
.lesson-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-weight: 600; font-size: 14px; color: #2d3748; }
.lesson-meta  { font-size: 12px; color: #718096; margin-top: 2px; }
.lesson-status { flex-shrink: 0; font-size: 13px; }

/* ============================================================
   VIDEO PLAYER PROTECTION
   ============================================================ */
.video-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  user-select: none;
  -webkit-user-select: none;
}
.video-wrapper iframe {
  width: 100%; height: 100%;
  border: none;
  pointer-events: auto;
}
/* Transparent overlay to block right-click context on video */
.video-shield {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 40px; /* only block top — allows controls */
  z-index: 5;
}
.video-protect-notice {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.6);
  color: rgba(255,255,255,.5);
  font-size: 11px;
  text-align: center;
  padding: 4px;
  pointer-events: none;
  z-index: 6;
}

/* ============================================================
   QUIZ ENGINE
   ============================================================ */
.quiz-wrapper { max-width: 860px; margin: 0 auto; }

.quiz-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quiz-timer {
  background: rgba(255,255,255,.15);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-timer.urgent { background: rgba(220,53,69,.8); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

.question-card {
  background: #fff;
  padding: 24px;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}
.question-num { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #718096; font-weight: 600; margin-bottom: 8px; }
.question-text { font-size: 15px; font-weight: 600; color: #1a202c; line-height: 1.6; margin-bottom: 20px; }

.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .15s;
}
.choice-item:hover { border-color: var(--primary-light); background: #f7faff; }
.choice-item.selected { border-color: var(--primary); background: rgba(26,60,110,.05); }
.choice-item.correct  { border-color: var(--success); background: rgba(40,167,69,.08); }
.choice-item.wrong    { border-color: var(--danger);  background: rgba(220,53,69,.08); }
.choice-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
  transition: background .15s;
}
.choice-item.selected .choice-letter { background: var(--primary); color: #fff; }
.choice-item.correct .choice-letter  { background: var(--success); color: #fff; }
.choice-item.wrong .choice-letter    { background: var(--danger);  color: #fff; }
.choice-text { font-size: 14px; line-height: 1.5; padding-top: 4px; }

.quiz-nav {
  background: #f8fafb;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.q-dot {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: #e2e8f0;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.q-dot.answered  { background: var(--primary); color: #fff; }
.q-dot.current   { background: var(--accent); color: #fff; }
.q-dot.flagged   { background: var(--warning); }

/* ============================================================
   RESULT / ANALYTICS
   ============================================================ */
.score-circle-wrapper { text-align: center; padding: 30px 0; }
.score-circle {
  width: 150px; height: 150px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 8px solid;
  margin-bottom: 16px;
}
.score-circle.pass { border-color: var(--success); color: var(--success); }
.score-circle.fail { border-color: var(--danger);  color: var(--danger); }
.score-pct  { font-size: 36px; font-weight: 800; line-height: 1; }
.score-label{ font-size: 12px; font-weight: 600; margin-top: 4px; }

.subject-bar { margin-bottom: 14px; }
.subject-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; font-weight: 600; }
.subject-bar-track { height: 10px; background: #e2e8f0; border-radius: 5px; overflow: hidden; }
.subject-bar-fill  { height: 100%; border-radius: 5px; transition: width 1s ease; }
.subject-bar-fill.good { background: var(--success); }
.subject-bar-fill.avg  { background: var(--warning); }
.subject-bar-fill.weak { background: var(--danger); }

/* ============================================================
   ANNOUNCEMENT CARDS
   ============================================================ */
.announcement-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 14px;
  border-left: 4px solid var(--primary);
}
.announcement-card.pinned { border-left-color: var(--accent); }
.announcement-card.event  { border-left-color: var(--info); }
.announcement-card.reminder { border-left-color: var(--warning); }
.announcement-body { padding: 16px 18px; }
.announcement-type-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 8px;
}

/* ============================================================
   ADMIN TABLES
   ============================================================ */
.table { font-size: 13.5px; }
.table thead th {
  background: #f8fafc;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid #e2e8f0;
  padding: 12px 16px;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid #f0f4f8; }
.table tbody tr:hover { background: #fafcff; }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-status.verified  { background: rgba(40,167,69,.12); color: #1a7a35; }
.badge-status.pending   { background: rgba(255,193,7,.15);  color: #856404; }
.badge-status.failed    { background: rgba(220,53,69,.12); color: #a01c28; }
.badge-status.active    { background: rgba(40,167,69,.12); color: #1a7a35; }
.badge-status.inactive  { background: rgba(113,128,150,.12); color: #4a5568; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress { height: 8px; border-radius: 4px; background: #e2e8f0; }
.progress-bar { border-radius: 4px; background: var(--primary-light); }
.progress-bar.success { background: var(--success); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: 8px; font-weight: 600; font-size: 13px; padding: 8px 18px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ============================================================
   PAYMENT PAGE
   ============================================================ */
.payment-method-card {
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.payment-method-card:hover,
.payment-method-card.selected {
  border-color: var(--primary);
  background: rgba(26,60,110,.04);
}
.payment-method-card img { height: 44px; object-fit: contain; margin-bottom: 8px; }
.payment-method-card h6  { font-size: 13px; color: var(--primary); margin: 0; }
.payment-qr { max-width: 200px; margin: 0 auto; border: 4px solid #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); border-radius: 8px; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert { border-radius: 8px; font-size: 13.5px; border: none; }
.alert-success { background: rgba(40,167,69,.1); color: #1a7a35; }
.alert-danger   { background: rgba(220,53,69,.1);  color: #a01c28; }
.alert-warning  { background: rgba(255,193,7,.1);  color: #856404; }
.alert-info     { background: rgba(23,162,184,.1); color: #0c6174; }

/* ============================================================
   FORM STYLES
   ============================================================ */
.form-label { font-weight: 600; font-size: 13px; color: #4a5568; margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  font-size: 13.5px;
  padding: 9px 14px;
  transition: border-color .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,.12);
}
.form-text { font-size: 12px; color: #718096; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
  }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .page-content { padding: 16px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
}
