/* EnglishSprint Design System - Global Variables, Reset & Base styles */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Light Theme (Default) */
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-secondary: #1E40AF;
  --color-secondary-hover: #1D4ED8;
  --color-accent: #F59E0B;
  --color-accent-hover: #D97706;
  --color-bg: #F8FAFC;
  --color-bg-alt: #F1F5F9;
  --color-card: #FFFFFF;
  --color-text: #0F172A;
  --color-text-muted: #475569;
  --color-border: #E2E8F0;
  --color-white: #FFFFFF;
  --color-input-bg: #FFFFFF;
  
  --color-footer-bg: #0F172A;
  --color-footer-border: #1E293B;
  
  --color-success: #10B981;
  --color-success-bg: #E6F4EA;
  --color-error: #EF4444;
  --color-error-bg: #FCE8E6;
  --color-warning: #F59E0B;
  --color-warning-bg: #FEF3C7;
  --color-info: #3B82F6;
  --color-info-bg: #EFF6FF;
  
  --color-navbar-bg: rgba(255, 255, 255, 0.8);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-hindi: 'Noto Sans Devanagari', sans-serif;

  /* Typography Scale */
  --text-xs:   0.75rem;   /* 12px — labels, badges */
  --text-sm:   0.875rem;  /* 14px — captions, helpers */
  --text-base: 1rem;      /* 16px — body */
  --text-md:   1.0625rem; /* 17px — comfortable reading */
  --text-lg:   1.125rem;  /* 18px — lead text */
  --text-xl:   1.25rem;   /* 20px — sub-headings */
  --text-2xl:  1.5rem;    /* 24px — h3 */
  --text-3xl:  1.875rem;  /* 30px — h2 */
  --text-4xl:  2.25rem;   /* 36px — h1 */

  /* Line Heights */
  --leading-tight:  1.25;
  --leading-snug:   1.4;
  --leading-normal: 1.6;
  --leading-relaxed:1.75;
  --leading-loose:  2;

  /* Text Colors (semantic) */
  --color-text-heading: #0D1B2A;     /* near-black — headings */
  --color-text-body:    #1E293B;     /* dark slate — body paragraphs */
  --color-text-secondary: #334155;   /* medium slate — secondary content */
  --color-text-muted:   #64748B;     /* muted slate — labels, captions */
  --color-text-subtle:  #94A3B8;     /* subtle — disabled, placeholders */

  /* Borders & Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.1);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}


/* Smooth Transitions */
body, .card, .btn, .sidebar, .navbar, .form-control, table, th, td, .alert, .badge, .modal-container, footer {
  transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

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

html {
  font-size: 16.5px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-body);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
  letter-spacing: 0.01em;
  overflow: visible; /* Prevent implicit overflow-y container duplication */
}

/* ── Headings ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text-heading);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); margin-bottom: 1.25rem; font-weight: 800; }
h2 { font-size: var(--text-3xl); margin-bottom: 1rem;   font-weight: 800; }
h3 { font-size: var(--text-2xl); margin-bottom: 0.85rem;font-weight: 700; }
h4 { font-size: var(--text-xl);  margin-bottom: 0.6rem; font-weight: 700; }
h5 { font-size: var(--text-lg);  margin-bottom: 0.5rem; font-weight: 600; }
h6 { font-size: var(--text-base);margin-bottom: 0.5rem; font-weight: 600; }

p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
  font-weight: 400;
  line-height: var(--leading-relaxed);
}

/* Lead paragraph */
.lead {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  font-weight: 400;
}

/* ── Content typography — Learning pages ─────────────────── */
/* Applied to all lesson/reading/grammar content areas        */
.content-body {
  font-size: var(--text-md);
  color: var(--color-text-body);
  line-height: var(--leading-relaxed);
}

.content-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.content-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-heading);
  letter-spacing: -0.02em;
}

.content-meaning {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text-body);
  line-height: var(--leading-normal);
}

.content-example {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  font-style: italic;
  line-height: var(--leading-relaxed);
}

.content-hindi {
  font-family: var(--font-hindi);
  font-size: var(--text-base);
  font-weight: 600;
  color: #92400E;
  background: #FEF3C7;
  padding: 3px 12px;
  border-radius: 20px;
  display: inline-block;
}

.content-explanation {
  font-size: var(--text-base);
  color: var(--color-text-body);
  line-height: var(--leading-relaxed);
}

.content-dialogue {
  font-size: var(--text-md);
  color: var(--color-text-body);
  line-height: var(--leading-relaxed);
}

.content-tip {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ── Text color utilities ────────────────────────────────── */
.text-heading  { color: var(--color-text-heading) !important; }
.text-body     { color: var(--color-text-body) !important; }
.text-secondary{ color: var(--color-text-secondary) !important; }
.text-muted    { color: var(--color-text-muted) !important; }
.text-subtle   { color: var(--color-text-subtle) !important; }

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

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

a:hover {
  color: var(--color-secondary);
}

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

/* Button Variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.btn-secondary:hover {
  background-color: var(--color-secondary-hover);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

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

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  background-color: var(--color-bg-alt);
  color: var(--color-text);
}

.btn-danger {
  background-color: var(--color-error);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background-color: #DC2626;
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}

.form-control {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-input-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.form-control:disabled {
  background-color: var(--color-bg-alt);
  cursor: not-allowed;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  background-color: var(--color-input-bg);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  margin-top: 2px;
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.form-check-input:checked::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid var(--color-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input[type="radio"]:checked::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-white);
  border: none;
  transform: none;
}

/* Form Helper & Error */
.form-helper {
  font-size: 0.775rem;
  color: var(--color-text-muted);
}

.form-error {
  font-size: 0.8rem;
  color: var(--color-error);
  font-weight: 500;
  margin-top: 0.25rem;
  display: none; /* Controlled via script */
}

.form-control.is-invalid {
  border-color: var(--color-error);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Interactive elements cursor reset */
button, select, input[type="submit"] {
  cursor: pointer;
}

/* Modern Sleek Global Scrollbar Styling (replaces browser default and removes separator lines) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
  border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Firefox Support */
html {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 var(--color-bg);
}
