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

:root {
  --color-background: #0b0d10;
  --color-surface: #111518;
  --color-surface-2: #191d22;
  --color-border: #252b34;
  --color-border-subtle: #1c2028;

  /* Golden Wattle — Australia's national flower */
  --color-primary: #e8a500;
  --color-primary-dim: rgba(232,165,0,0.13);
  --color-primary-bright: #f5bc22;

  /* Coral Sea teal — student */
  --color-student: #00939e;
  --color-student-dim: rgba(0,147,158,0.13);

  /* Outback ochre — professor */
  --color-professor: #c14b2a;
  --color-professor-dim: rgba(193,75,42,0.13);

  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  --color-on-background: #e2e8f6;
  --color-on-surface: #7a90b0;
  --color-on-surface-2: #a0b4cc;

  --font-headline: 'Sora', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --sidebar-width: 256px;
  --nav-height: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-background);
  color: var(--color-on-background);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Animations ── */
@keyframes fadeUp   { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes spin     { to { transform:rotate(360deg); } }
@keyframes slideIn  { from { opacity:0; transform:translateX(-16px); } to { opacity:1; transform:translateX(0); } }
@keyframes pulse-blue {
  0%,100% { box-shadow: 0 0 0 0 rgba(232,165,0,0.45); }
  50%      { box-shadow: 0 0 0 10px rgba(232,165,0,0); }
}
@keyframes twinkle {
  0%,100% { opacity:.6; transform:scale(1); }
  50%     { opacity:1;  transform:scale(1.25); }
}
@keyframes progress-fill { from { width:0; } to { width: var(--target-width); } }

.anim-1 { animation: fadeUp .5s .05s ease both; }
.anim-2 { animation: fadeUp .5s .15s ease both; }
.anim-3 { animation: fadeUp .5s .25s ease both; }
.anim-4 { animation: fadeUp .5s .35s ease both; }
.anim-5 { animation: fadeUp .5s .45s ease both; }

/* ── Top Nav ── */
.topnav {
  position: fixed; top:0; left:0; right:0; z-index:200;
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(9,13,26,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-headline);
  font-size: 1.15rem; font-weight: 800;
  text-decoration: none; color: var(--color-on-background);
}
.topnav-brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.topnav-brand span { color: var(--color-primary); }
.topnav-right { display: flex; align-items: center; gap: 12px; }
.topnav-user { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; }
.topnav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--color-primary);
}
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.role-badge.student { background: var(--color-student-dim); color: var(--color-student); border: 1px solid rgba(6,182,212,.25); }
.role-badge.professor { background: var(--color-professor-dim); color: var(--color-professor); border: 1px solid rgba(245,158,11,.25); }

/* ── Layout ── */
.app-layout {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-section-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-on-surface); padding: 8px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600;
  color: var(--color-on-surface-2);
  cursor: pointer; transition: all .15s;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--color-surface-2); color: var(--color-on-background); }
.nav-item.active { background: var(--color-primary-dim); color: var(--color-primary); }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 2px;
  background: var(--color-primary);
}
.nav-item.student-active { background: var(--color-student-dim); color: var(--color-student); }
.nav-item.student-active::before { background: var(--color-student); }
.nav-item.professor-active { background: var(--color-professor-dim); color: var(--color-professor); }
.nav-item.professor-active::before { background: var(--color-professor); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px;
  background: var(--color-danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 10px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Main content ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: calc(100vh - var(--nav-height));
}

/* ── Page header ── */
.page-header { margin-bottom: 28px; }
.page-eyebrow {
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-primary); margin-bottom: 4px;
}
.page-title {
  font-family: var(--font-headline);
  font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 800;
  line-height: 1.1;
}
.page-subtitle { color: var(--color-on-surface); font-size: .9rem; margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: var(--font-headline); font-size: .875rem; font-weight: 700;
  border: none; cursor: pointer; transition: all .18s; text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; animation: pulse-blue 3s ease-in-out infinite; }
