/* Save My Exams Theme & Visual Styles */
:root {
  --font-family: 'Outfit', sans-serif;
  
  /* Save My Exams Light Theme Color Palette */
  --bg-color: #f7f6fd; /* Soft grayish-purple background */
  --card-bg: #ffffff;
  --text-primary: #0a081d; /* Dark violet/black text */
  --text-secondary: #4a475d;
  --text-muted: #8d8a9e;
  
  --primary-purple: #503df5; /* Save My Exams Indigo */
  --primary-purple-hover: #3d2ad9;
  --primary-purple-light: #efeeff;
  
  --border-color: #e5e5f0;
  --border-color-focus: #503df5;
  
  --accent-red: #8b0000;
  --accent-red-bg: #ffebeb;
  --accent-green: #0d5a37;
  --accent-green-bg: #ebfffa;
  --accent-yellow: #f59e0b;
  --accent-yellow-bg: #fef3c7;
  
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(80, 61, 245, 0.05), 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* Dark Mode Variables Override */
body.dark-mode {
  --bg-color: #0b0a13;
  --card-bg: #131221;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-purple: #6366f1;
  --primary-purple-hover: #4f46e5;
  --primary-purple-light: rgba(99, 102, 241, 0.15);
  
  --border-color: #24223d;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.45;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Top Navigation Bar */
.top-nav {
  height: 64px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  color: var(--primary-purple);
  display: flex;
}

.logo-text {
  font-weight: 850;
  font-size: 1.15rem;
  letter-spacing: -0.75px;
  display: flex;
  flex-direction: column;
}

.logo-text span {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}


.nav-link {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.nav-link:hover {
  color: var(--primary-purple);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.nav-dropdown-trigger {
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
}

.nav-dropdown-trigger:hover {
  color: var(--primary-purple);
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  margin-top: 0.75rem;
  min-width: 185px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 210;
  display: none;
  flex-direction: column;
  padding: 0.35rem 0;
}

.nav-dropdown-wrapper:hover .nav-dropdown-content {
  display: flex;
}

.nav-dropdown-content a, .dropdown-submenu-trigger {
  padding: 0.65rem 1.25rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
  border: none;
  background: transparent;
  width: 100%;
}

.nav-dropdown-content a:hover, .dropdown-submenu-trigger:hover {
  background: var(--primary-purple-light);
  color: var(--primary-purple);
}

.dropdown-submenu-trigger {
  position: relative;
}

.dropdown-submenu-content {
  position: absolute;
  top: 0;
  left: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 220;
  display: none;
  flex-direction: column;
  padding: 0.35rem 0;
  margin-left: 0.25rem;
}

.dropdown-submenu-trigger:hover .dropdown-submenu-content {
  display: flex;
}

.nav-center-search {
  flex: 1;
  max-width: 480px;
  margin: 0 2rem;
  position: relative;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  margin-top: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 200;
  padding: 0.35rem 0;
}

.search-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.search-dropdown-item:hover {
  background: var(--primary-purple-light);
}

.search-dropdown-item span.name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.search-dropdown-item span.code {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.45rem 1.25rem;
  transition: var(--transition-smooth);
}

.search-box:focus-within {
  border-color: var(--primary-purple);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px var(--primary-purple-light);
}

.search-box-icon {
  color: var(--text-muted);
  margin-right: 0.75rem;
  display: flex;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.clear-search-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--text-muted);
  cursor: pointer;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.upgrade-btn {
  background-color: var(--primary-purple);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 0.45rem 1.25rem;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(80, 61, 245, 0.15);
  transition: var(--transition-smooth);
}

.upgrade-btn:hover {
  background-color: var(--primary-purple-hover);
  transform: translateY(-1px);
}

/* Workspace Frame (Sidebar + Content Container) */
.workspace-frame {
  margin-top: 64px;
  display: flex;
  min-height: calc(100vh - 64px);
  width: 100vw;
}

/* Left Sidebar Menu */
.left-sidebar {
  width: 240px;
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  z-index: 90;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  letter-spacing: 0.5px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sidebar-item:hover {
  background-color: var(--bg-color);
  color: var(--text-primary);
}

.sidebar-item.active {
  background-color: var(--primary-purple-light);
  color: var(--primary-purple);
}

.sidebar-item-icon {
  display: flex;
  color: var(--text-muted);
}

.sidebar-item.active .sidebar-item-icon {
  color: var(--primary-purple);
}

.sidebar-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Content Area Wrapper */
.main-content {
  flex: 1;
  margin-left: 240px; /* Leave space for sidebar */
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: calc(100vw - 240px);
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Sidebar overrides */
.workspace-frame.sidebar-collapsed .left-sidebar {
  transform: translateX(-240px);
}

.workspace-frame.sidebar-collapsed .main-content {
  margin-left: 0;
  width: 100vw;
}

/* Page Headers & Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.breadcrumbs a:hover {
  color: var(--primary-purple);
}

.breadcrumbs span.separator {
  color: var(--text-muted);
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ---------------------------------------------------- */
/* PAGE 1: DASHBOARD ("My courses") */
/* ---------------------------------------------------- */
.courses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.courses-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.courses-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 800px;
}

/* Subject Course Card */
.course-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(80, 61, 245, 0.2);
}

.course-card-top {
  padding: 0.65rem 1.25rem;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.course-card-body {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Subject Cover Book Thumbnail */
.course-cover {
  width: 72px;
  height: 90px;
  border-radius: var(--border-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  font-weight: 800;
  font-size: 0.85rem;
  overflow: hidden;
}

.course-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: rgba(0, 0, 0, 0.25); /* Spine shadow */
}

/* Cover Colors dynamically assigned */
.cover-accounting { background: linear-gradient(135deg, #10b981, #047857); }
.cover-chemistry { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.cover-economics { background: linear-gradient(135deg, #dc2626, #991b1b); }
.cover-english-b { background: linear-gradient(135deg, #ec4899, #be185d); }
.cover-esl { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.cover-english-lit { background: linear-gradient(135deg, #d946ef, #a21caf); }
.cover-math-further { background: linear-gradient(135deg, #f59e0b, #b45309); }
.cover-math-a { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.cover-math-b { background: linear-gradient(135deg, #6366f1, #4338ca); }
.cover-physics { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.course-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.course-badge {
  font-size: 0.65rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  align-self: flex-start;
  font-weight: 700;
  text-transform: uppercase;
}

.course-info h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.course-links {
  display: flex;
  flex-direction: column;
  width: 260px;
  border-left: 1px solid var(--border-color);
  padding-left: 1.5rem;
  gap: 0.5rem;
}

.course-link-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--primary-purple);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.course-link-btn:hover {
  color: var(--primary-purple-hover);
  transform: translateX(3px);
}

/* Edit / Add Course Buttons */
.icon-btn-gray {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn-gray:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.add-course-btn {
  background-color: var(--primary-purple);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 0.5rem 1rem;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.add-course-btn:hover {
  background-color: var(--primary-purple-hover);
}

/* Empty Dashed course selector card */
.got-course-panel {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  max-width: 800px;
}

.got-course-panel p {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------------------------------------------------- */
/* PAGE 2: SUBJECT LANDING RESOURCE OVERVIEW */
/* ---------------------------------------------------- */
.spec-download-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem 1.5rem;
  max-width: 800px;
  box-shadow: var(--shadow-sm);
}

.spec-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.outline-btn-sm {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.outline-btn-sm:hover {
  border-color: var(--text-primary);
  background: var(--bg-color);
}

.landing-tabs-bar {
  border-bottom: 2px solid var(--border-color);
  display: flex;
  max-width: 800px;
}

.landing-tab-item {
  border: none;
  background: transparent;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-smooth);
}

.landing-tab-item.active {
  color: var(--primary-purple);
  border-bottom-color: var(--primary-purple);
}

.practice-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 800px;
}

.practice-section h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.practice-section p.subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

/* Landing card style */
.practice-resource-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.practice-resource-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(80, 61, 245, 0.15);
}

.resource-card-tags {
  display: flex;
  gap: 0.4rem;
}

.tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.tag-study { background: var(--accent-green-bg); color: var(--accent-green); }
.tag-practice { background: var(--accent-blue-bg); color: var(--accent-blue); }
.tag-diagnose { background: var(--accent-yellow-bg); color: var(--accent-yellow); }

.resource-card-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.resource-card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.resource-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.link-action-purple {
  background: transparent;
  border: none;
  color: var(--primary-purple);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.link-action-purple:hover {
  color: var(--primary-purple-hover);
  transform: translateX(2px);
}

.link-action-muted {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.link-action-muted:hover {
  color: var(--text-primary);
}

/* ---------------------------------------------------- */
/* PAGE 3: PAST PAPERS GRID VIEW BY YEAR */
/* ---------------------------------------------------- */
.papers-head-badge {
  font-size: 0.7rem;
  background: var(--primary-purple-light);
  color: var(--primary-purple);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Page description text */
.papers-intro-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.5;
}

/* Papers year container panel */
.year-section-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1000px;
}

/* Progress bar panel header */
.year-progress-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.year-progress-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
}

.progress-text-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

/* Progress bar line element */
.progress-bar-bg {
  flex: 1;
  max-width: 150px;
  height: 6px;
  background: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-purple);
  width: 0%; /* Dynamic */
  border-radius: 9999px;
  transition: width 0.4s ease-out;
}

/* Paper variants grid layout */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

/* Paper Variant Card */
.paper-variant-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition-smooth);
}

.paper-variant-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(80, 61, 245, 0.15);
}

.paper-variant-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

.paper-variant-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: -0.4rem;
}

/* Score Tracker Input Box Layout */
.score-tracker-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-color);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0;
}

.score-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.score-inputs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.max-mark-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 0.15rem;
}

.score-num-input {
  width: 48px;
  text-align: center;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
  transition: var(--transition-smooth);
}

.score-num-input:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 2px var(--primary-purple-light);
}

/* Action Outline Buttons */
.card-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
}

.outline-action-btn {
  width: 100%;
  padding: 0.55rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* Question Paper Button (Purple) */
.btn-qp {
  background-color: transparent;
  border: 1px solid var(--primary-purple);
  color: var(--primary-purple);
}

.btn-qp:hover {
  background-color: var(--primary-purple);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(80, 61, 245, 0.2);
}

/* Mark Scheme Button (Gray) */
.btn-ms {
  background-color: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
}

.btn-ms:hover {
  background-color: var(--text-secondary);
  color: var(--card-bg);
}

/* More downloads collapsible menu */
.collapsible-downloads {
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.collapse-trigger-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.25rem 0;
}

.collapse-trigger-btn:hover {
  color: var(--text-primary);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.paper-variant-card.open-downloads .collapsible-content {
  max-height: 120px;
}

.collapsed-download-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem;
  background: var(--bg-color);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.collapsed-download-link:hover {
  background: var(--primary-purple-light);
  color: var(--primary-purple);
}

/* ---------------------------------------------------- */
/* MODAL POPUPS (Course Activator / Add Course) */
/* ---------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 8, 29, 0.4);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.modal-add-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-add-item:hover {
  background: var(--primary-purple-light);
  border-color: var(--primary-purple);
}

.modal-add-item span.code {
  font-weight: 800;
  font-size: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.modal-add-item span.name {
  font-weight: 600;
  font-size: 0.85rem;
  flex: 1;
  margin-left: 0.75rem;
  text-align: left;
}

.modal-add-icon {
  color: var(--primary-purple);
  display: flex;
}

/* ---------------------------------------------------- */
/* GENERAL LAYOUT (Empty state & Footers) */
/* ---------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 320px;
}

.empty-icon-container {
  background: var(--primary-purple-light);
  border: 1px solid rgba(80, 61, 245, 0.1);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--primary-purple);
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 420px;
  line-height: 1.5;
}

/* Footer & Guide Box */
.guide-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guide-box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.guide-box-title .info-icon-glow {
  color: var(--primary-purple);
  display: flex;
}

.guide-box p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-box p code {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--primary-purple);
}

.app-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.footer-left {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-left p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.copyright-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.contact-email {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.contact-email svg {
  color: var(--text-muted);
}

.contact-email span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
}

.contact-email:hover {
  color: var(--primary-purple);
}

.contact-email:hover svg {
  color: var(--primary-purple);
}

.contact-email:hover span {
  color: var(--text-secondary);
}

/* Theme Toggle Button in Sidebar bottom */
.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.theme-toggle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.theme-toggle-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

/* Hide content sections helper */
.view-section {
  display: none;
}

.view-section.active-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Scrollbar adjustment for dark mode modal */
.modal-body-list::-webkit-scrollbar {
  width: 4px;
}

/* Responsive view grids */
@media (max-width: 900px) {
  .workspace-frame {
    flex-direction: column;
  }
  
  .left-sidebar {
    position: relative;
    top: 0;
    width: 100vw;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .main-content {
    margin-left: 0;
    width: 100vw;
    padding: 1.25rem 1rem;
  }
  
  .course-card-body {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .course-links {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 1rem;
    margin-top: 0.5rem;
  }
}

/* Left Slide-out Drawer Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 8, 29, 0.4);
  backdrop-filter: blur(2px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer panel container */
.drawer-panel {
  width: 280px;
  height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.drawer-overlay.open .drawer-panel {
  transform: translateX(0);
}

.drawer-view {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer-view.active-view {
  display: flex;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drawer-item:hover {
  background-color: var(--bg-color);
  color: var(--text-primary);
}

.drawer-item-expandable svg {
  color: var(--text-muted);
}

.drawer-back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: var(--transition-smooth);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding-bottom: 0.75rem;
  width: 100%;
  text-align: left;
}

.drawer-back-btn:hover {
  color: var(--primary-purple);
}

.drawer-section-title {
  font-size: 1.25rem;
  font-weight: 850;
  color: var(--text-primary);
  padding: 0 1rem 0.5rem 1rem;
  letter-spacing: -0.5px;
}

.drawer-subsection-title {
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.25rem 1rem;
  letter-spacing: 0.5px;
}

.drawer-subject-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drawer-subject-list a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.drawer-subject-list a:hover {
  background-color: var(--primary-purple-light);
  color: var(--primary-purple);
}

/* Sidebar toggle handle button fixed to left margin */
.sidebar-toggle-handle {
  position: fixed;
  top: 80px;
  left: 0;
  z-index: 95;
  background: var(--primary-purple);
  color: white;
  border: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  width: 24px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
}

.sidebar-toggle-handle:hover {
  width: 28px;
  background: var(--primary-purple-hover);
}
