
:root {
  --portal-navbar-h: 64px;   /* Height of the fixed top portal navbar    */
  --sidebar-w:       256px;  /* Width of the left sidebar (desktop)      */
  --portal-bg:       #f5f4f1;/* Main content background                  */
  --portal-border:   #e8e5e0;/* Subtle border used throughout portal     */
  --portal-card-bg:  #ffffff;/* Card / panel background                  */
  --sidebar-bg:      #ffffff;/* Sidebar panel background                 */
  --sidebar-hover-bg:var(--neutral-light);
  --sidebar-active-bg:var(--primary-extra-light);
}


/* =====================================================
   PORTAL BODY OVERRIDE
   Post-login pages use a warm neutral background
===================================================== */
body.portal-page {
  background: var(--portal-bg);
}


/* =====================================================
   PORTAL TOP NAVBAR
   Fixed bar across the top of all portal pages.
   Contains: sidebar toggle (mobile), UGA logo/brand,
   student avatar, name, and logout button.
===================================================== */
.portal-navbar {
  height: var(--portal-navbar-h);
  background: var(--secondary-color);
  border-bottom: var(--border-brand);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.portal-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 1.5rem;
  gap: 1rem;
}

/* Left side: toggle + logo */
.portal-nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* UGA logo + "E-Learning Platform" label */
.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}
.portal-brand img {
  height: 32px;
  width: auto;
}
.portal-brand-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: none; /* hidden on very small screens */
}

/* Student pill: avatar + name + logout */
.portal-user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.portal-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.02em;
}

.portal-user-name {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: none; /* revealed at md breakpoint */
}

/* Logout button */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.btn-logout:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* Hamburger for mobile sidebar */
.sidebar-toggler {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.55rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggler:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}


/* =====================================================
   PORTAL SHELL
   Flex row: sidebar (fixed) + main (scrollable)
===================================================== */
.portal-shell {
  display: flex;
  padding-top: var(--portal-navbar-h);
  min-height: 100vh;
}


/* =====================================================
   SIDEBAR
   Fixed left panel containing student card + nav.
===================================================== */
.portal-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--portal-border);
  position: fixed;
  top: var(--portal-navbar-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--primary-extra-light) transparent;
}
.portal-sidebar::-webkit-scrollbar        { width: 4px; }
.portal-sidebar::-webkit-scrollbar-track  { background: transparent; }
.portal-sidebar::-webkit-scrollbar-thumb  { background: var(--primary-extra-light); border-radius: 4px; }

/* ── Student card at top of sidebar ── */
.sidebar-student-card {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
  border-bottom: 2px solid var(--primary-color);
  padding: 1.4rem 1.25rem;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.sidebar-student-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.sidebar-student-id {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-body);
}

.sidebar-grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(186, 12, 47, 0.25);
  border: 1px solid rgba(186, 12, 47, 0.5);
  border-radius: 2px;
  padding: 0.18rem 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  color: var(--primary-extra-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ── Sidebar navigation ── */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.sidebar-nav-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--neutral-mid);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.85rem 1.35rem 0.4rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 1.35rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--neutral-dark);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}
.sidebar-nav-item:hover {
  color: var(--primary-color);
  background: var(--sidebar-hover-bg);
  border-left-color: var(--primary-extra-light);
}
.sidebar-nav-item.active {
  color: var(--primary-color);
  background: var(--sidebar-active-bg);
  border-left-color: var(--primary-color);
  font-weight: 600;
}
.sidebar-nav-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Badge (e.g. "3 new" notification dot) */
.nav-badge {
  margin-left: auto;
  background: var(--primary-color);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── Sidebar footer (help link) ── */
.sidebar-footer {
  border-top: 1px solid #eee;
  padding: 0.85rem 1.25rem;
  flex-shrink: 0;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--neutral-mid);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.sidebar-footer a:hover { color: var(--primary-color); }


/* =====================================================
   MOBILE SIDEBAR OVERLAY
   Dark backdrop that appears behind the sidebar
   on mobile/tablet when the drawer is open.
===================================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1029;
  pointer-events: none;
}
.sidebar-overlay.open {
  display: block;
  pointer-events: auto;
}


/* =====================================================
   PORTAL MAIN CONTENT AREA
   The scrollable area to the right of the sidebar.
===================================================== */
.portal-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--portal-navbar-h));
  background: var(--portal-bg);
  display: flex;
  flex-direction: column;
}