.btn-primary:hover { background: var(--color-primary-bright); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,126,248,.35); }
.btn-outline { background: transparent; color: var(--color-on-background); border: 1.5px solid var(--color-border); }
.btn-outline:hover { border-color: var(--color-on-surface); background: var(--color-surface-2); }
.btn-student { background: var(--color-student); color: #fff; }
.btn-student:hover { background: #22d3ee; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(6,182,212,.3); }
.btn-professor { background: var(--color-professor); color: #111; }
.btn-professor:hover { background: #fbbf24; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,.3); }
.btn-ghost { background: transparent; color: var(--color-on-surface); border: 1px solid var(--color-border); padding: 8px 16px; }
.btn-ghost:hover { color: var(--color-on-background); border-color: var(--color-on-surface); }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-danger { background: var(--color-danger); color: #fff; }

/* ── Cards ── */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 22px;
}
.card-title {
  font-family: var(--font-headline); font-size: 1rem; font-weight: 700; margin-bottom: 4px;
}
.card-meta { font-size: .8rem; color: var(--color-on-surface); }

/* ── Stat cards ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card-label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-on-surface); }
.stat-card-value { font-family: var(--font-headline); font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card-sub { font-size: .78rem; color: var(--color-on-surface); }
.stat-card.accent-primary .stat-card-value { color: var(--color-primary); }
.stat-card.accent-student .stat-card-value { color: var(--color-student); }
.stat-card.accent-professor .stat-card-value { color: var(--color-professor); }
.stat-card.accent-success .stat-card-value { color: var(--color-success); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.col-span-2 { grid-column: span 2; }

/* ── Course cards ── */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.course-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .2s; cursor: pointer;
}
.course-card:hover { border-color: var(--color-primary); transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.course-card-banner {
  height: 110px; position: relative; overflow: hidden;
}
.course-card-banner img { width:100%; height:100%; object-fit:cover; display:block; }
.course-card-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(59,126,248,.6) 0%, rgba(9,13,26,.4) 100%);
}
.course-card-banner-label {
  position: absolute; bottom: 10px; left: 14px;
  font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(9,13,26,.7); color: var(--color-primary); padding: 3px 8px; border-radius: 4px;
  backdrop-filter: blur(4px);
}
.course-card-body { padding: 16px; }
.course-card-title { font-family: var(--font-headline); font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.course-card-instructor { font-size: .78rem; color: var(--color-on-surface); margin-bottom: 12px; }
.progress-bar-wrap { background: var(--color-surface-2); border-radius: 99px; height: 5px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--color-student); transition: width .6s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: .72rem; color: var(--color-on-surface); margin-top: 5px; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead tr { border-bottom: 1px solid var(--color-border); }
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-on-surface);
}
.data-table tbody tr { border-bottom: 1px solid var(--color-border-subtle); transition: background .12s; }
.data-table tbody tr:hover { background: var(--color-surface-2); }
.data-table td { padding: 12px 14px; }
.data-table td:last-child { text-align: right; }

/* ── Grades ── */
.grade-pill {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-weight: 700; font-size: .8rem;
}
.grade-a { background: rgba(16,185,129,.15); color: #10b981; }
.grade-b { background: rgba(59,126,248,.15); color: #3b7ef8; }
.grade-c { background: rgba(245,158,11,.15); color: #f59e0b; }
.grade-f { background: rgba(239,68,68,.15); color: #ef4444; }

/* ── Assignment items ── */
.assignment-list { display: flex; flex-direction: column; gap: 10px; }
.assignment-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.assignment-icon { font-size: 1.2rem; flex-shrink: 0; }
.assignment-info { flex: 1; }
.assignment-title { font-weight: 600; font-size: .9rem; }
.assignment-meta { font-size: .75rem; color: var(--color-on-surface); margin-top: 2px; }
.assignment-status {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 4px 10px;
  border-radius: 99px; flex-shrink: 0;
}
.status-due { background: rgba(239,68,68,.15); color: var(--color-danger); }
.status-submitted { background: rgba(16,185,129,.15); color: var(--color-success); }
.status-graded { background: rgba(59,126,248,.15); color: var(--color-primary); }
.status-open { background: rgba(245,158,11,.15); color: var(--color-warning); }

/* ── Attendance ── */
.attendance-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.att-day {
  width: 28px; height: 28px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; cursor: default;
}
.att-present { background: rgba(16,185,129,.2); color: var(--color-success); }
.att-absent { background: rgba(239,68,68,.2); color: var(--color-danger); }
.att-late { background: rgba(245,158,11,.2); color: var(--color-warning); }
.att-future { background: var(--color-surface-2); color: var(--color-border); }

/* ── Student roster (professor view) ── */
.student-row-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--color-primary);
  flex-shrink: 0;
}

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--color-border); border-radius: var(--radius-lg);
  padding: 40px; text-align: center;
  transition: all .2s; cursor: pointer;
}
.upload-zone:hover { border-color: var(--color-primary); background: var(--color-primary-dim); }
.upload-icon { font-size: 2.5rem; margin-bottom: 10px; }
.upload-title { font-family: var(--font-headline); font-weight: 700; margin-bottom: 4px; }
.upload-sub { font-size: .85rem; color: var(--color-on-surface); }

/* ── Section divider ── */
.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-heading {
  font-family: var(--font-headline); font-size: 1.05rem; font-weight: 700;
}

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--color-surface-2); border-radius: var(--radius); margin-bottom: 20px; }
.tab {
  flex: 1; padding: 8px 14px; border-radius: 6px; text-align: center;
  font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .15s;
  color: var(--color-on-surface);
}
.tab.active { background: var(--color-surface); color: var(--color-on-background); box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* ── Identity panel ── */
.identity-card {
  background: var(--color-primary-dim); border: 1px solid rgba(59,126,248,.25);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.identity-portrait {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--color-primary); flex-shrink: 0;
}
.identity-info h3 { font-family: var(--font-headline); font-size: 1rem; font-weight: 700; }
.identity-info p { font-size: .8rem; color: var(--color-on-surface); margin-top: 2px; }
#claims-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.claim-item {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 10px 14px;
}
.claim-item strong { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--color-on-surface); margin-bottom: 2px; }
.claim-item span { font-size: .875rem; font-weight: 600; }

