/* =============================================
   BSc Notes Platform - Main Stylesheet
   Light Glassmorphism Premium Design
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-50: #f0f2f7;
  --gray-100: #e4e8f0;
  --gray-200: #c8d0e0;
  --gray-400: #8b96aa;
  --gray-600: #5a6478;
  --gray-800: #2d3348;
  --gray-900: #1a1f2e;

  --cyan: #06b6d4;
  --cyan-light: #cffafe;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --indigo: #6366f1;

  --primary: #3b82f6;
  --primary-soft: rgba(59,130,246,0.08);
  --accent: #06b6d4;
  --accent-soft: rgba(6,182,212,0.08);

  --glass-bg: rgba(255,255,255,0.72);
  --glass-bg-hover: rgba(255,255,255,0.88);
  --glass-border: rgba(255,255,255,0.9);
  --glass-border-soft: rgba(200,210,230,0.5);
  --glass-shadow: 0 4px 24px rgba(59,130,246,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --glass-shadow-hover: 0 8px 40px rgba(59,130,246,0.13), 0 2px 8px rgba(0,0,0,0.06);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--gray-800);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 15px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---- Background ---- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(59,130,246,0.09) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 20%, rgba(6,182,212,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 50% 90%, rgba(139,92,246,0.07) 0%, transparent 60%),
    #f4f6fb;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  z-index: -1;
  animation: blobFloat 12s ease-in-out infinite;
  pointer-events: none;
}
.blob-1 { width: 420px; height: 340px; background: rgba(59,130,246,0.13); top: -80px; left: -100px; animation-delay: 0s; }
.blob-2 { width: 360px; height: 300px; background: rgba(6,182,212,0.11); top: 30%; right: -80px; animation-delay: 4s; }
.blob-3 { width: 300px; height: 260px; background: rgba(139,92,246,0.10); bottom: -60px; left: 30%; animation-delay: 8s; }

@keyframes blobFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.04); }
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border-soft);
  box-shadow: 0 1px 12px rgba(59,130,246,0.06);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 17px;
  color: var(--gray-900);
  white-space: nowrap;
}

.nav-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 6px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
}

.nav-links a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 180px;
  transition: var(--transition);
}

.nav-search:focus-within {
  background: white;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.10);
}

.nav-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--gray-800);
  width: 100%;
}

.nav-search input::placeholder { color: var(--gray-400); }

.nav-search-icon { color: var(--gray-400); font-size: 14px; flex-shrink: 0; }

/* ---- Hero Section ---- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 20px 40px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-soft);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
}

.hero h1 {
  font-family: var(--font-main);
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.22;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 15px;
  color: var(--gray-600);
  max-width: 480px;
  margin: 0 auto 30px;
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.hero-stat .label {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* ---- Glass Card ---- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

/* ---- Section ---- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.section-header {
  margin-bottom: 22px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-main);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

/* ---- Semester Grid ---- */
.sem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.sem-card {
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.sem-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-soft), transparent);
  opacity: 0;
  transition: var(--transition);
  border-radius: var(--radius);
}

.sem-card:hover::before { opacity: 1; }

.sem-card-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(59,130,246,0.25);
  position: relative;
}

.sem-card-title {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.sem-card-sub {
  font-size: 11.5px;
  color: var(--gray-400);
}

/* ---- Subject Grid ---- */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.subject-card {
  padding: 20px 18px;
  cursor: pointer;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.subject-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}

.subject-name {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.subject-meta {
  font-size: 11.5px;
  color: var(--gray-400);
}

.subject-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-200);
  font-size: 16px;
  transition: var(--transition);
}

.subject-card:hover .subject-arrow {
  color: var(--primary);
  transform: translateY(-50%) translateX(2px);
}

/* ---- Unit List ---- */
.unit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--glass-shadow);
}

.unit-item:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateX(4px);
}

.unit-num {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.unit-info { flex: 1; }

.unit-title {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.unit-desc {
  font-size: 12px;
  color: var(--gray-400);
}

.unit-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 50px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--gray-400);
  margin-bottom: 24px;
  padding: 10px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-shadow);
}

.breadcrumb a {
  color: var(--gray-400);
  transition: color 0.15s;
}

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

.breadcrumb span { color: var(--gray-200); }

.breadcrumb .current { color: var(--gray-800); font-weight: 500; }

/* ---- Page Header ---- */
.page-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 24px;
}

.page-title {
  font-family: var(--font-main);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--gray-400);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-main);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(59,130,246,0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--gray-50);
  color: var(--gray-600);
  border: 1px solid var(--gray-100);
}

.btn-ghost:hover {
  background: white;
  border-color: var(--gray-200);
}

.btn-sm { padding: 6px 13px; font-size: 12px; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--glass-border-soft);
  padding: 28px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 12.5px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(12px);
  margin-top: 40px;
}

.footer a { color: var(--primary); }

/* ---- Search Results ---- */
#search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}

.search-result-item:hover { background: var(--gray-50); }

.search-result-icon {
  width: 28px; height: 28px;
  background: var(--primary-soft);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 12px;
  flex-shrink: 0;
}

.search-wrap { position: relative; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-width: 280px;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ---- Color Accents per Subject ---- */
.accent-physics { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.accent-chemistry { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.accent-botany { background: linear-gradient(135deg, #10b981, #06b6d4); }
.accent-zoology { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.accent-maths { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

.bg-physics { background: rgba(59,130,246,0.08); color: #3b82f6; }
.bg-chemistry { background: rgba(139,92,246,0.08); color: #8b5cf6; }
.bg-botany { background: rgba(16,185,129,0.08); color: #10b981; }
.bg-zoology { background: rgba(245,158,11,0.08); color: #f59e0b; }
.bg-maths { background: rgba(236,72,153,0.08); color: #ec4899; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-desc { font-size: 13px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 14px; height: 52px; }
  .nav-links { display: none; }
  .nav-search { min-width: 130px; }
  .hero { padding: 36px 14px 28px; }
  .hero-stats { gap: 20px; }
  .section { padding: 0 14px 36px; }
  .sem-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .subject-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sem-card { padding: 16px 12px; }
  .subject-card { padding: 16px 14px; }
  .page-header { padding: 24px 14px 18px; }
}

@media (max-width: 400px) {
  .sem-grid { grid-template-columns: repeat(2, 1fr); }
  .subject-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 14px; }
}
