@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Manrope:wght@400;500;600;700;800&display=swap');

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

:root {
  --white: #ffffff;
  --off: #f7f7f5;
  --off2: #f0f0ed;
  --ink: #111110;
  --ink-2: #4a4a46;
  --ink-3: #9a9a94;
  --rule: #e5e5e1;
  --blue: #1a56db;
  --blue-light: #eff4ff;
  --green: #057a55;
  --green-light: #f0fdf4;
  --red: #c81e1e;
  --red-light: #fff5f5;
  --amber: #92400e;
  --amber-light: #fffbeb;
  --radius: 10px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--white);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ─────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem; height: 64px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none;
}
.logo-text {
  font-family: 'Instrument Serif', serif;
  font-size: 1.25rem; color: var(--ink);
}

.nav-right { display: flex; align-items: center; gap: 0.5rem; }

/* ── BUTTONS ─────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1.1rem; border-radius: 7px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600; font-size: 0.83rem;
  cursor: pointer; text-decoration: none;
  transition: all 0.15s; border: none;
}
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); }
.btn-ghost:hover { border-color: #c5c5bf; color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: #2a2a28; }
.btn-danger { background: var(--red-light); color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.btn-success:hover { background: #dcfce7; }
.btn-lg { padding: 0.72rem 1.5rem; font-size: 0.88rem; border-radius: 8px; }
.btn-full { width: 100%; justify-content: center; }

/* ── PAGE ─────────── */
.page { padding-top: 64px; min-height: 100vh; }

/* ── FORMS ─────────── */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: 0.75rem; font-weight: 700;
  color: var(--ink-2); margin-bottom: 0.4rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}

input, select, textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 0.68rem 0.9rem;
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,17,16,0.08);
}
input::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--white); }

/* ── CARDS ─────────── */
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── ALERTS ─────────── */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px; font-size: 0.84rem;
  margin-bottom: 1rem; display: none;
  font-weight: 500;
}
.alert.show { display: block; }
.alert-error { background: var(--red-light); border: 1px solid #fecaca; color: var(--red); }
.alert-success { background: var(--green-light); border: 1px solid #bbf7d0; color: var(--green); }

/* ── SPINNER ─────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(17,17,16,0.15);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BADGES ─────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.55rem;
  border-radius: 4px; font-size: 0.68rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-student { background: var(--blue-light); color: var(--blue); }
.badge-lecturer { background: var(--amber-light); color: var(--amber); }
.badge-admin { background: var(--green-light); color: var(--green); }

/* ── EMPTY STATE ─────── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--ink-3);
}
.empty-state .empty-icon {
  width: 56px; height: 56px;
  background: var(--off); border: 1px solid var(--rule);
  border-radius: 14px; margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
.empty-state h3 {
  font-family: 'Instrument Serif', serif;
  color: var(--ink); font-size: 1.2rem; margin-bottom: 0.4rem;
}
.empty-state p { font-size: 0.85rem; line-height: 1.6; color: var(--ink-2); }

/* ── MATERIAL CARD ─── */
.material-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: all 0.15s;
  cursor: pointer;
}
.material-card:hover {
  border-color: #c5c5bf;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.material-pdf-icon {
  width: 36px; height: 36px;
  background: #fff1f2; border: 1px solid #fecdd3;
  border-radius: 8px; margin-bottom: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.material-pdf-icon svg { width: 18px; height: 18px; color: #e11d48; }

.material-title {
  font-family: 'Instrument Serif', serif;
  font-size: 0.98rem; line-height: 1.3;
  color: var(--ink); margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.material-meta {
  display: flex; flex-direction: column; gap: 0.22rem;
  font-size: 0.75rem; color: var(--ink-3);
  margin-top: 0.75rem;
}

.material-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.85rem; padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  font-size: 0.72rem; color: var(--ink-3);
}

/* ── SECTION TAGS ───── */
.section-tag {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 0.75rem;
}

/* ── RESPONSIVE ─────── */
@media (max-width: 768px) {
  nav { padding: 0 1.25rem; }
  .nav-right .hide-mobile { display: none; }
}