/* ===================================================
   Grade Calculator — Custom CSS
   Font: Inter + Poppins
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── Root & Variables ─────────────────────────────── */
:root {
  --primary: #2563EB;
  --accent:  #06B6D4;
  --grad:    linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
  --grad-dark: linear-gradient(135deg, #3B82F6 0%, #22D3EE 100%);
  --glass-light: rgba(255, 255, 255, 0.7);
  --glass-dark:  rgba(15, 23, 42, 0.7);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.25);
}

/* ── Base ─────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-poppins { font-family: 'Poppins', sans-serif; }

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2563EB, #06B6D4);
  border-radius: 99px;
}

/* ── Navbar ───────────────────────────────────────── */
#navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(37, 99, 235, 0.08);
  transition: all 0.3s ease;
}
.dark #navbar {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}
#navbar.scrolled {
  box-shadow: 0 4px 30px rgba(37, 99, 235, 0.1);
}

.nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s ease;
  text-decoration: none;
}
.dark .nav-link { color: #CBD5E1; }
.nav-link:hover,
.nav-link.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(6,182,212,0.1));
  color: #2563EB;
}
.dark .nav-link:hover,
.dark .nav-link.active {
  color: #3B82F6;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s ease;
  text-decoration: none;
}
.dark .mobile-nav-link { color: #CBD5E1; }
.mobile-nav-link:hover {
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(6,182,212,0.08));
  color: #2563EB;
}
.dark .mobile-nav-link:hover { color: #3B82F6; }

/* ── Buttons ──────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.8rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
  background-size: 200% 200%;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45);
  background-position: right center;
}
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.8rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #2563EB;
  background: transparent;
  border: 2px solid #2563EB;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}
.dark .btn-secondary { color: #3B82F6; border-color: #3B82F6; }
.btn-secondary:hover {
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
}

/* ── Hero ─────────────────────────────────────────── */
.hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37,99,235,0.18) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 80% 50%, rgba(6,182,212,0.12) 0%, transparent 60%),
              #ffffff;
}
.dark .hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59,130,246,0.22) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 80% 50%, rgba(34,211,238,0.14) 0%, transparent 60%),
              #0F172A;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(6,182,212,0.12));
  border: 1px solid rgba(37,99,235,0.25);
  color: #2563EB;
}
.dark .hero-badge {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(34,211,238,0.15));
  border-color: rgba(59,130,246,0.3);
  color: #3B82F6;
}

