/* AMD Teachers Library — Modern Design System & Stylesheet */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.18);
  
  --secondary: #0f172a;
  --secondary-surface: #1e293b;
  
  --amber: #f59e0b;
  --amber-hover: #d97706;
  --amber-light: #fef3c7;
  
  --emerald: #10b981;
  --emerald-light: #ecfdf5;
  
  --rose: #f43f5e;
  --rose-light: #fff1f2;
  
  --cyan: #06b6d4;
  --cyan-light: #ecfeff;
  
  --ink: #0f172a;
  --ink-muted: #64748b;
  --ink-light: #94a3b8;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 14px 34px -4px rgba(15, 23, 42, 0.09), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 16px 36px -4px rgba(79, 70, 229, 0.12), 0 6px 16px -2px rgba(15, 23, 42, 0.06);

  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg-page);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 15px;
}

.container {
  width: 100%;
  max-width: 1280px;
  padding: 0 32px;
  margin: 0 auto;
}

/* Announcement Topbar */
.announcement {
  background: #0b1120;
  color: #cbd5e1;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.announcement-inner {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
  padding-bottom: 4px;
}
.announcement-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.announcement-pill svg {
  width: 12px;
  height: 12px;
}
.announcement-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--amber);
  font-weight: 600;
  transition: color 0.15s ease;
}
.announcement-link:hover {
  color: #fde68a;
}
.announcement-link svg {
  width: 13px;
  height: 13px;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
  color: #fff;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}
.brand-mark svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}
.brand-glow {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.04em;
  color: var(--secondary);
}
.brand-title strong {
  color: var(--primary);
}
.brand-tagline {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.nav-link {
  padding: 8px 0;
  position: relative;
  transition: color 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 999px;
  background: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Reusable Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}
.button:hover {
  transform: translateY(-1.5px);
}
.button:active {
  transform: translateY(0);
}
.button.small {
  min-height: 38px;
  padding: 8px 15px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}
.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}
.button-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}
.button-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--ink);
}
.button-outline:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.button-light-outline {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.button-light-outline:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}
.button-text {
  background: transparent;
  box-shadow: none;
  color: var(--ink-muted);
}
.button-text:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.button-whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.28);
}
.button-whatsapp:hover {
  background: #1eb956;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.38);
}
.button-google {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.button-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.account-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease;
}
.account-button:hover {
  transform: scale(1.05);
}

/* HERO SECTION */
.hero {
  padding-top: 24px;
  padding-bottom: 40px;
}
.hero-card {
  background: radial-gradient(circle at 85% 20%, rgba(79, 70, 229, 0.25) 0%, transparent 60%),
              radial-gradient(circle at 15% 90%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
              #0b1120;
  border-radius: var(--radius-xl);
  color: #ffffff;
  padding: 56px 64px 64px;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(11, 17, 32, 0.4);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e2e8f0;
}
.hero-badge svg {
  color: var(--amber);
  width: 14px;
  height: 14px;
}
.hero-title {
  font-size: clamp(38px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-top: 20px;
}
.hero-gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-description {
  font-size: 15.5px;
  line-height: 1.7;
  color: #cbd5e1;
  max-width: 500px;
  margin-top: 18px;
}
.hero-cta-group {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.hero-meta-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-meta-item svg {
  width: 14px;
  height: 14px;
  color: #34d399;
}
.hero-meta-dot {
  color: #475569;
}

.uganda-flag {
  width: 19px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  position: relative;
  background: linear-gradient(
    #111 0% 16.6%,
    #fbbf24 16.6% 33.3%,
    #ef4444 33.3% 50%,
    #111 50% 66.6%,
    #fbbf24 66.6% 83.3%,
    #ef4444 83.3% 100%
  );
  vertical-align: middle;
}
.uganda-flag::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-visual-art img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.35));
}
.hero-floating-stat {
  position: absolute;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.hero-floating-stat.stat-1 {
  bottom: 15px;
  left: 0;
}
.hero-floating-stat.stat-2 {
  top: 25px;
  right: -10px;
}
.hero-floating-stat svg {
  width: 22px;
  height: 22px;
  color: var(--amber);
}
.hero-floating-stat strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
}
.hero-floating-stat span {
  font-size: 11px;
  color: #94a3b8;
}

