/* assets/css/theme.css — EduEval Design System */

/* ── Google Fonts ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-dark:   #0d1b2a;
  --brand-navy:   #1b2e4b;
  --brand-blue:   #2563eb;
  --brand-accent: #f59e0b;
  --brand-light:  #e8f0fe;

  /* Roles */
  --student-primary: #2563eb;
  --faculty-primary: #7c3aed;
  --admin-primary:   #0f766e;

  /* Neutral */
  --surface:      #f8fafc;
  --card-bg:      #ffffff;
  --border:       #e2e8f0;
  --text-main:    #0f172a;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;

  /* Sidebar */
  --sidebar-w:    260px;
  --sidebar-bg:   #0d1b2a;
  --sidebar-item: rgba(255,255,255,0.07);
  --sidebar-active:#2563eb;
  --sidebar-text: rgba(255,255,255,0.80);
  --sidebar-hover: rgba(255,255,255,0.12);

  /* Misc */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.14);
  --transition:   all .2s ease;
}

/* Role-specific accent overrides */
.role-faculty  { --brand-blue: var(--faculty-primary); --sidebar-active: var(--faculty-primary); }
.role-admin    { --brand-blue: var(--admin-primary);   --sidebar-active: var(--admin-primary);   }

/* ── Reset / Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: .9375rem;
  color: var(--text-main);
  background: var(--surface);
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login Page ──────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--brand-dark);
}

.login-brand-side {
  flex: 0 0 42%;
  background: linear-gradient(145deg, var(--brand-navy) 0%, var(--brand-dark) 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.login-brand-side::before {
  content: '';
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.25) 0%, transparent 70%);
  top: -80px; right: -80px;
}
.login-brand-side::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,.12) 0%, transparent 70%);
  bottom: 40px; left: -60px;
}

.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-accent));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(37,99,235,.4);
  position: relative; z-index: 1;
}

.login-brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  position: relative; z-index: 1;
}

.login-brand-sub {
  color: rgba(255,255,255,.55);
  font-size: .95rem;
  margin-top: .4rem;
  text-align: center;
  position: relative; z-index: 1;
}

.login-features {
  list-style: none; padding: 0; margin-top: 2.5rem;
  position: relative; z-index: 1;
}
.login-features li {
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,.70);
  margin-bottom: 1rem; font-size: .9rem;
}
.login-features li .fi {
  width: 32px; height: 32px;
  background: var(--sidebar-item);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-accent);
  font-size: 1rem; flex-shrink: 0;
}

.login-form-side {
  flex: 1;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
}

.login-form-box {
  width: 100%; max-width: 420px;
}

.login-form-box h2 {
  font-size: 1.75rem;
  color: var(--text-main);
  margin-bottom: .4rem;
}
.login-form-box p.sub {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 2rem;
}

/* ── App Layout ──────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .8rem;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--sidebar-active);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-app-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -.01em;
}
.sidebar-role-label {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-user {
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--sidebar-active), var(--brand-accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.sidebar-user-name  { color: #fff; font-size: .875rem; font-weight: 500; line-height: 1.2; }
.sidebar-user-email { color: rgba(255,255,255,.4); font-size: .75rem; }

.sidebar-nav { padding: .75rem 0; flex: 1; }
.sidebar-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.28);
  padding: 1rem 1.25rem .4rem;
}

.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.25rem;
  color: var(--sidebar-text);
  font-size: .875rem;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--brand-accent);
  border-radius: 0 3px 3px 0;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

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

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.content-area { padding: 1.75rem; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
}

/* Stat cards */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; align-items: flex-start; gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: var(--brand-blue); }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.amber  { background: #fffbeb; color: var(--brand-accent); }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.teal   { background: #f0fdfa; color: #0f766e; }

.stat-info .label { font-size: .82rem; color: var(--text-muted); font-weight: 500; }
.stat-info .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem; font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}
.stat-info .change { font-size: .78rem; color: var(--text-light); margin-top: .15rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline-primary { color: var(--brand-blue); border-color: var(--brand-blue); }
.btn-outline-primary:hover { background: var(--brand-blue); }

/* ── Form controls ───────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  padding: .55rem .85rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-label { font-size: .86rem; font-weight: 500; margin-bottom: .35rem; }

/* Input group icon */
.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: 1rem; pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 2.5rem; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { font-weight: 500; font-size: .75rem; border-radius: 5px; padding: .3em .6em; }

/* ── Tables ──────────────────────────────────────────────────── */
.table > :not(caption) > * > * { padding: .75rem 1rem; }
.table thead th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}
.table tbody tr { transition: background .15s; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ── Upload drop zone ────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--brand-blue);
  background: #eff6ff;
}
.dropzone .dz-icon { font-size: 3rem; color: var(--text-light); margin-bottom: 1rem; }
.dropzone .dz-title { font-size: 1.05rem; font-weight: 600; }
.dropzone .dz-sub { font-size: .85rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 1.5rem;
  margin-bottom: .15rem;
}
.page-header p { color: var(--text-muted); font-size: .9rem; margin: 0; }

/* ── Marksheet ───────────────────────────────────────────────── */
.marksheet-wrapper {
  max-width: 700px; margin: 0 auto;
  background: #fff;
  border: 2px solid var(--brand-navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: .9rem;
}
.marksheet-header {
  background: var(--brand-navy);
  color: #fff;
  padding: 2rem;
  text-align: center;
}
.marksheet-header h2 { font-size: 1.4rem; margin: 0; color: #fff; }
.marksheet-header p  { color: rgba(255,255,255,.65); margin: 0; font-size: .85rem; }
.marksheet-body { padding: 1.75rem 2rem; }
.marksheet-field { display: flex; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.marksheet-field:last-child { border-bottom: none; }
.marksheet-field .key   { flex: 0 0 180px; font-weight: 600; color: var(--text-muted); }
.marksheet-field .value { flex: 1; color: var(--text-main); }
.marksheet-grade-badge {
  display: inline-block;
  padding: .3rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .login-brand-side { display: none; }
}

/* ── Utilities ───────────────────────────────────────────────── */
.fw-600 { font-weight: 600; }
.text-brand { color: var(--brand-blue); }
.text-accent { color: var(--brand-accent); }
.gap-2 { gap: .5rem; }
.fs-sm { font-size: .85rem; }

/* DataTable override */
div.dataTables_wrapper div.dataTables_filter input { border-radius: var(--radius-sm); }