/* =====================================================
   PORTAL PAGE HEADER
   Top bar of each page inside .portal-main.
   Contains: breadcrumb, page title, actions (print, etc.)
===================================================== */
.portal-page-header {
  background: var(--portal-card-bg);
  border-bottom: 1px solid var(--portal-border);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.portal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neutral-mid);
  margin-bottom: 0.3rem;
}
.portal-breadcrumb span { color: var(--primary-color); font-weight: 600; }

.portal-page-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.portal-page-title .page-icon {
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.portal-last-updated {
  font-size: var(--text-xs);
  color: var(--neutral-mid);
  font-family: var(--font-body);
}

/* Print button (shared across pages that have printable content) */
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--neutral-dark);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-print:hover {
  background: var(--neutral-light);
  border-color: var(--neutral-dark);
  color: var(--black);
}


/* =====================================================
   PORTAL CONTENT AREA
   Padded wrapper inside .portal-main below the page header.
===================================================== */
.portal-content {
  padding: 2rem;
  flex: 1;
}


/* =====================================================
   SHARED PORTAL STAT CARDS
   Used on guidelines, dashboard, and content pages
   to show quick at-a-glance numbers.
===================================================== */
.gl-stat-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-mid), transform var(--transition-mid);
}
.gl-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.gl-stat-icon  { font-size: 1.8rem; color: var(--primary-color); margin-bottom: 0.5rem; }
.gl-stat-val   { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--black); line-height: 1; margin-bottom: 0.2rem; }
.gl-stat-label { font-size: var(--text-xs); color: var(--neutral-mid); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-heading); }


/* =====================================================
   SHARED PORTAL SECTION CARDS
   Dark-header card container used across all pages.
===================================================== */
.gl-section-card {
  background: var(--portal-card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--portal-border);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gl-section-header {
  background: var(--secondary-color);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
}

.gl-section-icon {
  width: 34px;
  height: 34px;
  background: rgba(186, 12, 47, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-extra-light);
  font-size: 1rem;
  flex-shrink: 0;
}

.gl-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.gl-section-body { padding: 1.5rem; }


/* =====================================================
   SHARED NOTICE / ALERT BOXES
   Three variants: warning (red), info (blue), success (green)
===================================================== */
.gl-notice {
  background: var(--primary-extra-light);
  border: 1px solid rgba(186, 12, 47, 0.3);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.gl-notice i { color: var(--primary-color); font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.gl-notice p { font-size: var(--text-sm); color: #6b0c1e; line-height: 1.6; margin: 0; }

.gl-notice-info {
  background: #e8f0fe;
  border-color: #4285f4;
  border-left-color: #4285f4;
}
.gl-notice-info i { color: #4285f4; }
.gl-notice-info p { color: #1a3a6b; }

.gl-notice-success {
  background: #e6f4ea;
  border-color: #34a853;
  border-left-color: #34a853;
}
.gl-notice-success i { color: #34a853; }
.gl-notice-success p { color: #1b4f2a; }


/* =====================================================
   PORTAL FOOTER
   Bottom bar of .portal-main.
===================================================== */
.portal-footer {
  background: var(--portal-card-bg);
  border-top: 1px solid var(--portal-border);
  padding: 1rem 2rem;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}
.portal-footer p    { font-size: var(--text-xs); color: var(--neutral-mid); margin: 0; }
.portal-footer a    { color: var(--primary-color); font-size: var(--text-xs); text-decoration: none; }
.portal-footer a:hover { color: var(--primary-light); }
.portal-footer-logo { height: 22px; width: auto; }


/* =====================================================
   SCROLL ANCHOR OFFSET
   Prevents fixed navbar from covering section targets
   when using in-page anchor links.
===================================================== */
.gl-anchor {
  scroll-margin-top: 1.5rem;
}


/* =====================================================
   PORTAL RESPONSIVE — SHARED BREAKPOINTS
===================================================== */

/* Show brand label from 576px */
@media (min-width: 576px) {
  .portal-brand-label { display: block; }
}

/* Show student name in navbar from 768px */
@media (min-width: 768px) {
  .portal-user-name { display: block; }
}

/* On desktop (≥992px): sidebar is always visible, toggler hidden */
@media (min-width: 992px) {
  .sidebar-toggler { display: none; }
}

/* On mobile/tablet (<992px): sidebar slides off-screen */
@media (max-width: 991.98px) {
  .portal-sidebar {
    transform: translateX(-100%);
  }
  .portal-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
  }
  .portal-main {
    margin-left: 0;
  }
}

/* Tighter padding on small screens */
@media (max-width: 767.98px) {
  .portal-page-header {
    padding: 1rem 1.25rem;
  }
  .portal-content {
    padding: 1.25rem;
  }
  .portal-footer {
    padding: 0.85rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}