/* Search Bar Floating Overlay */
.search-wrap {
  max-width: 960px;
  margin: -32px auto 0;
  position: relative;
  z-index: 10;
}
.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 10px 8px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  gap: 12px;
  transition: all 0.2s ease;
}
.search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 16px 38px -6px rgba(79, 70, 229, 0.18);
}
.search-icon {
  color: var(--primary);
  width: 22px;
  height: 22px;
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 15px;
  color: var(--ink);
}
.search-bar input:focus {
  outline: none;
}
.search-bar input::placeholder {
  color: var(--ink-light);
}
.search-submit {
  min-height: 48px;
  border-radius: var(--radius-md);
}

.quick-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  padding: 0 8px;
}
.quick-tags-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.quick-chip {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.quick-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Features Strip */
.features-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.feature-item {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.feature-item strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
}
.feature-item p {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
}

/* SECTION COMMONS */
.section {
  padding: 64px 0;
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-header.center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.section-title {
  font-size: 32px;
  letter-spacing: -0.03em;
  color: var(--secondary);
}
.section-title span {
  color: var(--primary);
}
.section-lead {
  font-size: 15px;
  color: var(--ink-muted);
  max-width: 520px;
}

/* LEVELS GRID */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.level-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.level-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}
.level-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.level-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.level-badge.nursery { background: var(--rose-light); color: var(--rose); }
.level-badge.primary { background: var(--emerald-light); color: var(--emerald); }
.level-badge.olevel { background: var(--primary-light); color: var(--primary); }
.level-badge.alevel { background: #f3e8ff; color: #9333ea; }
.level-arrow {
  color: var(--ink-light);
  transition: transform 0.2s ease, color 0.2s ease;
}
.level-card:hover .level-arrow {
  color: var(--primary);
  transform: translateX(4px);
}
.level-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--ink);
}
.level-card p {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
  flex-grow: 1;
}
.level-action {
  display: inline-block;
  margin-top: 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
}

/* LIBRARY CATALOGUE LAYOUT */
.library-section {
  background: #ffffff;
  border-top: 1px solid var(--border);
}
.library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.library-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 36px;
  align-items: flex-start;
}

/* FILTERS SIDEBAR */
.filters-sidebar {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 96px;
}
.filters-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.filters-top h3 {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.text-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  padding: 2px 4px;
}
.text-link:hover {
  text-decoration: underline;
}

.filter-group {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}
.filter-group legend {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.filter-radio-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 2px;
}
.filter-radio-pill:hover {
  background: rgba(79, 70, 229, 0.06);
}
.filter-radio-pill input {
  accent-color: var(--primary);
  margin: 0;
  cursor: pointer;
}

.filter-select-group {
  margin-bottom: 16px;
}
.filter-select-group label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.select-wrapper select {
  width: 100%;
  appearance: none;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 9px 34px 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}
.select-wrapper select:focus {
  border-color: var(--primary);
  outline: none;
}
.select-chevron {
  position: absolute;
  right: 10px;
  pointer-events: none;
  width: 14px;
  height: 14px;
  color: var(--ink-light);
}

.sidebar-help-card {
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.sidebar-help-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--amber-light);
  color: var(--amber);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}
