/* ===== BIOLOGY LEARNING APP — DESIGN SYSTEM ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,600,0..1,0');

/* --- CSS Custom Properties --- */
:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-darker: #166534;
  --primary-light: #bbf7d0;
  --primary-50: #f0fdf4;
  --primary-100: #dcfce7;
  --accent: #059669;
  --white: #ffffff;
  --bg: #f0fdf4;
  --text: #1a1a2e;
  --text-light: #4b5563;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 14px rgba(22,163,74,0.12);
  --shadow-lg: 0 10px 30px rgba(22,163,74,0.15);
  --shadow-xl: 0 20px 50px rgba(22,163,74,0.18);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --font: 'Inter', 'Noto Sans Bengali', system-ui, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

/* --- Container --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== NAVBAR ===== */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-dark);
}
.nav-brand .icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--primary-50);
  color: var(--primary-dark);
}
.nav-links .btn-admin {
  background: var(--primary);
  color: white;
  padding: 8px 18px;
}
.nav-links .btn-admin:hover { background: var(--primary-dark); }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

@media (max-width: 768px) {
  .hamburger { display: none; }
  
  /* Fix: backdrop-filter on parent creates a containing block for fixed children */
  .navbar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

  .nav-links {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(0,0,0,0.06);
    transform: none !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    margin: 0;
  }
  .nav-links a { 
    width: auto; flex: 1; max-width: 90px; 
    text-align: center; padding: 6px 2px; 
    border-radius: var(--radius); 
    font-size: 0.75rem; 
    font-weight: 600;
    color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    line-height: 1.2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent !important;
  }
  .nav-links a.active, .nav-links a:hover {
    color: var(--primary);
  }
  .nav-links .btn-admin { display: none !important; }

  /* Premium Material Icons */
  .nav-links a::before {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 26px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    margin-bottom: 2px;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  }
  .nav-links a.active::before, .nav-links a:hover::before {
    transform: translateY(-2px);
    color: var(--primary);
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  }
  .nav-links a:active::before { transform: scale(0.9); }

  /* Icon Mapping */
  .nav-links a[href*="index.html"]::before, .nav-links a[href=""]::before { content: 'home'; }
  .nav-links a[href*="select_quiz.html"]::before, .nav-links a[href*="quiz.html"]::before { content: 'quiz'; }
  .nav-links a[href*="blog.html"]::before { content: 'article'; }
  .nav-links a[href*="login.html"]:not([href*="admin"])::before, .nav-links a[href*="student_dashboard.html"]::before { content: 'person'; }
  .nav-links a[href*="admin/login.html"]::before, .nav-links a[href*="admin"]::before { content: 'settings'; }
  .nav-links a[href*="#feedback"]::before { content: 'forum'; }

  body { padding-bottom: 80px; }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--primary-dark) 100%);
  color: white;
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 500px; height: 500px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute; bottom: -30%; left: -10%;
  width: 350px; height: 350px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; position: relative; z-index: 1; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 500px; margin: 0 auto; position: relative; z-index: 1; }
.hero .badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
  position: relative; z-index: 1;
}

@media (max-width: 768px) {
  .hero { padding: 40px 0 35px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 0.95rem; }
}

/* ===== SECTION ===== */
.section { padding: 50px 0; }
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.section-subtitle {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

/* ===== SEMESTER CARDS ===== */
.semester-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.semester-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.semester-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: var(--transition);
}
.semester-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.semester-card:hover::before { transform: scaleX(1); }
.semester-card .sem-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--primary-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.semester-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.semester-card .sem-class { font-size: 0.85rem; color: var(--text-light); margin-bottom: 12px; }
.semester-card .sem-marks {
  display: inline-block;
  background: var(--primary-100);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}
.sem-class-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #16a34a, #059669);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sem-class-badge.badge-12 {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

