/* ============================================================
   Eduviai Dashboard – style.css
   ============================================================ */

/* ---------- Reset & Base ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple:       #4e3376;
  --purple-dark:  #362156;
  --purple-light: #ede9fe;
  --purple-mid:   #6d28d9;
  --green:        #00a28a;
  --green-light:  #d1fae5;
  --red:          #ef4444;
  --red-light:    #fee2e2;
  --yellow:       #f59e0b;
  --yellow-light: #fef3c7;
  --orange:       #f97316;
  --orange-light: #ffedd5;
  --blue:         #3b82f6;
  --blue-light:   #dbeafe;
  --gray-bg:      #f4f5f9;
  --gray-100:     #f8f8fb;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-600:     #6b7280;
  --gray-800:     #32204c;
  --sidebar-w:    290px;
  --topbar-h:     70px;
  --radius:       12px;
  --shadow:       0 2px 10px rgba(0,0,0,.07);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-bg);
  color: var(--gray-800);
  display: flex;
  min-height: 100vh;
  font-size: 16px;
}

a { text-decoration: none; color: inherit; }

ul { list-style: none; }

button { cursor: pointer; font-family: inherit; }

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,.06);
  padding-bottom: 20px;
}

/* Logo */

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--gray-200);
}

/* Nav */

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

.nav-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-400);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--purple);
  font-size: 15px;
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.nav-item i { width: 18px; text-align: center; font-size: 16px; }

.nav-item:hover { background: var(--gray-bg); color: var(--purple); }

.nav-item.active {
  background: var(--purple);
  color: #fff;
  font-weight: 600;
}

.nav-item.active i { color: #fff; }

/* Sidebar Bottom */

.sidebar-bottom { padding: 0 12px; }

/* Advisor Card */

.advisor-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.advisor-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.advisor-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.advisor-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--purple-light);
  color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.advisor-name { font-weight: 700; font-size: 15px; color: var(--gray-800); }

.advisor-title { font-size: 13px; color: var(--gray-600); }

.advisor-meta {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px;
}

.advisor-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600;
}

.advisor-status.available { color: var(--green); }

.advisor-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
}

.advisor-last-msg { font-size: 12px; color: var(--gray-400); }

.advisor-actions { display: flex; gap: 6px; }

.footer-copy { font-size: 13px; color: var(--gray-400); text-align: center; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */

.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   TOP BAR
   ============================================================ */

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 20px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow);
}

.search-bar {
  flex: 1;
  max-width: 520px;
  position: relative;
  transition: max-width .16s cubic-bezier(.4, 0, .2, 1);
  will-change: max-width;
}

.search-bar:focus-within {
  max-width: 620px;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 15px;
  background: var(--gray-100);
  outline: none;
  transition: border-color .16s cubic-bezier(.4, 0, .2, 1),
              background-color .16s cubic-bezier(.4, 0, .2, 1);
  color: var(--gray-800);
}

.search-bar input:focus { border-color: var(--purple); background: #fff; }

.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.topbar-actions { display: flex; align-items: center; gap: 16px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--gray-600);
  position: relative;
  transition: border-color .2s, color .2s;
}

.icon-btn:hover { border-color: var(--purple); color: var(--purple); }