/* ── Southern Cross constellation ── */
.southern-cross {
  position: absolute; right: 9%; top: 18%;
  width: 110px; height: 150px;
  pointer-events: none; z-index: 2;
  animation: fadeIn 2.5s ease;
}
.sc-star {
  position: absolute; color: #fff; line-height: 1;
  animation: twinkle 3.5s ease-in-out infinite;
}
.sc-gamma   { top:0;   left:44%; font-size:1.5rem; animation-delay:0s; }
.sc-alpha   { top:66%; left:40%; font-size:2rem;   animation-delay:.4s; }
.sc-beta    { top:38%; left:0;   font-size:1.15rem; animation-delay:.8s; }
.sc-delta   { top:26%; left:82%; font-size:1.05rem; animation-delay:1.2s; }
.sc-epsilon { top:46%; left:64%; font-size:.55rem;  animation-delay:1.6s; }

/* ── Landing page ── */
.landing-hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; padding: 80px 32px;
  background-image: url('https://images.unsplash.com/photo-1523482580672-f109ba8cb9be?auto=format&fit=crop&w=1800&q=80');
  background-size: cover; background-position: center 40%;
  position: relative;
}
.landing-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(9,13,26,.8) 0%, rgba(9,13,26,.97) 100%);
}
.landing-hero > * { position: relative; z-index: 1; }
.landing-eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-primary); margin-bottom: 16px;
}
.landing-title {
  font-family: var(--font-headline); font-size: clamp(2.8rem,7vw,5.5rem);
  font-weight: 800; line-height: 1.05; margin-bottom: 20px;
}
.landing-title em { font-style: normal; color: var(--color-primary); }
.landing-sub { font-size: 1.05rem; color: var(--color-on-surface); max-width: 520px; margin: 0 auto 40px; line-height: 1.75; }
.landing-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.landing-features {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 20px;
  max-width: 860px; margin: 64px auto 0; text-align: left;
}
.feature-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 22px;
  position: relative; overflow: hidden;
}
.feature-card::before { content:''; position:absolute; top:0; left:0; width:3px; height:100%; background:var(--color-primary); }
.feature-icon { font-size:1.4rem; margin-bottom:10px; }
.feature-title { font-family:var(--font-headline); font-size:.95rem; font-weight:700; margin-bottom:6px; }
.feature-desc { font-size:.82rem; color:var(--color-on-surface); line-height:1.6; }
.landing-footer {
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: 24px 32px; text-align: center;
}
.landing-footer-inner { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.brand-text { font-family:var(--font-headline); font-size:1.1rem; font-weight:800; }
.brand-text span { color:var(--color-primary); }

/* ── Role picker ── */
.role-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 24px;
  background: var(--color-background);
}
.role-screen-header { text-align: center; margin-bottom: 40px; }
.role-screen-title { font-family:var(--font-headline); font-size:clamp(1.8rem,4vw,2.6rem); font-weight:800; margin-bottom:8px; }
.role-screen-sub { color:var(--color-on-surface); font-size:.95rem; }
.role-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; max-width: 640px; }
.role-card {
  flex: 1; min-width: 240px;
  background: var(--color-surface); border: 2px solid var(--color-border);
  border-radius: var(--radius-xl); padding: 36px 28px; text-align: center;
  cursor: pointer; transition: all .2s;
}
.role-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.role-card.student-card:hover { border-color: var(--color-student); background: var(--color-student-dim); }
.role-card.professor-card:hover { border-color: var(--color-professor); background: var(--color-professor-dim); }
.role-card-icon { font-size: 3rem; margin-bottom: 16px; }
.role-card-title { font-family:var(--font-headline); font-size:1.4rem; font-weight:800; margin-bottom:8px; }
.role-card.student-card .role-card-title { color: var(--color-student); }
.role-card.professor-card .role-card-title { color: var(--color-professor); }
.role-card-desc { font-size:.85rem; color:var(--color-on-surface); line-height:1.6; }
.role-verified {
  display: flex; align-items: center; gap: 8px;
  font-size:.8rem; color:var(--color-on-surface); margin-top:32px;
}
.role-verified-dot { width:8px; height:8px; border-radius:50%; background:var(--color-success); flex-shrink:0; }

/* ── Callback / Error ── */
.center-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 2rem;
  background: var(--color-background);
}
.spinner {
  width:48px; height:48px; border-radius:50%;
  border:4px solid var(--color-surface-2); border-top-color: var(--color-primary);
  animation: spin .8s linear infinite; margin: 0 auto 1.5rem;
}
.center-title { font-family:var(--font-headline); font-size:1.2rem; font-weight:600; }
.error-icon { font-size:3.5rem; margin-bottom:20px; }
.error-heading { font-family:var(--font-headline); font-size:1.8rem; font-weight:800; margin-bottom:12px; }
#error-message { color:var(--color-on-surface); max-width:460px; margin-bottom:28px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display:none; }
  .main { margin-left:0; }
  .grid-2, .grid-3 { grid-template-columns:1fr; }
  .col-span-2 { grid-column: span 1; }
  .landing-features { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
  .main { padding: 20px 16px; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .role-cards { flex-direction: column; }
}