/* ===== CHAPTER CARDS ===== */
.chapter-list { display: flex; flex-direction: column; gap: 12px; }
.chapter-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
}
.chapter-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}
.chapter-num {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.chapter-card h3 { flex: 1; font-size: 1rem; font-weight: 600; line-height: 1.3; margin-right: 10px; }
.chapter-card .arrow { flex-shrink: 0; margin-left: auto; color: var(--text-muted); font-size: 1.2rem; transition: var(--transition); }
.chapter-card:hover .arrow { color: var(--primary); transform: translateX(4px); }

/* ===== CONTENT ACTION BUTTONS ===== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.action-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.action-card .action-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.action-card.mcq .action-icon { background: #dcfce7; }
.action-card.short .action-icon { background: #dbeafe; }
.action-card.long .action-icon { background: #fef3c7; }
.action-card.quiz .action-icon { background: #ede9fe; }
.action-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.action-card p { font-size: 0.85rem; color: var(--text-light); }

/* ===== MCQ PRACTICE ===== */
.mcq-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.mcq-card .q-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mcq-card .q-text { font-size: 1rem; font-weight: 600; margin-bottom: 14px; line-height: 1.4; }
.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--primary-50);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}
.option-btn:hover { border-color: var(--primary-light); background: var(--primary-100); }
.option-btn .opt-label {
  width: 28px; height: 28px;
  background: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary);
  flex-shrink: 0;
}
.option-btn.correct { border-color: #16a34a; background: #dcfce7; }
.option-btn.correct .opt-label { background: #16a34a; color: white; }
.option-btn.wrong { border-color: #dc2626; background: #fef2f2; }
.option-btn.wrong .opt-label { background: #dc2626; color: white; }
.option-btn.disabled { pointer-events: none; opacity: 0.7; }

/* ===== SHORT / LONG QUESTIONS ===== */
.qa-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.qa-card .q-text { font-weight: 600; margin-bottom: 12px; }
.qa-card .answer {
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  padding: 16px;
  border-left: 3px solid var(--primary);
  display: none;
  line-height: 1.7;
  color: var(--text-light);
}
.qa-card .answer.show { display: block; animation: fadeIn 0.3s ease; }
.toggle-ans {
  background: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}
.toggle-ans:hover { color: var(--primary-dark); }

/* ===== QUIZ MODE ===== */
.quiz-container { max-width: 700px; margin: 0 auto; }
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
}
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 50px;
  margin-bottom: 30px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 50px;
  transition: width 0.4s ease;
}
.quiz-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.quiz-card .q-text { font-size: 1.15rem; font-weight: 600; margin-bottom: 28px; }
.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}
.quiz-setup {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  border: 1px solid var(--border);
}
.quiz-setup h2 { margin-bottom: 12px; }
.quiz-setup p { color: var(--text-light); margin-bottom: 24px; }
.quiz-count-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== RESULT PAGE ===== */
.result-container { max-width: 550px; margin: 0 auto; text-align: center; }
.result-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 50px 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.result-score {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
  font-weight: 800;
  box-shadow: 0 8px 30px rgba(22,163,74,0.3);
}
.result-score small { font-size: 0.9rem; font-weight: 500; opacity: 0.85; }
.result-card h2 { font-size: 1.4rem; margin-bottom: 8px; }
.result-card .msg { color: var(--text-light); margin-bottom: 24px; }
.result-stats {
  display: flex; gap: 16px; justify-content: center;
  margin-bottom: 30px;
}
.stat-box {
  background: var(--primary-50);
  padding: 16px 24px;
  border-radius: var(--radius);
  flex: 1;
}
.stat-box.wrong-stat { background: #fef2f2; }
.stat-box .num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-box.wrong-stat .num { color: #dc2626; }
.stat-box .label { font-size: 0.8rem; color: var(--text-light); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: var(--primary-50); color: var(--primary-dark); }
.btn-ghost:hover { background: var(--primary-100); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-muted); }

/* ===== FEEDBACK SECTION ===== */
.feedback-section {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  border: 1px solid var(--border);
  margin: 40px 0;
  text-align: center;
}
.feedback-section h2 { font-size: 1.3rem; margin-bottom: 8px; }
.feedback-section p { color: var(--text-light); margin-bottom: 20px; font-size: 0.95rem; }
.feedback-section textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  resize: vertical;
  transition: var(--transition);
  font-size: 0.95rem;
}
.feedback-section textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.1); }
.feedback-section .btn { margin-top: 16px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== ADMIN ===== */
.login-container {
  max-width: 420px;
  margin: 60px auto;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.login-card h2 { text-align: center; margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}
.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.admin-header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  text-align: center;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }

.admin-table {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.admin-table th {
  background: var(--primary-50);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 0.9rem; }
.admin-table tr:hover td { background: var(--primary-50); }

/* ===== BLOG CARDS ===== */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
@media (max-width: 768px) {
  .swipe-grid-mobile {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 8px; /* slight padding for shadow */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    scroll-padding-left: 16px; /* align first item */
  }
  /* Hide scrollbar for Chrome, Safari and Opera */
  .swipe-grid-mobile::-webkit-scrollbar {
    display: none;
  }
  .swipe-grid-mobile .blog-card {
    min-width: 80vw; /* Takes up 80% of width so the next card peeks out */
    max-width: 320px;
    scroll-snap-align: center;
    flex-shrink: 0;
  }
}
.blog-card {
  display: flex; flex-direction: column;
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  text-decoration: none; color: inherit; transition: var(--transition);
}
.blog-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.06); transform: translateY(-3px); border-color: var(--primary-light); }
.bc-visual {
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  display: flex; align-items: center; justify-content: center; font-size: 3rem; min-height: 140px;
}
.bc-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.bc-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bc-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.bc-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; color: var(--text); }
.bc-body .bc-excerpt { font-size: 0.88rem; color: var(--text-light); line-height: 1.6; margin-bottom: 16px; flex: 1; }
.bc-read-more { font-size: 0.85rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 4px; }
.bc-read-more::after { content: '→'; transition: transform 0.2s; }
.blog-card:hover .bc-read-more::after { transform: translateX(4px); }

