/* ============================================================
   css/style.css — Shared styles + Home Page
   Student Activity Monitoring System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary:    #f5f4ff;
  --bg-secondary:  #ffffff;
  --bg-card:       rgba(255,255,255,0.85);
  --bg-card-hover: rgba(255,255,255,1);
  --accent:        #7c3aed;
  --accent-alt:    #4f46e5;
  --accent-glow:   rgba(124,58,237,0.18);
  --accent-grad:   linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --text-primary:  #1e1b4b;
  --text-secondary:#4b5563;
  --text-muted:    #9ca3af;
  --border:        rgba(0,0,0,0.08);
  --border-hover:  rgba(0,0,0,0.18);
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0891b2;
  --shadow:        0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.14);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --transition:    0.22s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #ede9fe; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.25);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(124,58,237,0.4); }
.btn-secondary {
  background: #ffffff; color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.btn-secondary:hover { border-color: var(--border-hover); background: #faf9ff; }
.btn-danger  { background: rgba(220,38,38,0.08); color: #b91c1c; border: 1px solid rgba(220,38,38,0.25); }
.btn-danger:hover  { background: rgba(220,38,38,0.15); }
.btn-success { background: rgba(5,150,105,0.08); color: #065f46; border: 1px solid rgba(5,150,105,0.25); }
.btn-success:hover { background: rgba(5,150,105,0.15); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.card:hover { border-color: var(--border-hover); box-shadow: 0 4px 18px rgba(0,0,0,0.1); }
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.6);
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(245,244,255,0.6);
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-strong   { background: rgba(5,150,105,0.1);   color: #065f46; border: 1px solid rgba(5,150,105,0.25); }
.badge-medium   { background: rgba(217,119,6,0.1);   color: #92400e; border: 1px solid rgba(217,119,6,0.25); }
.badge-weak     { background: rgba(220,38,38,0.1);   color: #991b1b; border: 1px solid rgba(220,38,38,0.25); }
.badge-easy     { background: rgba(5,150,105,0.1);   color: #065f46; border: 1px solid rgba(5,150,105,0.25); }
.badge-hard     { background: rgba(220,38,38,0.1);   color: #991b1b; border: 1px solid rgba(220,38,38,0.25); }
.badge-correct  { background: rgba(5,150,105,0.1);   color: #065f46; border: 1px solid rgba(5,150,105,0.25); }
.badge-incorrect{ background: rgba(220,38,38,0.1);   color: #991b1b; border: 1px solid rgba(220,38,38,0.25); }
.badge-pending  { background: rgba(107,114,128,0.1); color: #374151; border: 1px solid rgba(107,114,128,0.25); }
.badge-skipped  { background: rgba(217,119,6,0.1);   color: #92400e; border: 1px solid rgba(217,119,6,0.25); }
.badge-primary  { background: rgba(124,58,237,0.1);  color: #5b21b6; border: 1px solid rgba(124,58,237,0.25); }

/* ── Alerts ── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 1.2rem;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: rgba(5,150,105,0.08);  border: 1px solid rgba(5,150,105,0.25);  color: #065f46; }
.alert-error   { background: rgba(220,38,38,0.08);  border: 1px solid rgba(220,38,38,0.25);  color: #991b1b; }
.alert-warning { background: rgba(217,119,6,0.08);  border: 1px solid rgba(217,119,6,0.25);  color: #92400e; }
.alert-info    { background: rgba(8,145,178,0.08);  border: 1px solid rgba(8,145,178,0.25);  color: #155e75; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-control {
  width: 100%; padding: 11px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Table ── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 12px 16px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
  background: #faf9ff;
}
.table td {
  padding: 13px 16px; border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text-secondary); vertical-align: middle;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(124,58,237,0.03); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Progress ── */
.progress { height: 6px; background: rgba(0,0,0,0.07); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 99px;
  background: var(--accent-grad); transition: width 0.6s ease;
}
.progress-bar.success { background: linear-gradient(90deg, #059669, #34d399); }
.progress-bar.warning { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress-bar.danger  { background: linear-gradient(90deg, #dc2626, #f87171); }

/* ── Section Color Dots ── */
.section-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

/* ── Loading Spinner ── */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(124,58,237,0.15);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  margin: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; display: block; }

/* ============================================================
   HOME PAGE
   ============================================================ */

.home-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(124,58,237,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(79,70,229,0.08) 0%, transparent 55%),
    #f5f4ff;
}

/* Floating navbar */
.home-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 5%;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.home-nav .logo {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700;
  color: var(--text-primary);
}
.home-nav .logo-mark {
  width: 38px; height: 38px;
  background: var(--accent-grad); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.home-nav .nav-links { display: flex; align-items: center; gap: 12px; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 6rem 5% 4rem;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.2);
  color: #7c3aed; border-radius: 99px; padding: 6px 16px;
  font-size: 13px; font-weight: 500; margin-bottom: 2rem;
  animation: fadeInDown 0.6s ease both;
}
.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  animation: fadeInDown 0.7s ease 0.1s both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, #7c3aed, #4f46e5, #0891b2);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.1rem; color: var(--text-secondary); max-width: 600px;
  margin: 0 auto 3rem; animation: fadeInDown 0.7s ease 0.2s both;
}

/* Action Cards */
.action-cards {
  display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
  animation: fadeInUp 0.7s ease 0.3s both;
}
.action-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  width: 300px; text-align: center;
  cursor: pointer; transition: all 0.3s ease;
  position: relative; overflow: hidden;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.action-card:hover { transform: translateY(-6px); border-color: rgba(124,58,237,0.35); box-shadow: 0 12px 40px rgba(124,58,237,0.15); }
.action-card:hover .card-icon { transform: scale(1.1); }
.card-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1.2rem;
  transition: transform 0.3s;
}
.card-icon.purple { background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(79,70,229,0.12)); border: 1px solid rgba(124,58,237,0.2); }
.card-icon.cyan   { background: linear-gradient(135deg, rgba(8,145,178,0.12), rgba(79,70,229,0.12)); border: 1px solid rgba(8,145,178,0.2); }
.action-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.action-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }

/* Sections Showcase */
.sections-section {
  padding: 5rem 5%;
  text-align: center;
}
.section-title { font-family: 'Outfit', sans-serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.section-subtitle { color: var(--text-secondary); font-size: 15px; margin-bottom: 3rem; }
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; max-width: 1000px; margin: 0 auto;
}
.section-chip {
  background: #ffffff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition); cursor: default;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.section-chip:hover { border-color: rgba(124,58,237,0.3); background: #faf9ff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(124,58,237,0.1); color: var(--text-primary); }
.section-chip i { width: 20px; text-align: center; }

/* Stats row */
.stats-row {
  display: flex; justify-content: center; gap: 3rem;
  padding: 3rem 5%; flex-wrap: wrap;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 2rem 0;
  background: #ffffff;
}
.stat-item { text-align: center; }
.stat-item .stat-number { font-family: 'Outfit', sans-serif; font-size: 2.5rem; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-item .stat-label  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Footer */
.home-footer {
  text-align: center; padding: 2rem 5%;
  font-size: 13px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #ffffff;
}

/* ── Animations ── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .action-cards { flex-direction: column; align-items: center; }
  .action-card  { width: 100%; max-width: 340px; }
  .stats-row    { gap: 1.5rem; }
}