.sidebar-help-card h4 {
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 4px;
}
.sidebar-help-card p {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.sidebar-help-card .button {
  width: 100%;
}

/* CATALOGUE TABS & TOOLBAR */
.catalogue-content {
  min-width: 0;
}
.resource-type-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.tab-btn.selected {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.catalogue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.results-count {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-wrapper select {
  min-width: 140px;
  font-size: 12.5px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.view-mode-toggle {
  display: flex;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.view-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  transition: all 0.15s ease;
}
.view-btn.selected {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.mobile-filter-btn {
  display: none;
}

/* BANNER NOTICE */
.catalogue-banner {
  margin-bottom: 20px;
}
.banner-notice {
  background: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}
.banner-notice.error {
  background: var(--rose-light);
  border-color: rgba(244, 63, 94, 0.3);
  color: #9f1239;
}

/* RESOURCE CARDS GRID */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.resource-grid.list-view {
  grid-template-columns: 1fr;
}

/* INDIVIDUAL CARD */
.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

/* Card Cover Banner */
.card-cover {
  height: 110px;
  padding: 14px;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}
.theme-emerald .card-cover { background: linear-gradient(135deg, #065f46 0%, #047857 100%); color: #ffffff; }
.theme-indigo .card-cover { background: linear-gradient(135deg, #312e81 0%, #4338ca 100%); color: #ffffff; }
.theme-amber .card-cover { background: linear-gradient(135deg, #78350f 0%, #b45309 100%); color: #ffffff; }
.theme-rose .card-cover { background: linear-gradient(135deg, #881337 0%, #be123c 100%); color: #ffffff; }
.theme-cyan .card-cover { background: linear-gradient(135deg, #164e63 0%, #0e7490 100%); color: #ffffff; }
.theme-slate .card-cover { background: linear-gradient(135deg, #1e293b 0%, #334155 100%); color: #ffffff; }

.sample-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--secondary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.card-cover-art {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cover-doc-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}
.cover-doc-icon svg {
  width: 20px;
  height: 20px;
}
.cover-text-group {
  flex: 1;
  margin-left: 12px;
  display: flex;
  flex-direction: column;
}
.cover-subject {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 0.85;
}
.cover-class {
  font-size: 14px;
  font-weight: 800;
}
.cover-type {
  font-size: 9.5px;
  opacity: 0.75;
}
.cover-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0.3;
}
.cover-lines span {
  display: block;
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

/* Card details */
.card-details {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-class {
  background: #f1f5f9;
  color: var(--ink);
}
.badge-type {
  background: var(--primary-light);
  color: var(--primary);
}
.badge-term {
  background: #f8fafc;
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}
.card-meta {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}
.meta-dot {
  color: var(--ink-light);
}

.card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-uploader {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.uploader-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.uploader-name {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  transition: all 0.15s ease;
}
.card-btn-view {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
}
.card-btn-view:hover {
  background: var(--primary);
  color: #ffffff;
}
.card-btn-view svg {
  width: 14px;
  height: 14px;
}
.card-btn-download {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  background: #ffffff;
}
.card-btn-download:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.card-btn-download svg {
  width: 14px;
  height: 14px;
}

/* Empty State */
.empty-state-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  max-width: 540px;
  margin: 30px auto;
}
.empty-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}
.empty-icon-circle svg {
  width: 28px;
  height: 28px;
}
.empty-state-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.empty-state-box p {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}
.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.catalogue-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  padding-top: 32px;
  text-align: center;
}
.catalogue-footer-note svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.load-more-btn {
  margin: 32px auto 0;
  display: block;
}

/* HOW IT WORKS SECTION */
.how-section {
  background: var(--bg-page);
  border-top: 1px solid var(--border);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.step-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.step-num-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: #e2e8f0;
  line-height: 1;
}
.step-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}
.step-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--ink);
}
.step-card p {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* COMMUNITY BANNER */
.community-section {
  padding-bottom: 64px;
}
.community-banner {
  background: linear-gradient(135deg, #0b1120 0%, #1e1b4b 100%);
  border-radius: var(--radius-xl);
  color: #ffffff;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.community-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.12);
  filter: blur(80px);
  right: -50px;
  top: -50px;
}
.community-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}
.community-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 211, 102, 0.15);
  color: #4ade80;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.community-tag svg {
  width: 14px;
  height: 14px;
}
.community-content h2 {
  font-size: 32px;
  line-height: 1.25;
  margin-bottom: 12px;
}
.community-content p {
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 28px;
}
.community-btn-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* FOOTER */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.footer-mission {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 380px;
  margin-top: 14px;
}
.footer-links-col h4 {
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.footer-links-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links-col a {
  font-size: 13px;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}
.footer-links-col a:hover {
  color: var(--primary);
}
.inline-svg {
  width: 14px;
  height: 14px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 12.5px;
  color: var(--ink-light);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-badge-uganda {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
}

/* ================= MODAL BASE STYLING ================= */
dialog.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: #ffffff;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.35);
  max-width: 90vw;
  position: fixed;
  inset: 0;
  margin: auto;
  overflow: hidden;
}
dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  z-index: 20;
  transition: all 0.15s ease;
}
.modal-close-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

/* AUTH MODAL */
.auth-modal {
  width: 440px;
  padding: 40px 36px;
}
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-brand-badge {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-grid;
  place-items: center;
  margin-bottom: 14px;
}
.auth-brand-badge svg {
  width: 26px;
  height: 26px;
}
.auth-header h2 {
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 6px;
}
.auth-header p {
  font-size: 13px;
  color: var(--ink-muted);
}
.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--ink-light);
  font-size: 12px;
}
.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.modal-divider span {
  padding: 0 10px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}
.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.forgot-btn {
  font-size: 11.5px;
}
.form-field input, .form-field textarea {
  border: 1px solid var(--border);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus, .form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrap input {
  width: 100%;
  padding-right: 42px;
}
.toggle-password-btn {
  position: absolute;
  right: 12px;
  color: var(--ink-light);
  display: grid;
  place-items: center;
  padding: 4px;
}
.toggle-password-btn:hover {
  color: var(--ink);
}
.form-alert-msg {
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--rose-light);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #9f1239;
}
.form-alert-msg.success {
  background: var(--emerald-light);
  border-color: rgba(16, 185, 129, 0.25);
  color: #065f46;
}
.form-submit-btn {
  width: 100%;
  margin-top: 6px;
}
.auth-switch-wrap {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* UPLOAD MODAL */
.upload-modal {
  width: 640px;
  max-height: 90vh;
  padding: 36px 40px;
  overflow-y: auto;
}
.modal-title-wrap {
  margin-bottom: 24px;
}
.modal-title-wrap h2 {
  font-size: 24px;
  margin-bottom: 6px;
}
.modal-title-wrap p {
  font-size: 13px;
  color: var(--ink-muted);
}
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.file-drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: var(--bg-page);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-drop-zone input {
  display: none;
}
.drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.file-drop-zone strong {
  font-size: 14px;
  color: var(--ink);
}
.drop-subtext {
  font-size: 12px;
  color: var(--ink-muted);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.optional-tag {
  font-size: 11px;
  color: var(--ink-light);
  font-weight: 400;
}
.consent-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
}
.consent-checkbox-label input {
  margin-top: 3px;
  accent-color: var(--primary);
}
.upload-progress-box {
  background: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-fill {
  width: 45%;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  animation: progressPulse 1.8s infinite ease-in-out;
}
@keyframes progressPulse {
  0% { transform: translateX(-100%); width: 30%; }
  50% { transform: translateX(100%); width: 60%; }
  100% { transform: translateX(300%); width: 30%; }
}

/* RESOURCE DETAIL MODAL */
.resource-modal {
  width: 620px;
  padding: 0;
}
.detail-header {
  padding: 32px 36px 24px;
  background: #0f172a;
  color: #ffffff;
}
.detail-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--amber);
  display: block;
  margin-bottom: 8px;
}
.detail-header h2 {
  font-size: 22px;
  margin-bottom: 14px;
}
.detail-body {
  padding: 32px 36px;
}
.detail-description {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: var(--bg-page);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.detail-grid dt {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-light);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.detail-grid dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.detail-action-buttons {
  display: flex;
  gap: 12px;
}
.detail-action-buttons .button {
  flex: 1;
}
.sample-notice-box {
  background: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ================= STATE-OF-THE-ART PDF VIEWER ================= */
.viewer-dialog {
  width: 95vw;
  max-width: 1240px;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* Topbar */
.viewer-topbar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #ffffff;
  flex-shrink: 0;
  z-index: 10;
}
.viewer-doc-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 32%;
}
.viewer-pdf-badge {
  background: var(--rose);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.viewer-pdf-badge svg {
  width: 12px;
  height: 12px;
}
.viewer-title-wrap {
  min-width: 0;
}
.viewer-title-wrap strong {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f8fafc;
}
.viewer-meta-text {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Interactive Navigation */
.viewer-center-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-md);
}
.viewer-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #cbd5e1;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}
.viewer-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.viewer-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.viewer-icon-btn svg {
  width: 16px;
  height: 16px;
}
.viewer-text-btn {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
}
.viewer-text-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.viewer-page-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #94a3b8;
  padding: 0 4px;
}
.viewer-page-indicator input {
  width: 34px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 0;
}
.viewer-page-indicator input:focus {
  outline: 1px solid var(--primary);
}
.viewer-ctrl-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}
.viewer-zoom-text {
  font-size: 11.5px;
  color: #cbd5e1;
  min-width: 38px;
  text-align: center;
  font-weight: 600;
}

/* Action controls */
.viewer-action-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.viewer-dl-btn {
  background: var(--emerald);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.viewer-dl-btn:hover {
  background: #059669;
}
.viewer-icon-btn.close-btn {
  background: rgba(255, 255, 255, 0.08);
}
.viewer-icon-btn.close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose);
}

/* Main PDF stage & canvas */
.viewer-stage {
  flex: 1;
  background: #1e293b;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.viewer-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #e2e8f0;
  background: #1e293b;
  z-index: 5;
}
.viewer-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.viewer-canvas-scroll {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 24px;
}
#viewer-canvas {
  display: block;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

/* Fallback card */
.viewer-fallback-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.fallback-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 480px;
  color: #ffffff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.fallback-icon {
  width: 56px;
  height: 56px;
  color: var(--primary);
  margin-bottom: 16px;
}
.fallback-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.fallback-card p {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 24px;
}
.fallback-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* FLOATING TOAST NOTIFICATION */
.toast-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.toast-popup.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-popup svg {
  color: #34d399;
  width: 18px;
  height: 18px;
}

/* ================= RESPONSIVE MEDIA QUERIES ================= */
@media (max-width: 1024px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 44px 36px;
    text-align: center;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero-description {
    text-align: center;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-meta-badges {
    justify-content: center;
  }
  .hero-visual {
    margin-top: 10px;
  }
  .library-layout {
    grid-template-columns: 1fr;
  }
  .filters-sidebar {
    display: none;
    position: static;
    margin-bottom: 24px;
  }
  .filters-sidebar.open {
    display: block;
  }
  .mobile-filter-btn {
    display: inline-flex;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
  .header-inner {
    min-height: 68px;
  }
  .desktop-nav {
    display: none;
  }
  .hero-card {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
  }
  .hero-title {
    font-size: 34px;
  }
  .search-wrap {
    margin-top: -24px;
  }
  .search-bar {
    padding: 6px 8px 6px 14px;
  }
  .search-submit span {
    display: none;
  }
  .search-submit {
    min-height: 42px;
    padding: 8px 14px;
  }
  .features-strip {
    grid-template-columns: 1fr;
  }
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .viewer-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .viewer-topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
  .viewer-doc-info {
    max-width: 100%;
    order: 1;
  }
  .viewer-center-controls {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .viewer-action-controls {
    order: 2;
    margin-left: auto;
  }
  .viewer-dl-btn span {
    display: none;
  }
}
