/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table, td, tr,th {
 border: 1px solid #333333;
  border-spacing: 0;
 padding: 5px;
 text-align: center;
}
sup {font-size: x-small;
vertical-align: super;}
sub {font-size: x-small;
vertical-align: sub;}
body {
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  font-size: medium;
  line-height: 110%;
  background-color: rgb(248, 250, 252);
  margin-left: 30px;
  margin-right: 40px;
  margin-bottom: 30px;
  color: rgb(51, 65, 85);
}
h1,
h2,
h3, h4 {
  font-weight: bolder;
  background-color: rgb(59, 130, 246);
  color: white;
  margin: 1rem;
  padding: 1rem;
  line-height: 120%;
}
strong {font-weight: bold;color: rgb(17, 24, 39);}
h1 {
  font-size: 2rem;
  text-align: center;
  border-bottom-width: 10px #333333 solid;
  line-height: 120%;
}

h2 {
  font-size: x-large;
  margin-left: 20px;
  margin-right: 20px;
}

h3 {
  font-size: large;
  margin-left: 30px;
  margin-right: 30px;
}

h4 {margin-left: 35px;
margin-right: 35px;}

h5 {margin-left: 35px;}

table {
  margin-left: 45px;
}
p {
  margin-top: 10px;
  margin-left: 45px;
  margin-bottom: 5px;
  margin-right: 40px;
}

h1 code {
  margin-left: 0px;
  margin-right: 0px;
}

p code {
  margin-left: 0px;
  margin-right: 0px;
}

pre code {
  margin-left: 0px;
  margin-right: 0px;
}
h4 code { margin-left: 0px; margin-right: 0px;}
h2 code { margin-left: 0px; margin-right: 0px;}
h3 code { margin-left: 0px; margin-right: 0px;}
li code { margin-left: 0px; margin-right: 0px;}
code, pre {
  
  margin-top: 15px;
  margin-left: 40px;
  margin-right: 40px;
  font-family: "Courier New", Courier, monospace;
  background-color: rgb(248, 250, 252);
  color: rgb(34, 139, 34);

  padding-top: 5px;
  padding-left: 2px;
  line-height: 150%;

}

p code {
 margin-right: 0;
}

footer {
  text-align: left;
}
ol li {
  padding-top: 10px;
  list-style-type:decimal ;
}

a {color: rgb(59, 130, 246);}
ul li {
  list-style-type: disc;
}
dl, ol, ul, li {
  margin-left: 45px;
  padding-top: 5px;
}

ul li ul li {
  margin-left: 0px;
}

dd
{
 margin-left: 25px;
 padding-bottom: 10px;

}
img {background-color: white;
width:100%}

div img {width:45%;
text-align: center;}

.center {text-align: center;}

blockquote {margin-left: 150px;
margin-right: 140px;
background-color: rgb(226, 232, 240);
color: rgb(51, 65, 85);
padding: 12px;}

footer {padding-bottom: 20px;}

#sm-logo {width: 15%;
height: 15%;}

