/* ============================================
   notpadhai.com - Main Stylesheet
   Starbucks-inspired Clean Design
   ============================================ */

/* CSS Custom Properties - Theme System */
:root {
  /* Light Mode (Default) */
  --bg-primary: #FAFAF8;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F5F5F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9F9F6;
  --bg-hero: linear-gradient(135deg, #1E3932 0%, #2D5A4E 100%);
  --bg-accent: #00704A;
  --bg-accent-light: #E8F5E9;

  --text-primary: #1E1E1E;
  --text-secondary: #4A4A4A;
  --text-tertiary: #6B6B6B;
  --text-inverse: #FFFFFF;
  --text-accent: #00704A;
  --text-link: #00704A;
  --text-link-hover: #005A3D;

  --border-color: #E8E8E3;
  --border-light: #F0F0EB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --green-primary: #00704A;
  --green-dark: #1E3932;
  --green-light: #D4E9E2;
  --gold-primary: #CBA258;
  --gold-light: #F5E6C8;
  --red-primary: #D32F2F;
  --red-light: #FFEBEE;
  --blue-primary: #1976D2;
  --blue-light: #E3F2FD;
  --orange-primary: #E65100;
  --orange-light: #FFF3E0;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --header-height: 72px;
  --max-width: 1200px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-tertiary: #1C2128;
  --bg-card: #1C2128;
  --bg-card-hover: #252C35;
  --bg-hero: linear-gradient(135deg, #0D1117 0%, #1A2332 100%);
  --bg-accent: #00704A;
  --bg-accent-light: #0D2818;

  --text-primary: #E6EDF3;
  --text-secondary: #B1BAC4;
  --text-tertiary: #8B949E;
  --text-inverse: #FFFFFF;
  --text-accent: #3FB950;
  --text-link: #58A6FF;
  --text-link-hover: #79C0FF;

  --border-color: #30363D;
  --border-light: #21262D;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.6);

  --green-light: #0D2818;
  --gold-light: #2D2200;
  --red-light: #3D1111;
  --blue-light: #0D1F3D;
  --orange-light: #3D1E00;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--text-link-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--green-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--green-primary);
  background: var(--bg-accent-light);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition);
  margin-left: 8px;
}

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

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
}

.hamburger {
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  background: var(--bg-hero);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: clamp(16px, 2.5vw, 20px);
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 18px 60px 18px 24px;
  font-size: 16px;
  border: none;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  color: #1E1E1E;
  box-shadow: var(--shadow-lg);
  outline: none;
}

.hero-search input::placeholder {
  color: #9E9E9E;
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 48px;
  background: var(--green-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.hero-search button:hover {
  background: var(--green-dark);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  flex-wrap: wrap;
}

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

.hero-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #FFFFFF;
}

.hero-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-tertiary);
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================
   CARDS GRID
   ============================================ */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--green-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.card-icon.green { background: var(--bg-accent-light); color: var(--green-primary); }
.card-icon.gold { background: var(--gold-light); color: var(--gold-primary); }
.card-icon.blue { background: var(--blue-light); color: var(--blue-primary); }
.card-icon.red { background: var(--red-light); color: var(--red-primary); }
.card-icon.orange { background: var(--orange-light); color: var(--orange-primary); }

.card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--green-primary);
  margin-top: 16px;
  transition: var(--transition);
}

.card-link:hover {
  gap: 10px;
}

/* ============================================
   SUBJECT CARDS
   ============================================ */