.badge {
  position: absolute; top: -7px; right: -9px;
  background: var(--green);
  color: #fff;
  font-size: 9px; font-weight: 700;
  width: 21px; height: 21px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.user-info {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 10px;
  transition: background .15s;
}

.user-info:hover { background: var(--gray-100); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--purple-light);
  color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.user-name { font-size: 15px; font-weight: 700; color: var(--gray-800); }

.user-id { font-size: 13px; color: var(--gray-400); }

.user-info > i { color: var(--gray-400); font-size: 13px; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */

.page-content {
  padding: 28px;
  /* flex: 1; */
}

/* Welcome */

/* Dashboard Grid */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.card:last-child { margin-bottom: 0; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
}

.card-meta { font-size: 14px; color: var(--gray-400); }

.card-link { font-size: 14px; color: var(--purple); font-weight: 600; }

.card-link:hover { text-decoration: underline; }

/* Buttons */

.btn-primary {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s;
}

.btn-primary:hover { background: var(--purple-dark); }

.btn-outline {
  background: #fff;
  color: var(--gray-800);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: border-color .2s, color .2s;
}

.btn-outline:hover { border-color: var(--purple); color: var(--purple); }

.btn-sm { padding: 10px 18px; font-size: 13px; border-radius: 7px; }

.btn-full { width: 100%; margin-top: 12px; }

/* Card Actions */

.card-actions { display: flex; gap: 12px; margin-top: 20px; }

/* Status Badge */

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
}

.status-badge.in-progress { background: #ecfdf5; color: var(--green); }

.status-badge.pending   { background: var(--yellow-light); color: #b45309; }

.status-badge.in-progress .dot-in-progress { border-color: var(--green); }

.status-badge.draft     { background: var(--gray-100); color: var(--gray-600); }

.status-badge.completed { background: var(--green-light); color: var(--green); }

.status-badge.rejected  { background: #fef2f2; color: #dc2626; }

/* Dot helpers */

.dot {
  width: 8px; height: 8px;
  border-radius: 50%; display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
}

.dot.green { background: var(--green); }

.dot.blue  { background: var(--blue); }

.dot.dot-rejected { background: #ef4444; }

.dot.dot-draft { background: var(--gray-400); }

.dot.dot-in-progress {
  width: 10px; height: 10px;
  border: 1.5px dashed var(--green);
  background: #fff;
}

/* ============================================================
   CURRENT APPLICATION CARD
   ============================================================ */

.app-title-row { margin-top: 3px; }

.app-name { font-weight: 700; font-size: 16px; color: var(--purple); }

.app-uni  { font-size: 14px; color: var(--gray-400); margin-left: 8px; }

/* Completion % */

.completion-block { margin-bottom: 22px; }

.completion-label {
  display: flex; justify-content: space-between;
  font-size: 15px; color: var(--gray-600); margin-bottom: 8px;
}

.completion-label strong { color: var(--purple); font-size: 17px; }

.progress-bar-outer {
  height: 17px;
  background: #f8f7fd;
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 100px;
  transition: width .5s ease;
}

/* Step Tracker */

.step-tracker {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
}

.step-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2.5px solid var(--gray-200);
  background: #f8f7fd;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--gray-400);
  transition: all .3s;
  position: relative; z-index: 1;
}

.step.done .step-circle {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.step.active .step-circle {
  border-color: var(--purple);
  background: #fff;
  color: var(--purple);
  box-shadow: 0 0 0 5px rgba(78, 51, 118, 0.12);
}

.step.active .step-label {
  color: var(--purple);
  font-weight: 700;
}

.step.warn .step-circle {
  border-color: var(--yellow);
  background: var(--yellow-light);
  color: var(--yellow);
}

.step-label {
  font-size: 15px; font-weight: 600;
  color: var(--gray-600); margin-top: 6px; text-align: center;
}

.step.done .step-label  { color: var(--purple); }

.step.warn .step-label  { color: var(--yellow); }

.step-line {
  flex: 1; height: 2.5px;
  background: var(--gray-200);
  margin-top: 16px; /* center with circles */
  border-radius: 100px;
}

.step-line.done   { background: var(--purple); }

.step-line.active { background: linear-gradient(90deg, var(--purple), var(--yellow)); }

/* ============================================================
   APPLICATION STATUS TIMELINE
   ============================================================ */

.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item {
  display: flex; align-items: flex-start; gap: 20px;
  position: relative;
  padding-bottom: 35px;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: '';
  position: absolute; left: 15px; top: 28px;
  width: 2px;
  bottom: 0;
  background: var(--gray-200);
}

.tl-item:last-child::before { display: none; }

.tl-item.done::before { background: var(--purple); }

.tl-item.current::before { background: linear-gradient(to bottom, var(--purple), var(--gray-200)); }

.tl-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--gray-400);
  flex-shrink: 0; z-index: 1;
}

.tl-item.done .tl-icon {
  border-color: var(--purple); background: var(--purple); color: #fff;
}

.tl-item.current .tl-icon {
  border-color: var(--purple); color: var(--purple);
  background: var(--purple-light);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.tl-title { font-size: 17px; font-weight: 600; color: var(--gray-800); }

.tl-item.done  .tl-title  { color: var(--purple); }

.tl-item.current .tl-title { color: var(--purple-dark); }

/* ============================================================
   DOCUMENTS
   ============================================================ */

.doc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border-radius: 10px;
  border: 2px solid #f8f7fd;
  margin-bottom: 10px;
  transition: border-color .2s;
  background: #f8f7fd;
}

.doc-item:last-child { margin-bottom: 0; }

.doc-item.approved      { border-color: var(--green);  }

.doc-icon {
  width: 3rem; height: 3rem;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; flex-shrink: 0;
}

.doc-info { flex: 1; }

.doc-name { font-size: 15px; font-weight: 700; color: var(--gray-800); }

.doc-sub  { font-size: 13px; color: var(--gray-600); margin-top: 2px; }

.doc-status {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
}

.doc-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* ============================================================
   MY APPLICATIONS
   ============================================================ */

.app-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  margin-bottom: 10px;
  transition: border-color .2s;
}

.app-item:last-child { margin-bottom: 0; }

.app-item:hover { border-color: var(--purple); }

.app-item-icon {
  width: 3rem; height: 3rem;
  border-radius: 9px;
  background: var(--purple);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.app-item-info { flex: 1; }

.app-item-name { font-size: 16px; font-weight: 700; color: var(--gray-800); }

.app-item-uni  { font-size: 14px; color: var(--gray-400); margin-top: 2px; }

.app-item-next { font-size: 13px; color: var(--gray-600); margin-top: 5px; }

.app-item-next strong { color: var(--red); }

.app-item-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}

.status-dot-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--gray-600); font-weight: 600;
}

