/* ===== NUMPY EDUCATIONAL WEBPAGE - STYLE.CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&family=Fira+Code:wght@600&display=swap');

:root {
  --blue:    rgb(30, 100, 200);
  --lblue:   rgb(173, 216, 230);
  --green:   rgb(34, 139, 34);
  --lgreen:  rgb(198, 239, 206);
  --red:     rgb(200, 30, 30);
  --lred:    rgb(255, 205, 205);
  --saffron: rgb(255, 153, 0);
  --lsaffron:rgb(255, 235, 180);
  --violet:  rgb(128, 0, 128);
  --lviolet: rgb(230, 200, 255);
  --bg:      rgb(240, 248, 255);
  --dark:    rgb(20, 20, 40);
  --white:   #ffffff;
  --border:  rgb(60, 100, 180);
  --shadow:  0 4px 18px rgba(30,100,200,0.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}

/* ===== HEADER ===== */
#header {
  background: linear-gradient(135deg, rgb(20,60,160) 0%, rgb(0,130,100) 50%, rgb(180,60,0) 100%);
  color: #fff;
  padding: 28px 40px 18px;
  text-align: center;
  border-bottom: 5px solid var(--saffron);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
}
#header h1 { font-size: 2.2rem; font-weight: 900; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
#header p  { font-size: 1rem; font-weight: 700; color: rgb(255,235,180); margin-top: 4px; }

/* ===== PRINT BUTTON ===== */
#printBtn {
  position: fixed; right: 24px; top: 18px; z-index: 200;
  background: var(--saffron); color: var(--dark);
  border: 3px solid var(--red); border-radius: 30px;
  padding: 10px 26px; font-size: 1rem; font-weight: 900;
  cursor: pointer; box-shadow: var(--shadow);
  transition: all 0.2s;
}
#printBtn:hover { background: var(--red); color: #fff; transform: scale(1.07); }

