/* ===== BCA Sem 1 Study Guide — Shared Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1a1a2e;
  --text2: #475569;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent2: #7c3aed;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #2563eb);
  padding: 40px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 60%);
  animation: headerPulse 8s ease-in-out infinite;
}
@keyframes headerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.page-header h1 {
  font-size: 2rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.5px;
  position: relative;
}
.page-header p {
  color: #e0e7ff;
  margin-top: 6px;
  font-size: .95rem;
  position: relative;
}

/* ===== BACK BUTTON ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  font-family: inherit;
  text-decoration: none;
  margin: 20px auto 0;
  position: relative;
}
.back-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

/* ===== NOTE CARDS ===== */
.note-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  transition: box-shadow .25s, transform .25s;
}
.note-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.07);
  transform: translateY(-2px);
}
.note-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid #eef2ff;
  padding-bottom: 10px;
}
.note-card p {
  font-size: .93rem;
  color: var(--text2);
  line-height: 1.95;
  margin-bottom: 8px;
}
.note-card ul, .note-card ol {
  padding-left: 24px;
  font-size: .93rem;
  color: var(--text2);
  line-height: 2.1;
}
.note-card li { margin-bottom: 4px; }
.note-card code {
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: .84rem;
  color: #4338ca;
  font-family: 'Fira Code', monospace;
}
.note-card pre {
  background: #1e293b;
  color: #86efac;
  padding: 18px 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: .84rem;
  font-family: 'Fira Code', monospace;
  line-height: 1.75;
  margin: 14px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ===== FORMULA / TIP / WARNING BOXES ===== */
.formula {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px 20px;
  margin: 12px 0;
  font-family: 'Fira Code', monospace;
  color: #4338ca;
  font-size: .9rem;
  line-height: 1.8;
}
.tip {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  border-radius: 0 10px 10px 0;
  padding: 14px 20px;
  margin: 14px 0;
  font-size: .9rem;
  color: #166534;
}
.warn {
  background: #fff7ed;
  border-left: 4px solid #f59e0b;
  border-radius: 0 10px 10px 0;
  padding: 14px 20px;
  margin: 14px 0;
  font-size: .9rem;
  color: #9a3412;
}
.example {
  background: #faf5ff;
  border-left: 4px solid #7c3aed;
  border-radius: 0 10px 10px 0;
  padding: 14px 20px;
  margin: 14px 0;
  font-size: .9rem;
  color: #5b21b6;
}

/* ===== TABLE INSIDE NOTES ===== */
.note-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: .88rem;
}
.note-card th {
  background: #eef2ff;
  color: #4338ca;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  border: 1px solid #c7d2fe;
}
.note-card td {
  padding: 8px 14px;
  border: 1px solid var(--border);
  color: var(--text2);
}
.note-card tr:nth-child(even) td { background: #f8fafc; }

/* ===== MCQ SECTION ===== */
.mcq-section {
  margin-top: 36px;
  border-top: 3px solid var(--border);
  padding-top: 24px;
}
.mcq-section h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #7c3aed;
  margin-bottom: 18px;
}
.score-bar {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 14px 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.score-bar span { font-weight: 700; color: #4338ca; font-size: 1rem; }
.score-bar button {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: .85rem;
  transition: .2s;
}
.score-bar button:hover { background: #4338ca; }
.mcq {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.mcq .q {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 14px;
  color: #1e293b;
}
.mcq-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mcq-opt {
  padding: 11px 18px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: .9rem;
  color: var(--text2);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  text-align: left;
  font-weight: 500;
}
.mcq-opt:hover { border-color: #a5b4fc; background: #eef2ff; }
.mcq-opt.correct { background: #dcfce7 !important; border-color: #22c55e !important; color: #166534 !important; }
.mcq-opt.wrong { background: #fef2f2 !important; border-color: #ef4444 !important; color: #991b1b !important; }
.mcq-opt.dimmed { opacity: .5; pointer-events: none; }
.mcq-explain {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  font-size: .88rem;
  color: #166534;
  display: none;
}
.mcq-explain.show { display: block; }

/* ===== SECTION DIVIDER ===== */
.section-divider {
  text-align: center;
  margin: 32px 0 24px;
  position: relative;
}
.section-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--border);
}
.section-divider span {
  background: var(--bg);
  padding: 0 20px;
  position: relative;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 28px;
  color: #94a3b8;
  font-size: .85rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  background: var(--card);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .mcq-opts { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.5rem; }
  .note-card { padding: 18px; }
}
