/* ============================================================
   SCHOLAR PATHWAYS CAMS - Main Stylesheet
   Modern glassmorphism / light card design
   ============================================================ */

:root {
  --blue:        #1E88E5;
  --blue-dark:   #145DA0;
  --blue-light:  #5DADE2;
  --sky:         #6EC6E8;
  --sky-light:   #A8DDF0;
  --sky-pale:    #E8F6FC;
  --page-bg:     #F4FAFF;
  --surface:     #FFFFFF;
  --surface-alt: #EAF4FB;
  --panel:       #FFFFFF;
  --text:        #16324A;
  --off-white:   #F7FBFF;
  --muted:       #5E7C90;
  --border:      rgba(30,136,229,0.18);
  --glass:       rgba(30,136,229,0.045);
  --glass-border: rgba(30,136,229,0.14);
  --success:    #198754;
  --info:       #0dcaf0;
  --warn:       #fd7e14;
  --font-sans:  'DM Sans', sans-serif;
  --font-serif: 'Cormorant Garamond', serif;
  --sidebar-w: 260px;
  --topbar-h:  64px;
  --radius:    8px;
  --transition: 0.25s ease;
  /* aliases kept for backward compatibility: many pages reference these
     variable names directly in inline styles, so we point the old names
     at the new light blue / white palette instead of renaming every file */
  --red: var(--blue);
  --red-dark: var(--blue-dark);
  --red-light: var(--blue-light);
  --gold: var(--sky);
  --gold-light: var(--sky-light);
  --gold-pale: var(--sky-pale);
  --black: var(--page-bg);
  --dark: var(--text);
  --charcoal: var(--surface-alt);
  --white: var(--text);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--page-bg); }
::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 10px; }

/* ── Typography ── */
.serif { font-family: var(--font-serif); }
h1,h2,h3,h4,h5 { font-family: var(--font-serif); font-weight: 700; }

/* ── Links ── */
a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); }

