/* EduCore — Custom styles (loaded after Tailwind CDN) */

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}
.badge-green  { background:#dcfce7; color:#15803d; }
.badge-yellow { background:#fef9c3; color:#a16207; }
.badge-red    { background:#fee2e2; color:#b91c1c; }
.badge-blue   { background:#dbeafe; color:#1d4ed8; }
.badge-gray   { background:#f3f4f6; color:#6b7280; }
.badge-purple { background:#f3e8ff; color:#7e22ce; }

/* ─── Sidebar ────────────────────────────────────────────── */
#sidebar {
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ─── Overlay (mobile) ───────────────────────────────────── */
#sidebar-overlay {
  transition: opacity 0.25s ease;
}

/* ─── Flash messages ─────────────────────────────────────── */
.flash-enter { animation: slideDown 0.3s ease forwards; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Table ──────────────────────────────────────────────── */
.table-auto th { white-space: nowrap; }

/* ─── Form fields ────────────────────────────────────────── */
.field-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.field-input.is-error {
  border-color: #ef4444;
}
.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}
.field-error {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  line-height: 1.25rem;
  white-space: nowrap;
}
.btn-primary {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}
.btn-primary:hover { background: #152d4d; border-color: #152d4d; }

.btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}
.btn-secondary:hover { background: #f9fafb; }

.btn-danger {
  background: #fff;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}

/* ─── Scrollbar (global) ─────────────────────────────────── */
html { scrollbar-width: thin; scrollbar-color: #e5e7eb transparent; }
