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

:root {
  --bg: #f4f7fa;
  --bg-soft: #ffffff;
  --ink: #101828;
  --muted: #475467;
  --line: #eaecf0;
  --teal: #00796B;
  --teal-dark: #004D40;
  --teal-soft: #E0F2F1;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-md: 0 12px 24px -4px rgba(0,0,0,0.08);
  --gradient: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Manrope', sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1,h2,h3 { font-family: 'Sora', sans-serif; }
a { text-decoration: none; color: inherit; }

/* ── Animations ───────────────────────── */
@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.animate-slide-up { animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.delay-100 { animation-delay: 100ms; opacity: 0; }
.delay-200 { animation-delay: 200ms; opacity: 0; }

/* ── Landing Page ─────────────────────── */
.landing-body {
  background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
  position: relative; overflow-x: hidden;
}
.landing-nav {
  padding: 24px 48px; display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 10;
}
.brand { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--teal-dark); }
.nav-links { display: flex; gap: 24px; font-weight: 600; font-size: 0.95rem; }

.landing-main {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 40px 20px; text-align: center; position: relative; z-index: 10;
}
.hero-title { font-size: 4rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; max-width: 900px; margin-bottom: 24px; color: var(--ink); }
.hero-subtitle { font-size: 1.25rem; color: var(--muted); max-width: 600px; margin: 0 auto 40px; line-height: 1.5; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s; border: none; font-family: inherit;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 14px rgba(0, 121, 107, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 121, 107, 0.4); }

.stats-section { display: flex; gap: 40px; margin-top: 80px; }
.stat-card {
  background: rgba(255,255,255,0.8); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.5);
  padding: 24px 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.stat-value { font-family: 'Sora', sans-serif; font-size: 2.5rem; font-weight: 800; color: var(--teal-dark); }
.stat-label { font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; }

/* Landing Background Blobs */
.landing-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; filter: blur(80px); opacity: 0.4; border-radius: 50%; }
.blob-1 { width: 500px; height: 500px; background: #80CBC4; top: -100px; right: -100px; }
.blob-2 { width: 600px; height: 600px; background: #B2DFDB; bottom: -200px; left: -200px; }

/* ── Dashboard Layout ─────────────────── */
.sidebar {
  width: 260px; background: #fff; border-right: 1px solid var(--line);
  position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; z-index: 100;
}
.sidebar-brand { padding: 30px 24px; }
.logo-text { font-family: 'Sora', sans-serif; font-size: 1.25rem; font-weight: 800; color: var(--teal-dark); }
.logo-sub { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.sidebar-nav { padding: 0 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-md); font-weight: 600; color: var(--muted);
  cursor: pointer; border: none; background: transparent; font-family: inherit; font-size: 0.95rem;
  transition: all 0.2s; text-align: left; width: 100%;
}
.sidebar .nav-link:hover { background: var(--bg); color: var(--ink); }
.sidebar .nav-link.active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; }
.sidebar .icon { font-size: 1.2rem; }

.sidebar-footer { padding: 20px 24px; border-top: 1px solid var(--line); }
.user-pill { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.user-name { font-weight: 700; font-size: 0.9rem; color: var(--ink); line-height: 1.2; }
.user-role { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.logout-btn { margin-left: auto; color: var(--muted); font-size: 1.2rem; transition: color 0.2s; }
.logout-btn:hover { color: #d93025; }

.workspace { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  padding: 24px 40px; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: #fff;
}
.topbar-title { font-size: 1.25rem; font-weight: 700; }
.topbar-spacer { flex: 1; }
.gamification-header { display: flex; gap: 16px; font-weight: 700; font-size: 0.9rem; }
.streak-badge, .level-badge { padding: 8px 16px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); display: flex; align-items: center; gap: 6px; }

.content { padding: 40px; flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ── UI Components ────────────────────── */
.welcome-card {
  background: var(--gradient); border-radius: var(--radius-xl); padding: 32px 40px; color: #fff;
  display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}
.welcome-card .gradient-text { background: #fff; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.welcome-xp { width: 300px; background: rgba(0,0,0,0.1); padding: 16px; border-radius: var(--radius-md); }

.section-header { margin-bottom: 20px; }
.section-title { font-size: 1.2rem; font-weight: 700; color: var(--ink); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.card { background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); transition: all 0.2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(0,121,107,0.2); }
.card-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; color: var(--ink); }
.card-sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: auto; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 999px; transition: width 1s ease-out; }

.table-wrap { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 16px 24px; background: var(--bg); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
td { padding: 16px 24px; border-bottom: 1px solid var(--line); font-size: 0.9rem; font-weight: 500; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #fcfcfd; }

.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge-amber { background: #FEF0C7; color: #DC6803; }
.badge-rose { background: #FEE4E2; color: #D92D20; }
.badge-ok { background: #D1FADF; color: #039855; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.kpi-card { background: #fff; padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-top: 4px solid var(--teal); }
.kpi-card.amber { border-top-color: #F79009; }
.kpi-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.kpi-value { font-size: 2.5rem; font-weight: 800; font-family: 'Sora', sans-serif; color: var(--ink); }

/* ── Upgraded UI Components ──────────────── */
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.btn-outline:hover { background: var(--bg); border-color: var(--muted); }
.btn-outline.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-dark); }
.notification-bell { position: relative; font-size: 1.2rem; cursor: pointer; padding: 8px; }

/* Profile Header */
.profile-header {
  background: #fff; padding: 32px 40px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.profile-info { display: flex; align-items: center; gap: 24px; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--gradient); display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem; font-weight: 800; font-family: 'Sora'; }
.profile-details h1 { font-size: 1.8rem; margin-bottom: 4px; }
.profile-details p { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.profile-stats { display: flex; gap: 32px; }
.stat-box { display: flex; flex-direction: column; min-width: 100px; }
.stat-val { font-size: 1.25rem; font-weight: 800; font-family: 'Sora'; color: var(--ink); }
.stat-lbl { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-top: 4px; }

/* Schedule Grid */
.schedule-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.schedule-col { flex: 1; background: #fff; border-radius: var(--radius-lg); padding: 16px; border: 1px solid var(--line); }

/* Badges extended */
.badge-outline { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.azure { border-top-color: #007BFF !important; }
.badge-azure { background: #E6F2FF; color: #007BFF; }
:root { --azure: #007BFF; --border: #eaecf0; }

/* ── Modals ──────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(16, 24, 40, 0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
  background: #fff; width: 100%; max-width: 500px; padding: 32px;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  transform: translateY(20px); transition: all 0.3s ease;
  position: relative;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-close {
  position: absolute; top: 20px; right: 20px; background: none; border: none;
  font-size: 1.5rem; cursor: pointer; color: var(--muted);
}
.modal-close:hover { color: var(--rose); }
.form-input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); font-family: inherit; font-size: 1rem; margin-top: 8px; margin-bottom: 24px; }
.form-input:focus { outline: none; border-color: var(--teal); }
input[type="range"] { width: 100%; margin: 16px 0; }

/* ── Dropdowns ───────────────────────────── */
.dropdown-menu {
  position: absolute; top: 120%; right: -10px; width: 320px;
  background: #fff; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: all 0.2s ease; z-index: 2000; text-align: left;
  cursor: default;
}
.dropdown-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
  padding: 16px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 1rem; color: var(--ink);
}
.notif-item {
  padding: 16px; border-bottom: 1px solid var(--line);
  display: flex; gap: 12px; align-items: flex-start;
  transition: background 0.2s; cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 1.5rem; }
.notif-title { font-weight: 600; font-size: 0.9rem; color: var(--ink); margin-bottom: 4px; }
.notif-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.notif-time { font-size: 0.75rem; color: #a0aec0; margin-top: 4px; display: block; }