/* ===== ALERTS ===== */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.slide-up { animation: slideUp 0.5s ease forwards; }
.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-light); margin-bottom: 8px; }

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 20px;
  transition: var(--transition);
}
.back-link:hover { gap: 10px; }

/* ===== UTILS ===== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ========================================
   MOBILE RESPONSIVE — COMPREHENSIVE
   ======================================== */

/* --- Tablet (max-width: 768px) --- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .section { padding: 30px 0; }
  .section-title { font-size: 1.25rem; }
  .section-subtitle { font-size: 0.88rem; margin-bottom: 20px; }

  /* Navbar */
  .navbar .container { height: 56px; }
  .nav-brand { font-size: 1.1rem; gap: 8px; }
  .nav-brand .icon { width: 32px; height: 32px; font-size: 0.95rem; }

  /* Semester grid — 2 columns on tablet */
  .semester-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .semester-card { padding: 20px 16px; }
  .semester-card .sem-icon { width: 40px; height: 40px; font-size: 1.2rem; margin-bottom: 12px; }
  .semester-card h3 { font-size: 1rem; }

  /* Action grid — 2 columns */
  .action-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .action-card { padding: 22px 16px; }
  .action-card .action-icon { width: 48px; height: 48px; font-size: 1.3rem; margin-bottom: 12px; }
  .action-card h3 { font-size: 0.9rem; }
  .action-card p { font-size: 0.78rem; }

  /* Chapter cards */
  .chapter-card { padding: 16px; gap: 12px; }
  .chapter-num { width: 36px; height: 36px; font-size: 0.8rem; }
  .chapter-card h3 { font-size: 0.9rem; }

  /* MCQ cards */
  .mcq-card { padding: 20px 16px; margin-bottom: 14px; }
  .mcq-card .q-text { font-size: 0.95rem; margin-bottom: 16px; }
  .option-btn { padding: 12px 14px; gap: 10px; font-size: 0.88rem; }
  .option-btn .opt-label { width: 26px; height: 26px; font-size: 0.75rem; }

  /* Q&A cards */
  .qa-card { padding: 18px 16px; }
  .qa-card .answer { padding: 12px; font-size: 0.9rem; }

  /* Buttons */
  .btn { padding: 10px 18px; font-size: 0.88rem; }
  .btn-lg { padding: 12px 24px; font-size: 0.92rem; }

  /* Feedback */
  .feedback-section { padding: 28px 20px; margin: 24px 0; }
  .feedback-section h2 { font-size: 1.1rem; }
  .feedback-section p { font-size: 0.88rem; }

  /* Footer */
  .footer { padding: 20px 0; font-size: 0.8rem; }

  /* Quiz count buttons — stack vertically */
  .quiz-count-btns { flex-direction: column; align-items: center; gap: 10px; }
  .quiz-count-btns .btn { width: 100%; max-width: 280px; justify-content: center; }

  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-num { font-size: 1.5rem; }

  /* Admin */
  .login-container { margin: 30px auto; }
  .login-card { padding: 28px 20px; }
  .admin-header .container { flex-wrap: wrap; gap: 10px; }
}