/* ── UTILITIES ── */
.text-red   { color: var(--blue) !important; }
.text-gold  { color: var(--blue-dark) !important; }
.text-muted { color: var(--muted) !important; }
.text-white { color: #FFFFFF !important; }
.text-success { color: #198754 !important; }
.text-danger  { color: #C0392B !important; }

.badge-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-Draft        { background: rgba(108,117,125,.15); color: #5a6268; }
.badge-Submitted    { background: rgba(13,110,253,.12);  color: #0d6efd; }
.badge-Under-Review { background: rgba(253,126,20,.12);  color: #c9660a; }
.badge-In-Process   { background: rgba(102,16,242,.12);  color: #6610f2; }
.badge-Pre-Admission{ background: rgba(13,202,240,.15);  color: #0aa8c4; }
.badge-Admitted     { background: rgba(25,135,84,.12);   color: #198754; }
.badge-Rejected     { background: rgba(220,53,69,.12);   color: #c0392b; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 2px 14px rgba(30,136,229,.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border); box-shadow: 0 6px 22px rgba(30,136,229,.1); }
.card-red {
  background: linear-gradient(135deg, rgba(30,136,229,.08), rgba(255,255,255,.9));
  border-color: rgba(30,136,229,.25);
}
.card-gold {
  background: linear-gradient(135deg, rgba(110,198,232,.12), rgba(255,255,255,.9));
  border-color: rgba(110,198,232,.3);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 6px;
  font-size: 13px; font-weight: 500; letter-spacing: .5px;
  border: none; cursor: pointer; transition: all var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30,136,229,.35); color: #fff; }
.btn-gold { background: var(--sky); color: #FFFFFF; }
.btn-gold:hover { background: var(--sky-light); transform: translateY(-1px); color: #FFFFFF; }
.btn-ghost { background: transparent; border: 1px solid var(--glass-border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border); background: var(--glass); }
.btn-danger { background: rgba(220,53,69,.1); border: 1px solid rgba(220,53,69,.25); color: #c0392b; }
.btn-danger:hover { background: rgba(220,53,69,.18); }
.btn-success { background: rgba(25,135,84,.1); border: 1px solid rgba(25,135,84,.25); color: #198754; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(22,50,74,.55); margin-bottom: 8px;
}
.form-label .req { color: var(--blue); }
.form-control, .form-select {
  width: 100%;
  background: rgba(30,136,229,.045);
  border: 1px solid rgba(30,136,229,.16);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.form-control::placeholder { color: rgba(22,50,74,.35); }
.form-control:focus, .form-select:focus {
  border-color: rgba(30,136,229,.5);
  background: rgba(30,136,229,.08);
}
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: var(--surface); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.form-error { font-size: 12px; color: #C0392B; margin-top: 5px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.data-table thead tr {
  background: rgba(30,136,229,.1);
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-dark);
  font-weight: 600;
}
table.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(30,136,229,.08);
  color: rgba(22,50,74,.85);
}
table.data-table tbody tr:hover { background: rgba(30,136,229,.04); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 14px rgba(30,136,229,.06);
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border); }
.stat-card .stat-num {
  font-family: var(--font-serif);
  font-size: 40px; font-weight: 700; line-height: 1;
  color: var(--text);
}
.stat-card .stat-num span { color: var(--blue); }
.stat-card .stat-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.stat-card .stat-icon {
  position: absolute; right: 20px; top: 20px;
  font-size: 32px; opacity: .3;
}
.stat-card-red   { border-left: 3px solid var(--blue); }
.stat-card-gold  { border-left: 3px solid var(--sky); }
.stat-card-green { border-left: 3px solid #198754; }
.stat-card-blue  { border-left: 3px solid #0dcaf0; }

/* ── PROGRESS BAR ── */
.progress-wrap { margin: 32px 0; }
.progress-steps {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  position: relative;
}
.progress-steps::before {
  content: '';
  position: absolute;
  top: 20px; left: 40px; right: 40px; height: 2px;
  background: rgba(30,136,229,.12);
  z-index: 0;
}
.progress-line {
  position: absolute;
  top: 20px; left: 40px; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--sky));
  z-index: 1;
  transition: width 0.8s ease;
}
.progress-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; position: relative; z-index: 2; flex: 1;
}
.progress-dot {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(30,136,229,.2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}
.progress-dot.done  { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 16px rgba(30,136,229,.4); }
.progress-dot.active{ background: var(--sky); border-color: var(--sky); box-shadow: 0 0 16px rgba(110,198,232,.5); }
.progress-label { font-size: 11px; text-align: center; color: var(--muted); max-width: 80px; }
.progress-label.done   { color: var(--blue); }
.progress-label.active { color: var(--blue-dark); font-weight: 600; }

/* ── ALERTS ── */
.alert {
  padding: 14px 18px; border-radius: 6px; margin-bottom: 20px;
  font-size: 14px; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: rgba(25,135,84,.1); border: 1px solid rgba(25,135,84,.25); color: #198754; }
.alert-danger  { background: rgba(220,53,69,.1);  border: 1px solid rgba(220,53,69,.25);  color: #c0392b; }
.alert-info    { background: rgba(13,202,240,.1);   border: 1px solid rgba(13,202,240,.3); color: #0a8aa3; }
.alert-warn    { background: rgba(253,126,20,.1);   border: 1px solid rgba(253,126,20,.3); color: #c9660a; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16,40,64,.55);
  z-index: 9000;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(20,60,100,.18);
  animation: modalIn .3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 22px; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 22px;
  cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ── FILE UPLOAD CARD ── */
.doc-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color var(--transition);
  margin-bottom: 12px;
}
.doc-card.uploaded { border-color: rgba(25,135,84,.4); }
.doc-card.missing  { border-color: rgba(253,126,20,.3); }
.doc-icon { font-size: 28px; flex-shrink: 0; }
.doc-info { flex: 1; }
.doc-title { font-size: 14px; color: var(--text); font-weight: 500; }
.doc-subtitle { font-size: 11px; color: var(--muted); margin-top: 3px; }
.doc-actions { flex-shrink: 0; display: flex; gap: 8px; }
.doc-file-input { display: none; }

/* ── SIDEBAR LAYOUT ── */
.app-layout {
  display: flex; min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  background: rgba(255,255,255,.98);
  border-right: 1px solid rgba(30,136,229,.15);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  box-shadow: 2px 0 16px rgba(30,136,229,.05);
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(30,136,229,.1);
}
.sidebar-logo-top {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: 2px;
}
.sidebar-logo-top span { color: var(--blue); }
.sidebar-logo-sub { font-size: 9px; letter-spacing: 3px; color: var(--blue); text-transform: uppercase; margin-top: 3px; }

.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-section {
  font-size: 9px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(22,50,74,.35); padding: 16px 20px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: rgba(22,50,74,.65);
  font-size: 13px; font-weight: 400;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--blue-dark);
  background: rgba(30,136,229,.08);
  border-left-color: var(--blue);
}
.sidebar-link .icon { font-size: 17px; opacity: .8; }
.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--blue);
  color: white; font-size: 10px;
  padding: 2px 7px; border-radius: 50px;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(30,136,229,.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 15px; font-weight: 700;
}
.sidebar-user-name { font-size: 13px; color: var(--text); font-weight: 500; }
.sidebar-user-role { font-size: 10px; color: var(--muted); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(30,136,229,.1);
  backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.topbar-title { font-family: var(--font-serif); font-size: 22px; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.notif-btn {
  position: relative;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 8px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px;
  transition: border-color var(--transition);
}
.notif-btn:hover { border-color: var(--border); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--blue); color: white;
  font-size: 9px; width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.page-content { padding: 28px; flex: 1; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 30px; }
.page-header p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ── HAMBURGER (mobile) ── */
.hamburger-btn {
  display: none;
  background: none; border: none;
  color: var(--text); font-size: 22px; cursor: pointer;
}

/* ── STEP WIZARD ── */
.wizard-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  margin-bottom: 28px; padding-bottom: 4px;
}
.wizard-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: .5px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.wizard-tab.active {
  background: rgba(30,136,229,.12); border-color: rgba(30,136,229,.35);
  color: var(--blue-dark);
}
.wizard-tab.done {
  background: rgba(25,135,84,.1); border-color: rgba(25,135,84,.3);
  color: #198754;
}
.wizard-tab-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(30,136,229,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.wizard-tab.active .wizard-tab-num { background: var(--blue); color: white; }
.wizard-tab.done   .wizard-tab-num { background: #198754; color: white; }
.wizard-section { display: none; }
.wizard-section.active { display: block; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }

/* ── EDUCATION / RECOMMENDATION ROWS ── */
.dynamic-row {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
}
.row-del {
  position: absolute; top: 12px; right: 12px;
  background: rgba(220,53,69,.1); border: 1px solid rgba(220,53,69,.25);
  color: #c0392b; border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: all var(--transition);
}
.row-del:hover { background: rgba(220,53,69,.2); }
.row-num {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--blue-dark); margin-bottom: 12px;
}

/* ── MESSAGES ── */
.msg-list { display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; }
.msg-item {
  padding: 14px 18px; border-radius: 8px;
  max-width: 80%;
}
.msg-item.admin-msg {
  background: rgba(30,136,229,.08); border: 1px solid rgba(30,136,229,.18);
  align-self: flex-start;
}
.msg-item.student-msg {
  background: rgba(110,198,232,.14); border: 1px solid rgba(110,198,232,.3);
  align-self: flex-end;
}
.msg-sender { font-size: 10px; letter-spacing: 1px; color: var(--muted); margin-bottom: 5px; }
.msg-body { font-size: 14px; line-height: 1.6; color: rgba(22,50,74,.85); }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 5px; }

/* ── ACCENT DIVIDER ── */
.gold-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky), transparent);
  margin: 28px 0; opacity: .5;
}
.section-title-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.section-title-bar h3 { font-size: 18px; color: var(--text); }
.section-title-bar::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ── AUTH PAGES ── */
.auth-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at top left, rgba(30,136,229,.14) 0%, var(--page-bg) 60%),
              var(--page-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  width: min(480px, 100%);
  box-shadow: 0 20px 60px rgba(20,60,100,.1);
  backdrop-filter: blur(20px);
}
.auth-logo {
  text-align: center; margin-bottom: 32px;
}
.auth-logo-top {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: 2px;
}
.auth-logo-top span { color: var(--blue); }
.auth-logo-sub { font-size: 10px; letter-spacing: 3px; color: var(--blue); text-transform: uppercase; margin-top: 4px; }
.auth-title { font-size: 28px; color: var(--text); margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

/* ── CHARTS ── */
.chart-card { position: relative; }
.chart-card canvas { max-height: 280px; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger-btn { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .progress-steps { gap: 4px; }
  .progress-label { font-size: 9px; max-width: 60px; }
}