/* ============================================================
   TASK LIST (Right Column)
   ============================================================ */

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

.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.task-item.urgent {
  background: #ede9fe;
  border-color: #ede9fe;
  color: var(--gray-800);
}

.task-item.urgent i { color: #4e3376; }

.task-item:hover { filter: brightness(.97); }

/* ============================================================
   NEXT STEPS
   ============================================================ */

.next-steps-body { margin-bottom: 14px; }

.next-steps-body h3 { font-size: 17px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }

.next-steps-body p  { font-size: 15px; color: var(--gray-600); line-height: 1.6; }

.next-steps-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   UPCOMING DEADLINES
   ============================================================ */

.deadline-list { display: flex; flex-direction: column; gap: 10px; }

.deadline-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0; border-radius: 9px;
}

.dl-date {
  font-size: 13px; font-weight: 600;
  min-width: 54px;
  padding: 5px;
  border-radius: 6px;
  background: var(--purple);
  color: white;
  text-align: center;
}

.dl-text { font-size: 15px; color: var(--gray-800); font-weight: 700; }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--gray-200);
}

.notif-item:last-child { border-bottom: none; padding-bottom: 0; }

.notif-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.notif-yellow .notif-icon { background: var(--yellow-light); color: var(--yellow); }

.notif-green  .notif-icon { background: var(--green-light);  color: var(--green); }

.notif-purple .notif-icon { background: var(--purple-light); color: var(--purple); }

.notif-body { flex: 1; }

.notif-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }

.notif-sub   { font-size: 13px; color: var(--gray-600); margin-top: 2px; }

.notif-time  { font-size: 12px; color: var(--gray-400); white-space: nowrap; padding-top: 4px; }

/* ============================================================
   RECOMMENDED SCHOOLS
   ============================================================ */

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

.school-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #f8f7fd;
  color: var(--purple-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.school-list li:hover { background: #ddd6fe; }

.school-list li i { color: var(--purple); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .col-side { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
  .col-side .card { margin-bottom: 0; }
}

@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); }
  .main-wrapper { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .col-side { grid-template-columns: 1fr; }
  .step-tracker { gap: 4px; }
  .step-circle { width: 30px; height: 30px; font-size: 12px; }
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes pulse-once {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Fullscreen loader — hidden by default, shown on page exit */

#fullscreen-loader {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  opacity: 0;
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */

@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton-block {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  border-radius: 6px;
  display: block;
}

/* While .is-loading: show skeleton, hide real content */

.is-loading [data-skeleton]         { display: block !important; }

.is-loading [data-skeleton].sk-flex { display: flex !important; }

.is-loading tbody[data-skeleton]    { display: table-row-group !important; }

.is-loading [data-content]          { display: none !important; }

/* Default: hide skeleton — !important beats inline style="display:flex/block/..." */

[data-skeleton]      { display: none !important; }

tbody[data-skeleton] { display: none !important; }

/* Flex skeleton wrappers */

[data-skeleton].sk-flex {
  flex-direction: column;
  gap: 10px;
}

/* Fade-in real content once loading is done */

[data-content] { animation: skFadeIn .3s ease; }

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