.gradient-text {
  background: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dark .gradient-text {
  background: linear-gradient(135deg, #3B82F6 0%, #22D3EE 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Animated gradient hero text */
.gradient-text-animated {
  background: linear-gradient(135deg, #2563EB 0%, #06B6D4 50%, #2563EB 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s linear infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── Glass Cards ──────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 1.25rem;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.08);
  transition: all 0.3s ease;
}
.dark .glass-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
}
.dark .glass-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(59, 130, 246, 0.25);
}

/* ── Calculator Tabs ──────────────────────────────── */
.calc-tab {
  padding: 0.55rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #6B7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.dark .calc-tab { color: #94A3B8; }
.calc-tab:hover { color: #2563EB; background: rgba(37,99,235,0.06); }
.dark .calc-tab:hover { color: #3B82F6; }
.calc-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.calc-panel { display: none; }
.calc-panel.active { display: block; animation: fadeInUp 0.3s ease; }

/* ── Form Inputs ──────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid #E5E7EB;
  color: #111827;
  outline: none;
  transition: all 0.2s ease;
}
.dark .form-input {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(59,130,246,0.2);
  color: #F8FAFC;
}
.form-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.dark .form-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.form-input::placeholder { color: #9CA3AF; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}
.dark .form-label { color: #CBD5E1; }

/* ── Result Box ───────────────────────────────────── */
.result-box {
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(6,182,212,0.06));
  border: 1.5px solid rgba(37,99,235,0.15);
  animation: fadeInUp 0.4s ease;
}
.dark .result-box {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(34,211,238,0.08));
  border-color: rgba(59,130,246,0.2);
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}

/* Grade colors */
.grade-A { background: linear-gradient(135deg, #16A34A, #22D3EE); }
.grade-B { background: linear-gradient(135deg, #2563EB, #06B6D4); }
.grade-C { background: linear-gradient(135deg, #D97706, #F59E0B); }
.grade-D { background: linear-gradient(135deg, #EA580C, #F97316); }
.grade-F { background: linear-gradient(135deg, #DC2626, #F87171); }

/* ── FAQ ──────────────────────────────────────────── */
.faq-item { border-radius: 1rem; overflow: hidden; transition: all 0.3s ease; }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
  transition: color 0.2s;
}
.dark .faq-question { color: #F8FAFC; }
.faq-question:hover { color: #2563EB; }
.dark .faq-question:hover { color: #3B82F6; }

.faq-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(6,182,212,0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s;
  color: #2563EB;
}
.dark .faq-icon { color: #3B82F6; }
.faq-item.open .faq-icon {
  transform: rotate(180deg);
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #fff;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-inner {
  padding: 0 1.25rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #4B5563;
}
.dark .faq-answer-inner { color: #94A3B8; }

/* ── Blog Cards ───────────────────────────────────── */
.blog-card {
  border-radius: 1.25rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(229,231,235,0.8);
  transition: all 0.35s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}
.dark .blog-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(59,130,246,0.1);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(37,99,235,0.14);
  border-color: rgba(37,99,235,0.2);
}
.dark .blog-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border-color: rgba(59,130,246,0.25);
}

.blog-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(6,182,212,0.1));
  color: #2563EB;
  border: 1px solid rgba(37,99,235,0.2);
}
.dark .blog-tag {
  color: #3B82F6;
  border-color: rgba(59,130,246,0.25);
}

/* ── Feature Icons ────────────────────────────────── */
.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(6,182,212,0.12));
  color: #2563EB;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.dark .feature-icon {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(34,211,238,0.15));
  color: #3B82F6;
}
.glass-card:hover .feature-icon {
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37,99,235,0.3);
  transform: scale(1.08);
}

/* ── Section Titles ───────────────────────────────── */
.section-subtitle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

/* ── Stats Bar ────────────────────────────────────── */
.stat-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(6,182,212,0.05));
  border: 1px solid rgba(37,99,235,0.1);
  transition: all 0.3s ease;
}
.dark .stat-card {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(34,211,238,0.08));
  border-color: rgba(59,130,246,0.15);
}
.stat-card:hover { transform: translateY(-3px); }

/* ── CTA Banner ───────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, #1D4ED8 0%, #0891B2 50%, #1D4ED8 100%);
  background-size: 200% 200%;
  animation: gradientShift 5s linear infinite;
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 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.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

/* ── Animations ───────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-12px) rotate(3deg); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(37,99,235,0.3); }
  50%       { box-shadow: 0 0 40px rgba(37,99,235,0.6); }
}

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-float-delay { animation: float 4s ease-in-out 1.5s infinite; }
.animate-pulse-glow { animation: pulse-glow 2.5s ease-in-out infinite; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Footer ───────────────────────────────────────── */
.footer-link {
  color: #9CA3AF;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}
.footer-link:hover { color: #3B82F6; }

/* ── Floating Shapes (hero bg) ────────────────────── */
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  pointer-events: none;
}
.shape-1 {
  width: 400px; height: 400px;
  background: #2563EB;
  top: -80px; right: -80px;
  animation: float 7s ease-in-out infinite;
}
.shape-2 {
  width: 300px; height: 300px;
  background: #06B6D4;
  bottom: 0; left: -80px;
  animation: float 9s ease-in-out 2s infinite;
}
.dark .shape { opacity: 0.2; }

/* ── Weighted / Dynamic rows ──────────────────────── */
.grade-row {
  display: grid;
  gap: 0.5rem;
  align-items: center;
  animation: fadeInUp 0.25s ease;
}

/* ── Contact form textarea ────────────────────────── */
textarea.form-input { resize: vertical; min-height: 130px; }

/* ── Search bar ───────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(37,99,235,0.15);
  border-radius: 0.875rem;
  overflow: hidden;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(37,99,235,0.1);
}
.dark .search-bar {
  background: rgba(30,41,59,0.8);
  border-color: rgba(59,130,246,0.2);
}
.search-bar:focus-within {
  border-color: #2563EB;
  box-shadow: 0 4px 30px rgba(37,99,235,0.2);
}
.search-bar input {
  flex: 1;
  padding: 0.8rem 1.1rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: #111827;
  outline: none;
}
.dark .search-bar input { color: #F8FAFC; }
.search-bar input::placeholder { color: #9CA3AF; }
.search-bar button {
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  margin: 0.3rem;
  border-radius: 0.6rem;
}
.search-bar button:hover { opacity: 0.9; }

/* ── Progress bar ─────────────────────────────────── */
.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: #E5E7EB;
  overflow: hidden;
}
.dark .progress-bar { background: rgba(255,255,255,0.08); }
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2563EB, #06B6D4);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
