/* ==========================================================
   BNS 2023 – AIBE Study Guide | Digital E-Filing Coach
   style.css — Scoped under #bns-wrapper
   Author: Amanuddin Education, Haldia, West Bengal
   ========================================================== */

/* ── Google-like smooth font fallback ─────────────────────── */
#bns-wrapper *,
#bns-wrapper *::before,
#bns-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#bns-wrapper {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #222;
  background: #f4f7fb;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 40px;
}

/* ── HEADER ────────────────────────────────────────────────── */
#bns-header {
  background: linear-gradient(135deg, #1a3a5c 0%, #0d2240 60%, #1a3a5c 100%);
  color: white;
  text-align: center;
  padding: 38px 24px 30px;
  position: relative;
  overflow: hidden;
}

#bns-header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(230,126,34,0.12);
  border-radius: 50%;
}

#bns-header::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -30px;
  width: 150px; height: 150px;
  background: rgba(39,174,96,0.10);
  border-radius: 50%;
}

.header-brand {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #f0c040;
  margin-bottom: 10px;
  font-weight: 600;
}

#bns-header h1 {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#bns-header h2 {
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 600;
  color: #e0eeff;
  margin-bottom: 10px;
}

.header-sub {
  font-size: 13px;
  color: #b0c8e8;
  margin-bottom: 16px;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.badge.blue   { background: #2980b9; color: #fff; }
.badge.green  { background: #27ae60; color: #fff; }
.badge.saffron{ background: #e67e22; color: #fff; }
.badge.violet { background: #8e44ad; color: #fff; }

.header-btns {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-print,
.btn-ak {
  padding: 9px 22px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.3px;
}

.btn-print {
  background: #e67e22;
  color: white;
  box-shadow: 0 3px 10px rgba(230,126,34,0.4);
}
.btn-print:hover { background: #d35400; transform: translateY(-2px); }

.btn-ak {
  background: #27ae60;
  color: white;
  box-shadow: 0 3px 10px rgba(39,174,96,0.35);
}
.btn-ak:hover { background: #1e8449; transform: translateY(-2px); }

/* ── STICKY NAV ─────────────────────────────────────────────── */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #1a3a5c;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}

.sticky-nav button {
  background: rgba(255,255,255,0.12);
  color: #dde9f8;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.sticky-nav button:hover {
  background: #e67e22;
  color: white;
  border-color: #e67e22;
  transform: translateY(-1px);
}

/* ── SECTION CARDS ──────────────────────────────────────────── */
.section-card {
  background: #fff;
  border-radius: 12px;
  margin: 22px 14px;
  padding: 28px 24px;
  box-shadow: 0 3px 16px rgba(26,58,92,0.1);
  border-top: 4px solid #1a3a5c;
}

.sec-title {
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 800;
  color: #1a3a5c;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8eef6;
}

/* ── INTRO GRID ─────────────────────────────────────────────── */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.intro-box {
  border-radius: 10px;
  padding: 18px 16px;
  border-left: 5px solid transparent;
}

.intro-box h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
}

.intro-box ul,
.intro-box ol {
  padding-left: 18px;
  font-size: 13.5px;
}

.intro-box li { margin-bottom: 5px; }
.intro-box p  { font-size: 13.5px; }

.blue-box   { background: #eaf4ff; border-left-color: #2980b9; }
.green-box  { background: #eafaf1; border-left-color: #27ae60; }
.saffron-box{ background: #fdf2e9; border-left-color: #e67e22; }
.violet-box { background: #f5eef8; border-left-color: #8e44ad; }

/* ── TOC GRID ───────────────────────────────────────────────── */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.toc-item {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.toc-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  filter: brightness(0.92);
}

.toc-item.blue   { background: #d6eaf8; color: #1a5276; border-color: #2980b9; }
.toc-item.green  { background: #d5f5e3; color: #145a32; border-color: #27ae60; }
.toc-item.saffron{ background: #fdebd0; color: #784212; border-color: #e67e22; }
.toc-item.violet { background: #e8daef; color: #4a235a; border-color: #8e44ad; }
.toc-item.red    { background: #fadbd8; color: #7b241c; border-color: #c0392b; }

/* ── FLOWCHART / MIND MAP ───────────────────────────────────── */
.flowchart-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  background: #f8faff;
  border: 1px solid #dde8f4;
  padding: 10px;
}

.flowchart-svg {
  min-width: 600px;
  width: 100%;
  height: auto;
  display: block;
}

/* ── ROADMAP ────────────────────────────────────────────────── */
.roadmap-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rm-step {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
}

.rm-step::after {
  content: '';
  position: absolute;
  left: 27px;
  top: 56px;
  width: 2px;
  height: calc(100% - 10px);
  background: #cbd5e8;
  z-index: 0;
}

.rm-step:last-child::after { display: none; }

.rm-num {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  margin-right: 16px;
  margin-bottom: 4px;
}

.rm-content {
  background: #f8faff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  flex: 1;
  border-left: 4px solid transparent;
  box-shadow: 0 2px 8px rgba(26,58,92,0.06);
}

.rm-content h4 {
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 5px;
  color: #1a3a5c;
}

.rm-content p { font-size: 13px; color: #444; }

/* Step colors */
.rm-step1 .rm-num { background: #2980b9; }
.rm-step1 .rm-content { border-left-color: #2980b9; }
.rm-step2 .rm-num { background: #27ae60; }
.rm-step2 .rm-content { border-left-color: #27ae60; }
.rm-step3 .rm-num { background: #e67e22; }
.rm-step3 .rm-content { border-left-color: #e67e22; }
.rm-step4 .rm-num { background: #8e44ad; }
.rm-step4 .rm-content { border-left-color: #8e44ad; }
.rm-step5 .rm-num { background: #c0392b; }
.rm-step5 .rm-content { border-left-color: #c0392b; }
.rm-step6 .rm-num { background: #16a085; }
.rm-step6 .rm-content { border-left-color: #16a085; }
.rm-step7 .rm-num { background: #d35400; }
.rm-step7 .rm-content { border-left-color: #d35400; }
.rm-step8 .rm-num { background: #1a3a5c; }
.rm-step8 .rm-content { border-left-color: #1a3a5c; }

/* ── OFFENCES TABS ──────────────────────────────────────────── */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e8eef6;
}

.tab-btn {
  background: #eaf0f8;
  color: #1a3a5c;
  border: 2px solid #c8d8ec;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #1a3a5c;
  color: white;
  border-color: #1a3a5c;
}

.tab-btn.active {
  background: #1a3a5c;
  color: white;
  border-color: #1a3a5c;
  box-shadow: 0 2px 8px rgba(26,58,92,0.3);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-content > h3 {
  font-size: 17px;
  font-weight: 800;
  color: #1a3a5c;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #eaf0f8, #f8faff);
  border-radius: 8px;
  border-left: 5px solid #1a3a5c;
}

.chapter-note {
  background: #fdf2e9;
  border-left: 4px solid #e67e22;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #784212;
  margin-bottom: 18px;
}

/* ── OFFENCE CARDS ──────────────────────────────────────────── */
.offence-card {
  background: #fafbff;
  border-radius: 10px;
  padding: 18px 18px 14px;
  margin-bottom: 18px;
  border: 1px solid #dce7f5;
  border-left: 5px solid #2980b9;
  box-shadow: 0 2px 8px rgba(26,58,92,0.06);
}

.offence-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #1a3a5c;
  margin-bottom: 10px;
}

.offence-card p  { font-size: 14px; margin-bottom: 8px; }
.offence-card ul,
.offence-card ol { padding-left: 20px; font-size: 13.5px; margin-bottom: 8px; }
.offence-card li { margin-bottom: 4px; }
.offence-card strong { color: #1a3a5c; }

/* Example boxes */
.example-box {
  background: #eafaf1;
  border: 1px solid #a9dfbf;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.ex-label {
  font-weight: 800;
  color: #1a7a44;
  margin-right: 6px;
}

/* Trap boxes */
.trap-box {
  background: #fef9e7;
  border: 1px solid #f9e08e;
  border-left: 4px solid #e67e22;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 13.5px;
  color: #7d5800;
}

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(26,58,92,0.08);
}

.bns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 420px;
}

.bns-table thead tr {
  background: linear-gradient(90deg, #1a3a5c, #224a74);
  color: white;
}

.bns-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.bns-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e5edf6;
  vertical-align: top;
}

.bns-table tbody tr:nth-child(even)  { background: #f1f6fc; }
.bns-table tbody tr:nth-child(odd)   { background: #fff; }
.bns-table tbody tr:hover { background: #deeef8; transition: background 0.15s; }

/* ── MCQ SECTION ────────────────────────────────────────────── */
.mcq-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.mcq-tab-btn {
  padding: 10px 18px;
  border: 2px solid #1a3a5c;
  border-radius: 6px;
  background: #fff;
  color: #1a3a5c;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.mcq-tab-btn:hover {
  background: #1a3a5c;
  color: white;
}

.mcq-tab-btn.active {
  background: #1a3a5c;
  color: white;
  box-shadow: 0 2px 8px rgba(26,58,92,0.3);
}

.mcq-group {
  display: none;
}

.mcq-group.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.mcq-group > h3 {
  font-size: 16px;
  font-weight: 800;
  color: #1a3a5c;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: #eaf0f8;
  border-radius: 8px;
  border-left: 5px solid #2980b9;
}

.mcq-item {
  background: #fafbff;
  border: 1px solid #dce7f5;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.mcq-item:hover {
  box-shadow: 0 3px 14px rgba(26,58,92,0.1);
}

.mcq-q {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 10px;
  line-height: 1.5;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 4px;
}

.mcq-options label {
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e0eaf5;
  transition: background 0.15s;
}

.mcq-options label:hover { background: #eaf0f8; }

.mcq-options input[type="radio"] {
  margin-top: 2px;
  accent-color: #1a3a5c;
}

.mcq-ans {
  margin-top: 10px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-left: 4px solid #27ae60;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #1b5e20;
}

/* Difficulty tags */
.diff-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}

.diff-tag.easy     { background: #d5f5e3; color: #1a7a44; }
.diff-tag.moderate { background: #fdebd0; color: #784212; }
.diff-tag.hard     { background: #fadbd8; color: #7b241c; }

/* ── SHORT / DESCRIPTIVE Q ──────────────────────────────────── */
.qa-item {
  background: #fafbff;
  border: 1px solid #dce7f5;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.qa-q {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 8px;
}

.qa-ans {
  margin-top: 10px;
  background: #f0f4ff;
  border-left: 4px solid #8e44ad;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #333;
}

/* ── REVISION GRID ──────────────────────────────────────────── */
.revision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.rev-box {
  background: #f8faff;
  border-radius: 10px;
  padding: 18px 16px;
  border: 1px solid #dce7f5;
  border-top: 4px solid #1a3a5c;
  box-shadow: 0 2px 8px rgba(26,58,92,0.07);
}

.rev-box h4 {
  font-size: 15px;
  font-weight: 800;
  color: #1a3a5c;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0eaf5;
}

.rev-box ul {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
}

.rev-box li { margin-bottom: 4px; }
.rev-box strong { color: #1a3a5c; }

/* ── DISCLAIMER ─────────────────────────────────────────────── */
.disclaimer-section {
  border-top-color: #c0392b;
  background: #fff8f8;
}

.disclaimer-section .sec-title { color: #c0392b; }

.disclaimer-section p {
  font-size: 13.5px;
  color: #555;
  line-height: 1.8;
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
#bns-wrapper ::-webkit-scrollbar { width: 7px; height: 7px; }
#bns-wrapper ::-webkit-scrollbar-track { background: #f0f4f8; }
#bns-wrapper ::-webkit-scrollbar-thumb { background: #b0c8e8; border-radius: 4px; }
#bns-wrapper ::-webkit-scrollbar-thumb:hover { background: #1a3a5c; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section-card { margin: 14px 8px; padding: 18px 14px; }
  .sticky-nav button { font-size: 11.5px; padding: 5px 10px; }
  .tab-btn { font-size: 12px; padding: 7px 10px; }
  .mcq-tab-btn { font-size: 12px; padding: 8px 12px; }
  .bns-table { font-size: 12.5px; }
  .bns-table th,
  .bns-table td { padding: 8px 10px; }
  .intro-grid { grid-template-columns: 1fr; }
  .toc-grid  { grid-template-columns: 1fr 1fr; }
  .revision-grid { grid-template-columns: 1fr; }
  #bns-header h1 { font-size: 20px; }
}

@media (max-width: 480px) {
  .toc-grid { grid-template-columns: 1fr; }
  .header-btns { flex-direction: column; align-items: center; }
  .mcq-nav { flex-direction: column; }
}

/* ── PRINT STYLES ───────────────────────────────────────────── */
@media print {
  #bns-wrapper {
    background: #fff;
    max-width: 100%;
    font-size: 12pt;
    color: #000;
  }

  .sticky-nav,
  .header-btns,
  .tab-nav,
  .mcq-nav,
  .mcq-options input[type="radio"] {
    display: none !important;
  }

  .tab-content,
  .mcq-group {
    display: block !important;
  }

  .answer-key {
    display: block !important;
  }

  .section-card {
    box-shadow: none;
    border: 1px solid #ccc;
    margin: 10px 0;
    page-break-inside: avoid;
  }

  .offence-card,
  .mcq-item,
  .qa-item {
    page-break-inside: avoid;
    border: 1px solid #ccc;
  }

  #bns-header {
    background: #1a3a5c !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .bns-table thead tr {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .flowchart-container,
  .flowchart-svg {
    max-width: 100%;
    overflow: hidden;
  }

  a { text-decoration: none; color: #000; }

  .diff-tag {
    border: 1px solid #999;
    background: none !important;
    color: #000 !important;
  }
}