* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --neon-cyan: #00f0ff;
  --neon-magenta: #ff00e5;
  --neon-green: #39ff14;
  --neon-purple: #bf00ff;
  --neon-yellow: #f0ff00;
  --bg: #0a0a12;
  --bg-surface: #12121e;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --border: #2a2a44;
  --text: #e0e0f0;
  --text-dim: #7070a0;
  --glow-cyan: rgba(0, 240, 255, 0.4);
  --glow-magenta: rgba(255, 0, 229, 0.4);
  --glow-green: rgba(57, 255, 20, 0.4);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

header {
  background: linear-gradient(180deg, #0d0d1a, #0a0a12);
  color: var(--neon-cyan);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
  border-bottom: 2px solid var(--neon-cyan);
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--glow-cyan);
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.nav-links a:hover {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.nav-links a.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 14px var(--glow-cyan);
  text-shadow: 0 0 8px var(--glow-cyan);
}

.hero {
  background: linear-gradient(180deg, #0d0d1a 0%, #0a0a12 50%, #0f0f1a 100%);
  color: var(--text);
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 2px solid var(--neon-cyan);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-magenta), var(--neon-cyan), transparent);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px var(--glow-cyan), 0 0 40px rgba(0, 240, 255, 0.2);
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.8;
  color: var(--text-dim);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.grades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.grade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
}

.grade-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 30px var(--glow-cyan), 0 10px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--neon-cyan);
}

.grade-card .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.grade-card h3 {
  color: var(--neon-cyan);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 8px var(--glow-cyan);
}

.grade-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.grade-page {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.grade-page h1 {
  color: var(--neon-cyan);
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: 0 0 16px var(--glow-cyan);
}

.grade-page .subtitle {
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.topic-section,
.topic {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.topic-section h2,
.topic h2 {
  color: var(--neon-cyan);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--neon-magenta);
  text-shadow: 0 0 8px var(--glow-cyan);
}

.topic-section h3,
.topic h3 {
  color: var(--neon-magenta);
  margin: 1.5rem 0 1rem;
}

.theory {
  background: rgba(0, 240, 255, 0.05);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--neon-cyan);
}

.theory h4 {
  color: var(--neon-cyan);
  margin-bottom: 1rem;
}

.example-box {
  background: rgba(57, 255, 20, 0.05);
  border-left: 4px solid var(--neon-green);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
}

.problem-box {
  background: rgba(255, 0, 229, 0.05);
  border-left: 4px solid var(--neon-magenta);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
}

.solution-box {
  background: rgba(0, 240, 255, 0.05);
  border-left: 4px solid var(--neon-cyan);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.5rem;
  display: none;
}

.solution-box.active {
  display: block;
}

.example-box h4,
.problem-box h4,
.solution-box h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.math {
  font-family: 'Cambria Math', 'Times New Roman', serif;
  font-size: 1.1em;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 4px;
  display: inline-block;
  margin: 0.2rem;
}

.formula {
  display: block;
  text-align: center;
  font-size: 1.3em;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.05);
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 15px var(--glow-cyan);
}

.btn-primary:hover {
  box-shadow: 0 0 30px var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 15px var(--glow-green);
}

.btn-warning {
  background: var(--neon-magenta);
  color: #fff;
  box-shadow: 0 0 15px var(--glow-magenta);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.show-solution {
  margin-top: 1rem;
}

.tip {
  background: rgba(240, 255, 0, 0.06);
  border: 1px solid rgba(240, 255, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.tip::before {
  content: "💡";
}

.important {
  background: rgba(255, 0, 229, 0.06);
  border: 1px solid rgba(255, 0, 229, 0.3);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid var(--neon-magenta);
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--neon-cyan);
  color: #000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.5rem;
  box-shadow: 0 0 20px var(--glow-cyan);
  transition: transform 0.3s;
}

.back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 0 35px var(--glow-cyan);
}

footer {
  background: #0d0d1a;
  color: var(--text-dim);
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 2px solid var(--neon-cyan);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .grades-grid {
    grid-template-columns: 1fr;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--neon-cyan);
  color: #000;
  text-shadow: none;
}

tr:hover {
  background: rgba(0, 240, 255, 0.05);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps li {
  counter-increment: step;
  padding-left: 2.5rem;
  position: relative;
  margin-bottom: 1rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--neon-cyan);
  color: #000;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 10px var(--glow-cyan);
}

.quiz {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.quiz-question {
  font-weight: bold;
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  padding: 0.8rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.quiz-option:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.quiz-option.correct {
  border-color: var(--neon-green);
  background: rgba(57, 255, 20, 0.08);
}

.quiz-option.incorrect {
  border-color: var(--neon-magenta);
  background: rgba(255, 0, 229, 0.08);
}

.code-box {
  background: #0d0d1a;
  border: 1px solid var(--border);
  border-left: 4px solid var(--neon-purple);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.15);
}

.code-box .comment {
  color: var(--neon-green);
  text-shadow: none;
}

.code-box .keyword {
  color: var(--neon-magenta);
  text-shadow: none;
}

.code-box .string {
  color: var(--neon-yellow);
  text-shadow: none;
}

.quiz-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: none;
}

.quiz-q-result {
  margin-top: 0.75rem;
  font-weight: bold;
}