pre {

  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

h3 a { color: white;}


        .code-comment {
            color: #0891b2;
            font-style: italic;
        }
        .comment-block {
  
            border-left: 4px solid #1890ff;
            padding: 10px 15px;
            margin: 15px 0;
            border-radius: 0 5px 5px 0;
        }

        /* Updated mermaid styling for light mode and centering */
        .mermaid_container, .mermaid-diagram, .mermaid {
            margin: 25px auto;
            padding: 20px;
            background-color: rgb(255, 255, 255);
            color: rgb(51, 65, 85);
            border: 1px solid rgb(226, 232, 240);
            border-radius: 8px;
            max-width: 90%;
            text-align: center;
            display: block;
        }

        /* Style for SVG elements within mermaid diagrams */
        .mermaid svg {
            margin: 0 auto;
            display: block;
        }

        /* Light theme for mermaid diagram elements */
        .mermaid .node rect, 
        .mermaid .node circle, 
        .mermaid .node ellipse, 
        .mermaid .node polygon, 
        .mermaid .node path {
            fill: rgb(248, 250, 252);
            stroke: rgb(148, 163, 184);
        }

        .mermaid .edgePath .path {
            stroke: rgb(71, 85, 105);
        }

        .mermaid .label {
            color: rgb(51, 65, 85);
            fill: rgb(51, 65, 85);
        }

        .mermaid .cluster rect {
            fill: rgb(241, 245, 249);
            stroke: rgb(148, 163, 184);
        }
        
        /* Ensure text labels are visible in light mode */
        .mermaid .label text, 
        .mermaid text {
            fill: #1f2937 !important;
        }

        /* Specific styling for mindmap and flowchart text */
        .mermaid .flowchart-label text,
        .mermaid .mindmap-node text,
        .mermaid .mindmap-node .nodeText,
        .mermaid .nodeLabel {
            fill: #1f2937 !important;
            color: #1f2937 !important;
        }

svg {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* For SVG elements within containers */
.svg-container {
  display: flex;
  justify-content: center;
  align-items: center;
}
table {
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse; /* Optional: removes double borders */
}

/* For responsive tables that might need a container */
.table-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ===== SITE NAV ===== */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  background: rgb(30, 64, 175);
  border-radius: 6px;
}
.site-nav .nav-left { display: flex; gap: 1.2rem; }
.site-nav a {
  color: #e0e7ff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.site-nav a:hover { color: #fff; text-decoration: underline; }
.theme-toggle {
  background: none;
  border: 2px solid #e0e7ff;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: rgba(255,255,255,0.15); }

/* ===== PREV / NEXT NAV ===== */
.prev-next-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  margin: 1.5rem 1rem 0.5rem;
  border-top: 2px solid rgb(226, 232, 240);
}
.prev-next-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.prev-next-nav .nav-prev { text-align: left; }
.prev-next-nav .nav-next { text-align: right; }
.prev-next-nav .nav-home { font-size: 0.85rem; }

/* ===== DARK MODE ===== */
[data-theme="dark"] body {
  background-color: #0f172a;
  color: #cbd5e1;
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  background-color: #1e3a5f;
  color: #e2e8f0;
}
[data-theme="dark"] strong { color: #f1f5f9; }
[data-theme="dark"] a { color: #60a5fa; }
[data-theme="dark"] h3 a { color: #e2e8f0; }
[data-theme="dark"] code, [data-theme="dark"] pre {
  background-color: #1e293b;
  color: #4ade80;
}
[data-theme="dark"] table, [data-theme="dark"] td,
[data-theme="dark"] tr, [data-theme="dark"] th {
  border-color: #475569;
  color: #cbd5e1;
}
[data-theme="dark"] th { background-color: #1e3a5f; color: #e2e8f0; }
[data-theme="dark"] blockquote {
  background-color: #1e293b;
  color: #cbd5e1;
}
[data-theme="dark"] .mermaid_container,
[data-theme="dark"] .mermaid-diagram,
[data-theme="dark"] .mermaid {
  background-color: #1e293b;
  border-color: #475569;
}
[data-theme="dark"] .site-nav { background: #1e293b; }
[data-theme="dark"] .prev-next-nav { border-top-color: #334155; }
[data-theme="dark"] img { background-color: #1e293b; }

/* Inline SVG dark mode overrides */
[data-theme="dark"] .inline-svg text { fill: #cbd5e1; }
[data-theme="dark"] .inline-svg text[fill="white"] { fill: white; }
[data-theme="dark"] .inline-svg text[fill="#fff"] { fill: #fff; }
/* Neutral structural strokes/fills */
[data-theme="dark"] .inline-svg [stroke="#333"] { stroke: #94a3b8; }
[data-theme="dark"] .inline-svg [fill="#333"] { fill: #94a3b8; }
[data-theme="dark"] .inline-svg [stroke="#666"] { stroke: #64748b; }
[data-theme="dark"] .inline-svg [fill="#666"] { fill: #475569; }
[data-theme="dark"] .inline-svg [stroke="#ccc"] { stroke: #334155; }
[data-theme="dark"] .inline-svg [stroke="#ddd"] { stroke: #475569; }
/* Brown text in character examples */
[data-theme="dark"] .inline-svg text[fill="#654321"] { fill: #d4a574; }
[data-theme="dark"] .inline-svg text[fill="#8B4513"] { fill: #dba67a; }
/* Silver armor fill stays legible */
[data-theme="dark"] .inline-svg [fill="#C0C0C0"] { fill: #9ca3af; }
/* Skin tone circle */
[data-theme="dark"] .inline-svg [fill="#DDBEA9"] { fill: #c4a088; }
/* Brown body fill */
[data-theme="dark"] .inline-svg [fill="#8B4513"] { fill: #6d3810; }
[data-theme="dark"] .inline-svg [stroke="#654321"] { stroke: #8b6f4f; }

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
  body {
    margin-left: 10px;
    margin-right: 10px;
  }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; margin-left: 5px; margin-right: 5px; }
  h3 { font-size: 1.05rem; margin-left: 10px; margin-right: 10px; }
  h4 { margin-left: 10px; margin-right: 10px; }
  p { margin-left: 10px; margin-right: 10px; }
  dl, ol, ul, li { margin-left: 20px; }
  table { font-size: 0.85em; }
  code, pre { margin-left: 10px; margin-right: 10px; font-size: 0.9em; }
  blockquote { margin-left: 15px; margin-right: 15px; }

  /* Nav bar: stack on small screens */
  .site-nav {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
  }
  .site-nav .nav-left {
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.82rem;
  }
  .site-nav a { font-size: 0.82rem; }

  /* Prev/Next nav */
  .prev-next-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0.5rem 0.5rem;
    padding: 0.6rem 0.5rem;
  }
  .prev-next-nav a { font-size: 0.85rem; }

  /* Mermaid diagrams */
  .mermaid_container, .mermaid-diagram, .mermaid {
    max-width: 100%;
    padding: 10px;
    overflow-x: auto;
  }

  /* SVGs and images */
  svg { max-width: 100%; height: auto; }
  div img { width: 90%; }

  /* Canvas charts */
  canvas { max-width: 100%; height: auto; }
}

@media (max-width: 480px) {
  body { margin-left: 5px; margin-right: 5px; }
  h1 { font-size: 1.3rem; padding: 0.6rem; }
  h2 { font-size: 1.1rem; padding: 0.6rem; }
  h3 { font-size: 1rem; padding: 0.5rem; }
  .site-nav .nav-left { gap: 0.4rem; }
  .prev-next-nav a { font-size: 0.8rem; }
}