/* ===== NAVIGATION ===== */
#nav {
  background: linear-gradient(180deg, rgb(20,60,160) 0%, rgb(30,100,80) 100%);
  padding: 18px 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  border-bottom: 4px solid var(--saffron);
}
.navBtn {
  background: rgba(255,255,255,0.12);
  color: #fff; border: 2px solid var(--saffron);
  border-radius: 20px; padding: 7px 16px;
  font-size: 0.82rem; font-weight: 800;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.navBtn:hover { background: var(--saffron); color: var(--dark); transform: scale(1.08); }

/* ===== MAIN LAYOUT ===== */
#main { max-width: 1200px; margin: 0 auto; padding: 28px 18px 50px; }

/* ===== SECTION CARDS ===== */
.section {
  margin-bottom: 44px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 3px solid var(--border);
}
.sec-header {
  padding: 16px 28px;
  font-size: 1.35rem; font-weight: 900;
  color: #fff; letter-spacing: 1px;
  display: flex; align-items: center; gap: 10px;
}
.sec-body { padding: 22px 28px; background: #fff; }

/* Section color themes */
.s1 .sec-header { background: linear-gradient(90deg, rgb(20,60,160), rgb(60,130,220)); border-bottom: 4px solid var(--saffron); }
.s2 .sec-header { background: linear-gradient(90deg, rgb(34,100,34), rgb(60,180,80)); border-bottom: 4px solid var(--lgreen); }
.s3 .sec-header { background: linear-gradient(90deg, rgb(180,60,0), rgb(220,100,20)); border-bottom: 4px solid var(--lred); }
.s4 .sec-header { background: linear-gradient(90deg, rgb(180,100,0), rgb(255,153,0)); border-bottom: 4px solid var(--blue); }
.s5 .sec-header { background: linear-gradient(90deg, rgb(100,0,120), rgb(160,40,200)); border-bottom: 4px solid var(--lviolet); }
.s6 .sec-header { background: linear-gradient(90deg, rgb(0,100,130), rgb(0,160,180)); border-bottom: 4px solid var(--lsaffron); }
.s7 .sec-header { background: linear-gradient(90deg, rgb(160,20,60), rgb(220,60,100)); border-bottom: 4px solid var(--lblue); }
.s8 .sec-header { background: linear-gradient(90deg, rgb(60,100,0), rgb(100,160,0)); border-bottom: 4px solid var(--lsaffron); }
.s9 .sec-header { background: linear-gradient(90deg, rgb(20,60,160), rgb(100,0,160)); border-bottom: 4px solid var(--saffron); }

/* ===== SUBHEADINGS ===== */
h3.subhead {
  font-size: 1.08rem; font-weight: 900;
  margin: 18px 0 8px;
  padding: 6px 14px;
  border-left: 5px solid var(--saffron);
  background: var(--lsaffron);
  border-radius: 0 10px 10px 0;
  color: rgb(100,40,0);
}
h4.subhead2 {
  font-size: 0.97rem; font-weight: 800;
  margin: 12px 0 6px;
  color: var(--blue);
  padding-left: 10px;
  border-left: 4px solid var(--blue);
}

/* ===== BULLET LISTS ===== */
ul.blist {
  list-style: none; padding: 0; margin: 8px 0 12px 0;
}
ul.blist li {
  padding: 5px 10px 5px 30px;
  position: relative; font-weight: 700;
  line-height: 1.5; color: rgb(20,20,60);
}
ul.blist li::before {
  content: "▶"; position: absolute; left: 8px;
  color: var(--saffron); font-size: 0.75rem; top: 7px;
}

/* ===== TABLES ===== */
.tbl-wrap { overflow-x: auto; margin: 14px 0; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem; font-weight: 700;
  border: 2.5px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
thead tr { background: linear-gradient(90deg, rgb(20,60,160), rgb(0,130,100)); color: #fff; }
thead th { padding: 11px 14px; text-align: left; font-weight: 900; font-size: 0.95rem; }
tbody tr:nth-child(odd)  { background: rgb(240,248,255); }
tbody tr:nth-child(even) { background: rgb(198,239,206); }
tbody td { padding: 9px 14px; border-bottom: 1px solid rgb(173,216,230); color: rgb(20,20,60); }
tbody tr:hover { background: var(--lsaffron); transition: 0.15s; }

/* ===== CODE BLOCKS ===== */
.code-box {
  background: rgb(15,25,50);
  color: rgb(180,255,180);
  border: 2px solid var(--saffron);
  border-radius: 10px; padding: 16px 18px;
  font-family: 'Fira Code', monospace;
  font-size: 0.88rem; font-weight: 600;
  margin: 12px 0; overflow-x: auto;
  line-height: 1.7;
}
.code-box .comment { color: rgb(120,200,120); }
.code-box .kw { color: rgb(255,200,80); }
.code-box .fn { color: rgb(100,200,255); }
.code-box .str { color: rgb(255,160,100); }
.code-box .num { color: rgb(200,150,255); }

/* ===== EXAMPLE BOX ===== */
.example-box {
  background: var(--lsaffron);
  border: 2px solid var(--saffron);
  border-radius: 10px; padding: 14px 18px;
  margin: 12px 0; font-size: 0.93rem;
  font-weight: 700; color: rgb(80,40,0);
}
.example-box strong { color: var(--red); }

/* ===== DISCLAIMER ===== */
#disclaimer {
  background: linear-gradient(90deg, var(--lred), var(--lsaffron));
  border: 3px solid var(--red);
  border-radius: 14px; padding: 16px 24px;
  margin: 30px 0; font-size: 0.95rem;
  font-weight: 800; color: rgb(120,20,20);
  text-align: center;
}

/* ===== CANVAS SECTIONS ===== */
.canvas-container {
  background: #fff;
  border: 3px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.canvas-title {
  font-size: 1.3rem; font-weight: 900;
  text-align: center;
  padding: 12px;
  color: #fff;
  border-radius: 10px 10px 0 0;
  margin: -18px -18px 16px;
}
.ct-flow  { background: linear-gradient(90deg, rgb(20,60,160), rgb(0,130,100)); }
.ct-mind  { background: linear-gradient(90deg, rgb(100,0,120), rgb(220,60,0)); }
.ct-road  { background: linear-gradient(90deg, rgb(0,100,130), rgb(60,100,0)); }

canvas { display: block; margin: 0 auto; }

/* ===== PRINT STYLES ===== */
@media print {
  #printBtn, #nav { display: none !important; }
  #header { position: relative; }
  .section { page-break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  #header h1 { font-size: 1.4rem; }
  .sec-header { font-size: 1.05rem; padding: 12px 16px; }
  .sec-body { padding: 14px 12px; }
  #printBtn { padding: 8px 14px; font-size: 0.85rem; right: 8px; top: 10px; }
}