.subject-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.subject-card:hover {
  border-color: var(--green-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.subject-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.subject-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.subject-info p {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ============================================
   CLASS SELECTOR (Horizontal Scroll)
   ============================================ */
.class-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 32px;
  -webkit-overflow-scrolling: touch;
}

.class-tabs::-webkit-scrollbar {
  height: 4px;
}

.class-tabs::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.class-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.class-tab {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
}

.class-tab:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.class-tab.active {
  background: var(--green-primary);
  color: white;
  border-color: var(--green-primary);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

.breadcrumb a {
  color: var(--text-tertiary);
}

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

.breadcrumb span {
  margin: 0 8px;
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  background: var(--bg-tertiary);
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-header p {
  font-size: 16px;
  color: var(--text-tertiary);
}

.page-header .badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-accent-light);
  color: var(--green-primary);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--bg-tertiary);
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: var(--bg-card-hover);
}

.table a {
  font-weight: 500;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   TEST SERIES STYLES
   ============================================ */
.test-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.test-card:hover {
  box-shadow: var(--shadow-md);
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.test-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.test-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.test-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.test-badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-badge.easy { background: #E8F5E9; color: #2E7D32; }
.test-badge.medium { background: #FFF3E0; color: #E65100; }
.test-badge.hard { background: #FFEBEE; color: #C62828; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--green-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--green-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--green-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ============================================
   NCERT SOLUTION STYLES
   ============================================ */
.chapter-list {
  display: grid;
  gap: 8px;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.chapter-item:hover {
  border-color: var(--green-primary);
  box-shadow: var(--shadow-sm);
  color: inherit;
}

.chapter-number {
  width: 32px;
  height: 32px;
  background: var(--bg-accent-light);
  color: var(--green-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.chapter-info {
  flex: 1;
  margin-left: 16px;
}

.chapter-info h4 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.chapter-info p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.chapter-arrow {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ============================================
   SOLUTION CONTENT
   ============================================ */
.solution-content {
  max-width: 800px;
}

.solution-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.solution-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.solution-content p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.8;
}

.question {
  background: var(--bg-tertiary);
  padding: 16px 20px;
  border-left: 4px solid var(--green-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
}

.answer {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.answer-label {
  display: inline-block;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  background: var(--green-primary);
  color: white;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.answer p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.answer ol, .answer ul {
  padding-left: 24px;
  margin: 8px 0;
}

.answer li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.answer strong {
  color: var(--green-primary);
  font-weight: 600;
}

.answer .step {
  padding: 10px 16px;
  background: var(--bg-accent-light);
  border-radius: var(--radius-sm);
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.8;
}

.formula-box {
  background: var(--bg-tertiary);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  line-height: 1.8;
}

/* Step-by-step solution styling */
.solution-step {
  padding: 12px 16px;
  border-left: 3px solid var(--green-primary);
  background: var(--bg-accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}

.solution-step strong {
  color: var(--green-primary);
}

/* Key concept highlight */
.key-concept {
  background: var(--blue-light);
  border: 1px solid var(--blue-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 12px 0;
}

.key-concept-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diagram-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 20px 0;
  text-align: center;
}

.diagram-box svg {
  max-width: 100%;
  height: auto;
}

.diagram-caption {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 12px;
  font-style: italic;
}

/* ============================================
   PYQ STYLES
   ============================================ */
.pyq-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: var(--transition);
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--green-primary);
  color: white;
  border-color: var(--green-primary);
}

/* ============================================
   MARKS CALCULATOR
   ============================================ */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  margin: 0 auto;
}

.calculator-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(0, 112, 74, 0.1);
}

.result-card {
  background: var(--bg-accent-light);
  border: 1px solid var(--green-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
}

.result-card h3 {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  font-weight: 500;
}

.result-card .percentage {
  font-size: 48px;
  font-weight: 700;
  color: var(--green-primary);
}

.result-card .grade {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--green-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 64px 0 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 12px;
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  font-size: 14px;
  color: var(--text-tertiary);
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--green-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--green-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .hero-stats { gap: 32px; }
  .hero-stat-value { font-size: 24px; }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  /* Header */
  .header-inner { padding: 0 16px; height: 60px; }
  .logo { font-size: 20px; gap: 8px; }
  .logo-icon { width: 36px; height: 36px; font-size: 16px; }

  /* Navigation */
  .nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    overflow-y: auto;
    z-index: 999;
    border-top: 1px solid var(--border-color);
  }
  .nav.active { display: flex; }
  .nav-link {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: left;
  }
  .nav-link:hover, .nav-link.active {
    background: var(--bg-tertiary);
  }
  .mobile-menu-btn { display: flex; }
  .theme-toggle { width: 36px; height: 36px; font-size: 16px; }

  /* Hero */
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 28px; line-height: 1.3; }
  .hero p { font-size: 15px; margin-bottom: 24px; }
  .hero-search input { padding: 14px 56px 14px 16px; font-size: 15px; }
  .hero-search button { width: 42px; right: 4px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; justify-content: center; }
  .hero-stat { width: calc(50% - 16px); }
  .hero-stat-value { font-size: 22px; }
  .hero-stat-label { font-size: 12px; }

  /* Container */
  .container { padding: 0 16px; }

  /* Sections */
  .section { padding: 32px 0; }
  .section-header { margin-bottom: 24px; }
  .section-header h2 { font-size: 24px; }
  .section-header p { font-size: 14px; }

  /* Grids */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Cards */
  .card { padding: 16px; }
  .card h3 { font-size: 15px; }
  .card p { font-size: 13px; }
  .card-icon { width: 44px; height: 44px; font-size: 20px; margin-bottom: 12px; }
  .card-link { font-size: 13px; margin-top: 12px; }

  /* Subject cards */
  .subject-card { padding: 14px; gap: 12px; }
  .subject-icon { width: 40px; height: 40px; font-size: 18px; }
  .subject-info h3 { font-size: 14px; }
  .subject-info p { font-size: 12px; }

  /* Breadcrumb */
  .breadcrumb { font-size: 12px; padding: 12px 0; }

  /* Page header */
  .page-header { padding: 24px 0; }
  .page-header h1 { font-size: 24px; }
  .page-header p { font-size: 14px; }

  /* Chapter list */
  .chapter-item { padding: 12px 14px; }
  .chapter-number { width: 28px; height: 28px; font-size: 12px; }
  .chapter-info h4 { font-size: 14px; }
  .chapter-info p { font-size: 11px; }

  /* Tables */
  .table th { padding: 10px 12px; font-size: 12px; }
  .table td { padding: 10px 12px; font-size: 13px; }

  /* Tabs */
  .tabs { gap: 0; margin-bottom: 16px; }
  .tab { padding: 10px 14px; font-size: 13px; white-space: nowrap; }

  /* Questions and answers */
  .question { font-size: 14px; padding: 14px 16px; }
  .answer { padding: 14px 16px; }
  .answer p, .answer li { font-size: 14px; line-height: 1.8; }
  .formula-box { font-size: 13px; padding: 12px 14px; overflow-x: auto; }
  .solution-step { font-size: 14px; padding: 10px 14px; }

  /* Test engine */
  .test-header-bar {
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    position: sticky;
    top: 60px;
    z-index: 100;
  }
  .test-timer { font-size: 20px; }
  .question-nav {
    padding: 10px;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .q-nav-btn { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
  .question-panel { padding: 16px; }
  .question-text { font-size: 15px; margin-bottom: 16px; }
  .option-btn {
    padding: 12px 14px;
    font-size: 14px;
    gap: 10px;
  }
  .option-label { width: 26px; height: 26px; font-size: 12px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .result-item { padding: 14px; }
  .result-item .value { font-size: 22px; }

  /* Calculator */
  .calculator-card { padding: 20px; }
  .calculator-card h2 { font-size: 20px; }
  .form-group input, .form-group select { padding: 12px 14px; font-size: 15px; }

  /* Class tabs */
  .class-tabs { gap: 6px; margin-bottom: 20px; padding-bottom: 4px; }
  .class-tab { padding: 8px 16px; font-size: 13px; }

  /* PYQ filters */
  .pyq-filters { gap: 8px; margin-bottom: 16px; }
  .filter-btn { padding: 6px 12px; font-size: 12px; }

  /* Footer */
  .footer { padding: 40px 0 20px; margin-top: 40px; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { font-size: 13px; max-width: 100%; }
  .footer-col h4 { font-size: 13px; margin-bottom: 12px; }
  .footer-col ul li a { font-size: 13px; }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 12px;
  }

  /* Back to top */
  .back-to-top { width: 42px; height: 42px; bottom: 16px; right: 16px; font-size: 18px; }

  /* Buttons */
  .btn { padding: 10px 20px; font-size: 14px; }
  .btn-lg { padding: 14px 28px; font-size: 15px; }
  .btn-sm { padding: 8px 14px; font-size: 12px; }

  /* Utility */
  .mt-1 { margin-top: 8px; }
  .mt-2 { margin-top: 12px; }
  .mt-3 { margin-top: 16px; }
  .mb-1 { margin-bottom: 8px; }
  .mb-2 { margin-bottom: 12px; }
  .mb-3 { margin-bottom: 16px; }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  /* Single column grids */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr;
  }

  /* Hero */
  .hero { padding: 32px 12px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .hero-search input { padding: 12px 50px 12px 14px; font-size: 14px; }
  .hero-stat { width: 100%; }

  /* Container */
  .container { padding: 0 12px; }

  /* Cards */
  .card { padding: 14px; }
  .card h3 { font-size: 14px; }

  /* Section */
  .section { padding: 24px 0; }
  .section-header h2 { font-size: 20px; }

  /* Page header */
  .page-header h1 { font-size: 20px; }

  /* Test */
  .test-timer { font-size: 18px; }
  .question-text { font-size: 14px; }
  .option-btn { font-size: 13px; padding: 10px 12px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-col ul { columns: 2; column-gap: 16px; }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .nav-link, .card, .subject-card, .chapter-item, .btn,
  .filter-btn, .tab, .option-btn, .q-nav-btn, .class-tab {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Safe area for notch phones */
@supports (padding-top: env(safe-area-inset-top)) {
  .header {
    padding-top: env(safe-area-inset-top);
  }
  .footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.hidden { display: none; }

/* ============================================
   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); }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease forwards;
}

.animate-slideUp {
  animation: slideUp 0.5s ease forwards;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .header, .footer, .back-to-top, .theme-toggle { display: none !important; }
  body { background: white; color: black; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}