/* --- Small Mobile (max-width: 480px) --- */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { padding: 0 14px; }
  .section { padding: 24px 0; }

  /* Navbar — compact */
  .navbar .container { height: 52px; }
  .nav-brand { font-size: 1rem; }
  .nav-brand .icon { width: 28px; height: 28px; font-size: 0.85rem; border-radius: 6px; }

  /* Hero — tighter */
  .hero { padding: 32px 0 28px; }
  .hero h1 { font-size: 1.5rem; margin-bottom: 8px; }
  .hero p { font-size: 0.88rem; padding: 0 8px; }
  .hero .badge { font-size: 0.78rem; padding: 5px 12px; }

  /* Section titles */
  .section-title { font-size: 1.15rem; margin-bottom: 6px; }
  .section-subtitle { font-size: 0.82rem; margin-bottom: 16px; }

  /* Semester grid — 2 compact columns */
  .semester-grid { gap: 10px; }
  .semester-card { padding: 16px 14px; border-radius: var(--radius); }
  .semester-card .sem-icon { width: 36px; height: 36px; font-size: 1.1rem; margin-bottom: 10px; border-radius: 8px; }
  .semester-card h3 { font-size: 0.92rem; }
  .semester-card .sem-class { font-size: 0.78rem; margin-bottom: 8px; }
  .semester-card .sem-marks { font-size: 0.72rem; padding: 3px 10px; }

  /* Action grid — 2 compact columns */
  .action-grid { gap: 10px; }
  .action-card { padding: 18px 12px; border-radius: var(--radius); }
  .action-card .action-icon { width: 44px; height: 44px; font-size: 1.2rem; margin-bottom: 10px; }
  .action-card h3 { font-size: 0.85rem; }
  .action-card p { font-size: 0.75rem; line-height: 1.4; }

  /* Chapter cards — compact */
  .chapter-card { padding: 14px 12px; gap: 10px; border-radius: 10px; }
  .chapter-num { width: 32px; height: 32px; font-size: 0.75rem; border-radius: 6px; }
  .chapter-card h3 { font-size: 0.85rem; }
  .chapter-card .arrow { font-size: 1rem; }

  /* MCQ — compact */
  .mcq-card { padding: 16px 14px; border-radius: var(--radius); margin-bottom: 12px; }
  .mcq-card .q-num { font-size: 0.72rem; margin-bottom: 6px; }
  .mcq-card .q-text { font-size: 0.9rem; margin-bottom: 14px; }
  .option-btn { padding: 10px 12px; gap: 8px; font-size: 0.85rem; border-radius: 10px; }
  .option-btn .opt-label { width: 24px; height: 24px; font-size: 0.7rem; }

  /* Q&A compact */
  .qa-card { padding: 14px 12px; border-radius: 10px; }
  .qa-card .q-text { font-size: 0.9rem; margin-bottom: 8px; }
  .qa-card .answer { padding: 10px; font-size: 0.85rem; }
  .toggle-ans { font-size: 0.82rem; }

  /* Buttons */
  .btn { padding: 10px 16px; font-size: 0.85rem; border-radius: 8px; }
  .btn-lg { padding: 12px 20px; font-size: 0.88rem; }

  /* Back link */
  .back-link { font-size: 0.82rem; margin-bottom: 14px; }

  /* Feedback compact */
  .feedback-section { padding: 24px 16px; border-radius: var(--radius); margin: 20px 0; }
  .feedback-section h2 { font-size: 1rem; }
  .feedback-section p { font-size: 0.82rem; margin-bottom: 14px; }
  .feedback-section textarea { min-height: 80px; padding: 12px; font-size: 0.88rem; }

  /* Footer */
  .footer { padding: 16px 0; font-size: 0.75rem; }

  /* Quiz setup */
  .quiz-count-btns .btn { max-width: 100%; }

  /* Progress bar thinner on mobile */
  .progress-bar-wrap { height: 6px; margin-bottom: 16px; }

  /* Admin compact */
  .login-container { margin: 20px auto; padding: 0 14px; }
  .login-card { padding: 24px 16px; border-radius: var(--radius); }
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 0.82rem; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 0.88rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-card .stat-num { font-size: 1.3rem; }
  .stat-card .stat-label { font-size: 0.75rem; }
  .admin-table th { padding: 10px 12px; font-size: 0.75rem; }
  .admin-table td { padding: 10px 12px; font-size: 0.82rem; }

  /* Empty state */
  .empty-state { padding: 40px 16px; }
  .empty-state .icon { font-size: 2.5rem; }
}

/* --- Touch-friendly: larger tap targets --- */
@media (hover: none) and (pointer: coarse) {
  .option-btn { min-height: 48px; }
  .chapter-card { min-height: 56px; }
  .semester-card { min-height: 100px; }
  .btn { min-height: 44px; }
  .toggle-ans { padding: 8px 4px; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; justify-content: center; }
}

