@import url("pygment_highlights.css");

/* --- Font Variables --- */
:root {
  --font-primary: 'Lora', 'Times New Roman', serif;
  --font-secondary: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-monospace: 'Courier New', Monaco, 'Lucida Console', monospace;
  --font-size-base: 18px;
  --font-size-small: 14px;
  --font-size-large: 20px;
  --line-height-base: 1.5;
  --line-height-headings: 1.2;
}

/* --- General --- */

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: #404040;
  position: relative;
  background: #FFF;
  
  
}
p {
  line-height: 1.5;
  margin: 30px 0;
}
p a {
  /* text-decoration: underline */
  color: #008AFF;
}
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-secondary);
  font-weight: 800;
  line-height: var(--line-height-headings);
  margin-top: 2em;
  margin-bottom: 1em;
}
a {
  color: #008AFF;
}
a:hover,
a:focus {
  color: #0085a1;
}
blockquote {
  color: #808080;
  font-style: italic;
}
blockquote p:first-child {
  margin-top: 0;
}
hr.small {
  max-width: 100px;
  margin: 15px auto;
  border-width: 4px;
  border-color: inherit;
  border-radius: 3px;
}

.main-content {
  padding-top: 80px;
}
@media only screen and (min-width: 768px) {
  .main-content {
    padding-top: 130px;
  }
}

.main-explain-area {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  padding: 15px inherit;
}

.hideme {
  display: none;
}

::-moz-selection {
  color: white;
  text-shadow: none;
  background: #0085a1;
}
::selection {
  color: white;
  text-shadow: none;
  background: #0085a1;
}
img::selection {
  color: white;
  background: transparent;
}
img::-moz-selection {
  color: white;
  background: transparent;
}

img {
  max-width: 100%;
}

.disqus-comments {
  margin-top: 30px;
}

@media only screen and (min-width: 768px) {
  .disqus-comments {
    margin-top: 40px;
  }
}

/* --- Navbar --- */

.navbar-custom {
  background: #F5F5F5;
  border-bottom: 1px solid #EAEAEA;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  
  
}

.navbar-custom .nav li a {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

.navbar-custom .navbar-brand,
.navbar-custom .nav li a {
  font-weight: 800;
  color: #404040;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus ,
.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
  color: #0085a1;
}

.navbar-custom .navbar-brand-logo {
  padding-top: 0;
  -webkit-transition: padding .5s ease-in-out;
  -moz-transition: padding .5s ease-in-out;
  transition: padding .5s ease-in-out;
}
.navbar-custom .navbar-brand-logo img {
  height: 50px;
  -webkit-transition: height .5s ease-in-out;
  -moz-transition: height .5s ease-in-out;
  transition: height .5s ease-in-out;
}
.navbar-custom.top-nav-short .navbar-brand-logo {
  padding-top: 5px;
}
.navbar-custom.top-nav-short .navbar-brand-logo img {
  height: 40px;
}

@media only screen and (min-width: 768px) {
  .navbar-custom {
    padding: 20px 0;
    -webkit-transition: background .5s ease-in-out,padding .5s ease-in-out;
    -moz-transition: background .5s ease-in-out,padding .5s ease-in-out;
    transition: background .5s ease-in-out,padding .5s ease-in-out;
  }

  .navbar-custom.top-nav-short {
    padding: 0;
  }
}

.navbar-custom .avatar-container {
  opacity: 1;
  position: absolute;
  -webkit-transition: opacity 0.5s ease-in-out;
  -moz-transition: opacity 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out;
  left: 50%;
  width: 50px;
  margin-top: -25px;
}
.navbar-custom .avatar-container  .avatar-img-border {
  width: 100%;
  border-radius: 50%;
  margin-left: -50%;
  display: inline-block;
  box-shadow: 0 0 8px rgba(0, 0, 0, .8);
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .8);
  -moz-box-shadow: 0 0 8px rgba(0, 0, 0, .8);
}
.navbar-custom .avatar-container  .avatar-img {
  width: 100%;
  border-radius: 50%;
  display: block;
}

.navbar-custom.top-nav-short .avatar-container{
  opacity: 0;
}

.navbar-custom.top-nav-expanded .avatar-container  {
  display: none;
}

@media only screen and (min-width: 768px) {
  .navbar-custom .avatar-container {
    width: 100px;
    margin-top: -50px;
  }

  .navbar-custom .avatar-container  .avatar-img-border {
    width: 100%;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
    -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
    -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, .8);
  }

  .navbar-custom .avatar-container  .avatar-img {
    width: 100%;
  }
}

/* Multi-level navigation links */
.navbar-custom .nav .navlinks-container {
  position: relative;
}
.navbar-custom .nav .navlinks-parent:after {
  content: " \25BC";
}
.navbar-custom .nav .navlinks-children {
  width: 100%;
  display: none;
  word-break: break-word;
}
.navbar-custom .nav .navlinks-container .navlinks-children a {
  display: block;
  padding: 10px;
  padding-left: 30px;
  background: #f5f5f5;
  text-decoration: none !important;
  border-width: 0 1px 1px 1px;
  font-weight: normal;
}
@media only screen and (max-width: 767px) {
  .navbar-custom .nav .navlinks-container.show-children {
    background: #eee;
  }
  .navbar-custom .nav .navlinks-container.show-children .navlinks-children {
    display: block;
  }
}
@media only screen and (min-width: 768px) {
  .navbar-custom .nav .navlinks-container {
    text-align: center;
  }
  .navbar-custom .nav .navlinks-container:hover {
    background: #eee;
  }
  .navbar-custom .nav .navlinks-container:hover .navlinks-children {
    display: block;
  }
  .navbar-custom .nav .navlinks-children {
    position: absolute;
  }
  .navbar-custom .nav .navlinks-container .navlinks-children a {
    padding-left: 10px;
    border: 1px solid #eaeaea;
    border-width: 0 1px 1px;
  }
}

/* --- Footer --- */

footer {
  padding: 40px 0;
  background: #fafafa;
  border-top: 1px solid #e9ecef;
  margin-top: 50px;
  font-family: var(--font-secondary);
  font-size: var(--font-size-small);
  color: #666;
  
  
}

footer a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #008AFF;
  text-decoration: none;
}

footer .list-inline {
  margin: 0 0 20px 0;
  padding: 0;
}

footer .footer-links li {
  margin: 0 10px;
}

footer .footer-links .fa-stack {
  transition: transform 0.2s ease;
}

footer .footer-links .fa-stack:hover {
  transform: translateY(-2px);
}

footer .footer-links .fa-circle {
  color: #e9ecef;
  transition: color 0.2s ease;
}

footer .footer-links .fa-stack:hover .fa-circle {
  color: #008AFF;
}

footer .copyright {
  font-family: var(--font-secondary);
  text-align: center;
  margin-bottom: 10px;
  color: #777;
  font-size: 13px;
}

footer .theme-by {
  text-align: center;
  margin: 5px 0;
  font-size: 12px;
  color: #999;
}

footer .page-modified {
  text-align: center;
  margin: 10px 0 0 0;
  font-size: 11px;
  color: #bbb;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
  width: 100%;
}

footer .page-modified i {
  margin-right: 5px;
  color: #008AFF;
}

@media only screen and (min-width: 768px) {
  footer {
    padding: 60px 0;
  }
  footer .footer-links {
    font-size: 18px;
  }
  footer .copyright {
    font-size: 14px;
  }
  footer .theme-by {
    font-size: 13px;
  }
}

/* Dark mode footer styles */
html.dark-mode footer {
  background: #2d2d2d;
  border-top-color: #555;
  color: #aaa;
}

html.dark-mode footer a {
  color: #aaa;
}

html.dark-mode footer a:hover {
  color: #008AFF;
}

html.dark-mode footer .footer-links .fa-circle {
  color: #555;
}

html.dark-mode footer .page-modified {
  color: #777;
  border-top-color: #444;
}

html.dark-mode footer .page-modified i {
  color: #008AFF;
}

/* --- Post preview --- */

.post-preview {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

@media only screen and (min-width: 768px) {
  .post-preview {
    padding: 35px 0;
  }
}

.post-preview:last-child {
  border-bottom: 0;
}

.post-preview a {
  text-decoration: none;
  color: #404040;
}

.post-preview a:focus,
.post-preview a:hover {
  text-decoration: none;
  color: #0085a1;
}

.post-preview .post-title {
  font-size: 30px;
  margin-top: 0;
}
.post-preview .post-subtitle {
  margin: 0;
  font-weight: 300;
  margin-bottom: 10px;
}
.post-preview .post-meta,
.post-heading .post-meta {
  color: #808080;
  font-size: 18px;
  font-style: italic;
  margin: 0 0 10px;
}
.post-preview .post-entry {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.post-entry-container {
  display: inline-block;
  width: 100%;
}
.post-entry {
  width: 100%;
}
.post-image {
  float: right;
  height: 192px;
  width: 192px;
  margin-top: -35px;
  filter: grayscale(90%);
}
.post-image:hover {
  filter: grayscale(0%);
}
.post-image img {
  border-radius: 100px;
  height: 192px;
  width: 192px;
}
.post-preview .post-read-more {
  font-weight: 800;
}

@media only screen and (min-width: 768px) {
  .post-preview .post-title {
    font-size: 36px;
  }
}

/* --- Enhanced Post Navigation --- */

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 40px 0 60px 0;
  gap: 20px;
}

.nav-previous,
.nav-next {
  flex: 1;
  max-width: 48%;
}

.nav-previous {
  text-align: left;
}

.nav-next {
  text-align: right;
}

.nav-link {
  display: block;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  color: #495057;
}

.nav-link:hover {
  background: #e9ecef;
  border-color: #008AFF;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 138, 255, 0.15);
}

.nav-direction {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #008AFF;
  margin-bottom: 8px;
  font-family: var(--font-secondary);
}

.nav-previous .nav-direction {
  justify-content: flex-start;
}

.nav-next .nav-direction {
  justify-content: flex-end;
}

.nav-direction i {
  margin: 0 6px;
}

.nav-title {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #495057;
  font-family: var(--font-primary);
}

.nav-link:hover .nav-title {
  color: #212529;
}

/* Dark mode navigation */
html.dark-mode .nav-link {
  background: #3a3a3a;
  border-color: #555;
  color: #ddd;
}

html.dark-mode .nav-link:hover {
  background: #4a4a4a;
  border-color: #008AFF;
}

html.dark-mode .nav-title {
  color: #ddd;
}

html.dark-mode .nav-link:hover .nav-title {
  color: #fff;
}

/* Mobile responsive navigation */
@media (max-width: 767px) {
  .post-navigation {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-previous,
  .nav-next {
    max-width: 100%;
    text-align: center;
  }
  
  .nav-direction {
    justify-content: center !important;
  }
}

/* --- Tags --- */

.blog-tags {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #999;
  font-size: 15px;
  margin-bottom: 30px;
}

.blog-tags a {
  color: #008AFF;
  text-decoration: none;
  padding: 0px 5px;
}

.blog-tags a:hover {
  border-radius: 2px;
  color: #008AFF;
  background-color: #CCC;
}

.post-preview .blog-tags {
  margin-top: 5px;
  margin-bottom: 0;
}

@media only screen and (min-width: 768px) {
  .post-preview .blog-tags {
    margin-top: 10px;
  }
}

@media only screen and (max-width: 500px) {
  .post-image, .post-image img {
    height: 100px;
    width: 100px;
  }

  .post-image {
    width: 100%;
    text-align: center;
    margin-top: 0;
    float: left;
  }
}
/* --- Post and page headers --- */

.intro-header {
  margin: 80px 0 20px;
  position: relative;
}
.intro-header.big-img {
  background: no-repeat center center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;
  margin-top: 51px; /* The small navbar is 50px tall + 1px border */
  margin-bottom: 35px;
}
.intro-header.big-img  .big-img-transition {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: no-repeat center center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;
  -webkit-transition: opacity 1s linear;
  -moz-transition: opacity 1s linear;
  transition: opacity 1s linear;
}
.intro-header .page-heading {
  text-align: center;
}
.intro-header.big-img .page-heading,
.intro-header.big-img .post-heading {
  padding: 100px 0;
  color: #FFF;
  text-shadow: 1px 1px 3px #000;
}
.intro-header .page-heading h1 {
  margin-top: 0;
  font-size: 50px;
}
.intro-header .post-heading h1 {
  margin-top: 0;
  font-size: 35px;
}
.intro-header .page-heading .page-subheading,
.intro-header .post-heading .post-subheading {
  font-size: 27px;
  line-height: 1.1;
  display: block;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  margin: 10px 0 0;
}
.intro-header .post-heading .post-subheading {
  margin-bottom: 20px;
}
.intro-header.big-img .page-heading .page-subheading,
.intro-header.big-img .post-heading .post-subheading {
  font-weight: 400;
}
.intro-header.big-img .page-heading hr {
  box-shadow: 1px 1px 3px #000;
  -webkit-box-shadow: 1px 1px 3px #000;
  -moz-box-shadow: 1px 1px 3px #000;
}
.intro-header.big-img .post-heading .post-meta {
  color: #EEE;
}
.intro-header.big-img .img-desc {
  background: rgba(30, 30, 30, 0.6);
  position: absolute;
  padding: 5px 10px;
  font-size: 11px;
  color: #EEE;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  right: 0;
  bottom: 0;
  display: none;
}
@media only screen and (min-width: 768px) {
  .intro-header {
    margin-top: 130px;
  }
  .intro-header.big-img {
    margin-top: 91px;  /* Full navbar is small navbar + 20px padding on each side when expanded */
  }
  .intro-header.big-img .page-heading,
  .intro-header.big-img .post-heading  {
    padding: 150px 0;
  }
  .intro-header .page-heading h1 {
    font-size: 80px;
  }
  .intro-header .post-heading h1 {
    font-size: 50px;
  }
  .intro-header.big-img .img-desc {
    font-size: 14px;
  }
}

.header-section.has-img .no-img {
  margin-top: 0;
  background: #FCFCFC;
  margin: 0 0 40px;
  padding: 20px 0;
  box-shadow: 0 0 5px #AAA;
}
/* Many phones are 320 or 360px, so make sure images are a proper aspect ratio in those cases */
.header-section.has-img .intro-header.no-img {
  display: none;
}
@media only screen and (max-width: 365px) {
  .header-section.has-img .intro-header.no-img {
    display: block;
  }
  .intro-header.big-img {
    width: 100%;
    height: 220px;
  }
  .intro-header.big-img .page-heading,
  .intro-header.big-img .post-heading {
    display: none;
  }
  .header-section.has-img .big-img {
    margin-bottom: 0;
  }
}
@media only screen and (max-width: 325px) {
  .intro-header.big-img {
    height: 200px;
  }
}

.caption {
  text-align: center;
  font-size: 14px;
  padding: 10px;
  font-style: italic;
  margin: 0;
  display: block;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
}

#header-gh-btns {
  margin-bottom: 15px;
}
@media only screen and (max-width: 500px) {
  #header-gh-btns > iframe {
    display: block;
    margin-bottom: 5px;
  }
}

/* --- Pager --- */

.pager li a {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 10px 5px;
  background: #FFF;
  border-radius: 0;
  color: #404040;
}
@media only screen and (min-width: 768px) {
  .pager li a {
    padding: 15px 25px;
  }
}
.pager li a:hover,
.pager li a:focus {
  color: #FFF;
  background: #0085a1;
  border: 1px solid #0085a1;
}

.pager {
  margin: 10px 0 0;
}

.pager.blog-pager {
  margin-top: 0;
}

@media only screen and (min-width: 768px) {
  .pager.blog-pager  {
    margin-top: 10px;
  }
}

/* --- Tables --- */

table {
  padding: 0;
}
table tr {
  border-top: 1px solid #cccccc;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}
table tr:nth-child(2n) {
  background-color: #f8f8f8;
}
table tr th {
  font-weight: bold;
  border: 1px solid #cccccc;
  text-align: left;
  margin: 0;
  padding: 6px 13px;
}
table tr td {
  border: 1px solid #cccccc;
  text-align: left;
  margin: 0;
  padding: 6px 13px;
}
table tr th :first-child,
table tr td :first-child {
  margin-top: 0;
}
table tr th :last-child,
table tr td :last-child {
  margin-bottom: 0;
}

/* --- Code blocks --- */

pre {
  font-size: 16px;
  line-height: 1.5em;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  margin-top: 40px;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
}
pre code {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
pre.highlight, .highlight > pre, td.code pre {
  background: #FAFAFA;
  background-image: linear-gradient(#F9F9F9 50%, #FDFDFD 50%);
  background-repeat: repeat;
  background-size: 3em 3em;
  background-position: 0px 10px;
  border-left: 7px solid #444;
  margin-top: 40px;
}
code table, code table td, code table th, code table tbody, code table tr,
td.gutter pre {
  padding: 0;
  border: none;
  background-color: #fff;
}
.highlight > pre {
  padding: 0;
}
td.code pre {
  border-width: 0 0 0 2px;
  border-style: solid;
  border-color: #444;
  border-radius: 0;
}
td.gutter {
  padding-top: 3px;
}

/* --- Copy Code Button --- */

.code-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: -40px;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  z-index: 10;
  height: 40px;
  background: #0d1117 !important;
  background-image: linear-gradient(#161b22 50%, #0d1117 50%) !important;
  border-left: 7px solid #58a6ff !important;
  border-top: 1px solid #30363d !important;
  border-bottom: 1px solid #30363d !important;
  padding-right: 12px;
  padding-left: 12px;
  padding-top: 0;
  padding-bottom: 0;
}

.copy-code-button {
  position: relative;
  background: #21262d !important;
  border: 1px solid #30363d !important;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  color: #c9d1d9 !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  white-space: nowrap;
}

.copy-code-button:hover {
  background: #30363d !important;
  border-color: #58a6ff !important;
  box-shadow: 0 2px 4px rgba(88, 166, 255, 0.2) !important;
}

.copy-code-button:active {
  background: #161b22 !important;
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

.copy-code-button.copied {
  background: #2da44e;
  border-color: #2da44e;
  color: white;
}

.copy-code-button svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.copy-code-button.copied svg {
  opacity: 1;
}

.copy-label {
  font-weight: 500;
  line-height: 1;
}

/* Ensure code blocks have relative positioning for the button */
.code-header + .highlighter-rouge,
.code-header + .highlight {
  position: relative;
}

/* --- Social media sharing section --- */

#social-share-section {
  margin-bottom: 30px;
}

/* --- Notification boxes --- */
.box-note, .box-warning, .box-error {
  padding: 15px 15px 15px 10px;
  margin: 20px 20px 20px 5px;
  border: 1px solid #eee;
  border-left-width: 5px;
  border-radius: 5px 3px 3px 5px;
}

.box-note {
  background-color: #eee;
  border-left-color: #2980b9;
}

.box-warning {
  background-color: #fdf5d4;
  border-left-color: #f1c40f;
}

.box-error {
  background-color: #f4dddb;
  border-left-color: #c0392b;
}

/* Fix table border github gist snippets */

.gist, .gist-file table tr {
  border: unset;
}

.gist, .gist-file table tr td {
  border: unset;
}

.figcenter {
  text-align: center;
}
.fig img {
  max-width: 98%;
}
.figleft img {
  max-width: 50%;
  float: left;
  margin-right: 20px;
}
.figleft svg {
  float: left;
  margin-right: 20px;
}
.fighighlight {

  padding: 20px 4px 20px 4px;
  border-bottom: 1px solid #999;
  border-top: 1px solid #999;

}
.figcaption {
  font-weight: 400;
  font-size: 14px;
  color: #575651;
  text-align: justify;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  body {
    background: #0d1117 !important;
    color: #e6edf3 !important;
  }
  a, a:visited {
    color: #58a6ff;
  }
  a:hover, a:focus {
    color: #79c0ff;
  }
  .navbar-custom {
    background: #161b22 !important;
    border-bottom: 1px solid #30363d !important;
  }
  .main-content, .main-explain-area {
    background: transparent !important;
    color: #e6edf3 !important;
  }
  pre, code, .highlighter-rouge, .highlight {
    background: #161b22 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }
  pre.highlight, .highlight > pre, td.code pre {
    background: #0d1117 !important;
    background-image: linear-gradient(#161b22 50%, #0d1117 50%) !important;
    border-left: 7px solid #58a6ff !important;
  }
  blockquote {
    color: #8b949e !important;
    border-left: 4px solid #30363d !important;
    padding-left: 16px !important;
  }
  table {
    border-color: #30363d !important;
    color: inherit !important;
  }
  table tr {
    background-color: transparent !important;
    border-color: #30363d !important;
  }
  table tr:nth-child(2n) {
    background-color: rgba(177, 186, 196, 0.12) !important;
  }
  table th, table td {
    border-color: #30363d !important;
    background-color: transparent !important;
    color: inherit !important;
  }
  table th {
    background-color: rgba(177, 186, 196, 0.12) !important;
    font-weight: 600 !important;
  }
  .copy-code-button {
    background: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  }
  .copy-code-button:hover {
    background: #30363d !important;
    border-color: #484f58 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7) !important;
  }
  .copy-code-button:active {
    background: #161b22 !important;
    border-color: #30363d !important;
  }
  .copy-code-button.copied {
    background: #238636 !important;
    border-color: #2ea043 !important;
    color: #ffffff !important;
  }
  .copy-code-button svg {
    opacity: 0.9 !important;
  }
  .copy-code-button.copied svg {
    opacity: 1 !important;
  }
  .box-note {
    background-color: #23272a !important;
    border-left-color: #2980b9 !important;
  }
  .box-warning {
    background-color: #2d2a1b !important;
    border-left-color: #f1c40f !important;
  }
  .box-error {
    background-color: #3a2321 !important;
    border-left-color: #c0392b !important;
  }
}

html.dark-mode body {
  background: #0d1117 !important;
  color: #e6edf3 !important;
}
html.dark-mode a, html.dark-mode a:visited {
  color: #58a6ff;
}
html.dark-mode a:hover, html.dark-mode a:focus {
  color: #79c0ff;
}
html.dark-mode .navbar-custom {
  background: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
}
html.dark-mode .main-content, html.dark-mode .main-explain-area {
  background: transparent !important;
  color: #e6edf3 !important;
}
html.dark-mode pre, html.dark-mode code, html.dark-mode .highlighter-rouge, html.dark-mode .highlight {
  background: #161b22 !important;
  color: #e6edf3 !important;
  border-color: #30363d !important;
}
html.dark-mode pre.highlight, html.dark-mode .highlight > pre, html.dark-mode td.code pre {
  background: #0d1117 !important;
  background-image: linear-gradient(#161b22 50%, #0d1117 50%) !important;
  border-left: 7px solid #58a6ff !important;
}
html.dark-mode blockquote {
  color: #8b949e !important;
  border-left: 4px solid #30363d !important;
  padding-left: 16px !important;
}
html.dark-mode table {
  border-color: #30363d !important;
  color: inherit !important;
}
html.dark-mode table tr {
  background-color: transparent !important;
  border-color: #30363d !important;
}
html.dark-mode table tr:nth-child(2n) {
  background-color: rgba(177, 186, 196, 0.12) !important;
}
html.dark-mode table th, html.dark-mode table td {
  border-color: #30363d !important;
  background-color: transparent !important;
  color: inherit !important;
}
html.dark-mode table th {
  background-color: rgba(177, 186, 196, 0.12) !important;
  font-weight: 600 !important;
}
html.dark-mode .copy-code-button {
  background: #21262d !important;
  border-color: #30363d !important;
  color: #e6edf3 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}
html.dark-mode .copy-code-button:hover {
  background: #30363d !important;
  border-color: #484f58 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7) !important;
}
html.dark-mode .copy-code-button:active {
  background: #161b22 !important;
  border-color: #30363d !important;
}
html.dark-mode .copy-code-button.copied {
  background: #238636 !important;
  border-color: #2ea043 !important;
  color: #ffffff !important;
}
html.dark-mode .copy-code-button svg {
  opacity: 0.9 !important;
}
html.dark-mode .copy-code-button.copied svg {
  opacity: 1 !important;
}
html.dark-mode .box-note {
  background-color: #23272a !important;
  border-left-color: #2980b9 !important;
}
html.dark-mode .box-warning {
  background-color: #2d2a1b !important;
  border-left-color: #f1c40f !important;
}
html.dark-mode .box-error {
  background-color: #3a2321 !important;
  border-left-color: #c0392b !important;
}

html.dark-mode img, html.dark-mode .fig img, html.dark-mode .figleft img {
  filter: brightness(0.85) contrast(1.1);
}

/* --- Search functionality --- */
.search-container {
  position: relative;
  margin-right: 15px;
}

.search-box {
  position: relative;
  display: inline-block;
}

#search-input {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 35px 8px 15px;
  font-family: var(--font-secondary);
  font-size: var(--font-size-small);
  width: 200px;
  transition: all 0.3s ease;
  outline: none;
}

#search-input:focus {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #008AFF;
  width: 250px;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
}

.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 5px;
}

.search-result-item {
  border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-link {
  display: block;
  padding: 12px 15px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.search-result-link:hover {
  background-color: #f8f9fa;
  color: inherit;
  text-decoration: none;
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
}

.search-result-excerpt {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.search-no-results {
  padding: 15px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.search-results mark {
  background-color: #fff3cd;
  color: #856404;
  padding: 1px 2px;
  border-radius: 2px;
}

/* Dark mode styles for search */
html.dark-mode #search-input {
  background: rgba(40, 40, 40, 0.9);
  border-color: #555;
  color: #ddd;
}

html.dark-mode #search-input:focus {
  background: #2d2d2d;
  border-color: #008AFF;
}

html.dark-mode .search-icon {
  color: #ccc;
}

html.dark-mode .search-results {
  background: #2d2d2d;
  border-color: #555;
}

html.dark-mode .search-result-link:hover {
  background-color: #3a3a3a;
}

html.dark-mode .search-result-title {
  color: #ddd;
}

html.dark-mode .search-result-excerpt {
  color: #aaa;
}

html.dark-mode .search-no-results {
  color: #aaa;
}

html.dark-mode .search-results mark {
  background-color: #4a4a4a;
  color: #ffeb3b;
}

@media (max-width: 768px) {
  .search-container {
    width: 100%;
    margin: 10px 0;
  }
  
  #search-input {
    width: 100%;
  }
  
  #search-input:focus {
    width: 100%;
  }
}

/* --- Left Sidebar Navigation --- */
.sidebar-toggle {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  background: #008AFF;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1031;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: #0070dd;
  transform: translateY(-50%) scale(1.1);
}

.left-sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transition: left 0.3s ease;
  overflow-y: auto;
  font-family: var(--font-secondary) !important;
}

.left-sidebar.open {
  left: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h4 {
  margin: 0;
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.sidebar-close:hover {
  color: #333;
}

.sidebar-content {
  padding: 0;
  padding-top: 60px;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section h5 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-section h5 i {
  margin-right: 8px;
  color: #008AFF;
}

/* Sidebar Search Styles */
.sidebar-search {
  margin-bottom: 20px;
  margin-top: 0px;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font-secondary);
  background: #fff;
  color: #333;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
  /* Disable spell check and autocorrect */
  spellcheck: false;
  autocorrect: off;
  autocapitalize: none;
}

.sidebar-search input:focus {
  border-color: #008AFF;
  box-shadow: 0 0 0 2px rgba(0, 138, 255, 0.15), 0 2px 6px rgba(0,0,0,0.1);
}

.sidebar-search input:hover {
  border-color: #ccc;
}

.sidebar-search-results {
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 4px;
  display: none;
}

.sidebar-search-result {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sidebar-search-result:hover {
  background: #f8f9fa;
}

.sidebar-search-result:last-child {
  border-bottom: none;
}

.sidebar-search-result a {
  color: #333 !important;
  text-decoration: none !important;
  display: block;
  font-size: 12px;
  line-height: 1.4;
  font-family: var(--font-secondary);
}

.sidebar-search-result a:hover {
  color: #008AFF !important;
}

.sidebar-search-date {
  font-size: 10px;
  color: #999;
  margin-bottom: 2px;
}

.sidebar-search-no-results {
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 12px;
  font-style: italic;
}

/* Dark mode search styles */
html.dark-mode .sidebar-search input {
  background: #3a3a3a;
  border-color: #555;
  color: #ddd;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

html.dark-mode .sidebar-search input:focus {
  border-color: #008AFF;
  box-shadow: 0 0 0 2px rgba(0, 138, 255, 0.25), 0 2px 6px rgba(0,0,0,0.2);
}

html.dark-mode .sidebar-search input:hover {
  border-color: #777;
}

html.dark-mode .sidebar-search input::placeholder {
  color: #999;
}

html.dark-mode .sidebar-search-result {
  background: #4a4a4a;
  border-bottom-color: #666;
}

html.dark-mode .sidebar-search-result:hover {
  background: #555;
}

html.dark-mode .sidebar-search-result a {
  color: #ddd !important;
}

html.dark-mode .sidebar-search-result a:hover {
  color: #008AFF !important;
}

html.dark-mode .sidebar-search-no-results {
  color: #999;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-list li {
  margin-bottom: 8px;
}

.sidebar-list a {
  display: block;
  padding: 8px 12px;
  color: #666;
  text-decoration: none;
  border-radius: 4px;
  font-family: var(--font-secondary) !important;
  font-size: 14px;
  line-height: var(--line-height-base);
  transition: all 0.2s ease;
}

.sidebar-list * {
  font-family: var(--font-secondary) !important;
}

.sidebar-list a:hover {
  background: #f0f8ff;
  color: #008AFF;
  text-decoration: none;
}

.sidebar-list a i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.post-date {
  display: inline-block;
  background: #008AFF;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-right: 8px;
  font-weight: 600;
  font-family: var(--font-secondary);
}

.post-count {
  color: #999;
  font-size: 11px;
  font-family: var(--font-secondary);
}

/* Archive list styling */
.archive-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.archive-list .archive-link.expanded {
  background: #f0f8ff;
  color: #008AFF;
}

.month-posts {
  margin-top: 8px;
  margin-left: 15px;
  border-left: 2px solid #f0f0f0;
}

.month-post-link {
  display: block !important;
  padding: 6px 12px !important;
  color: #777 !important;
  font-family: var(--font-secondary) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  border-bottom: 1px solid #f8f8f8;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.month-post-link:hover {
  background: #f8f9fa !important;
  color: #008AFF !important;
}

.month-post-link .post-date {
  background: #e9ecef;
  color: #666;
  font-size: 9px;
  margin-right: 6px;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

/* Dark mode styles for sidebar */
html.dark-mode .left-sidebar {
  background: #2d2d2d;
  color: #ddd;
}

html.dark-mode .sidebar-header {
  background: #3a3a3a;
  border-bottom-color: #555;
}

html.dark-mode .sidebar-header h4 {
  color: #ddd;
}

html.dark-mode .sidebar-close {
  color: #aaa;
}

html.dark-mode .sidebar-close:hover {
  color: #ddd;
}

html.dark-mode .sidebar-section {
  border-bottom-color: #444;
}

html.dark-mode .sidebar-section h5 {
  color: #ddd;
}

html.dark-mode .sidebar-list a {
  color: #aaa;
}

html.dark-mode .sidebar-list a:hover {
  background: #3a3a3a;
  color: #008AFF;
}

html.dark-mode .post-count {
  color: #777;
}

html.dark-mode .archive-list .archive-link.expanded {
  background: #3a3a3a;
  color: #008AFF;
}

html.dark-mode .month-posts {
  border-left-color: #555;
}

html.dark-mode .month-post-link {
  color: #aaa !important;
  border-bottom-color: #444;
}

html.dark-mode .month-post-link:hover {
  background: #3a3a3a !important;
  color: #008AFF !important;
}

html.dark-mode .month-post-link .post-date {
  background: #555;
  color: #bbb;
}

@media (max-width: 768px) {
  .left-sidebar {
    width: 280px;
    left: -280px;
  }
  
  .sidebar-toggle {
    left: 15px;
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
}

/* --- Additional UX Enhancements --- */

/* Reading progress bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #008AFF, #00D4FF);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Scroll to top button */
#scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #008AFF;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

#scroll-to-top:hover {
  background: #0070dd;
  transform: scale(1.1);
  opacity: 1;
}

#scroll-to-top:active {
  transform: scale(0.95);
}

/* Lazy loading images */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.lazy.loaded {
  opacity: 1;
}

/* Enhanced focus styles for accessibility */
.search-box input:focus,
.sidebar-list a:focus,
button:focus {
  outline: 2px solid #008AFF;
  outline-offset: 2px;
}

/* Improved mobile responsiveness */
@media (max-width: 768px) {
  .main-content {
    padding-top: 100px;
  }
  
  /* Adjust sidebar for mobile */
  .sidebar-toggle {
    bottom: 30px;
    top: auto;
    transform: none;
  }
  
  /* Adjust scroll to top button */
  #scroll-to-top {
    bottom: 90px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  /* Better search on mobile */
  .search-container {
    order: -1;
    width: 100%;
    margin: 10px 0;
  }
  
  #search-input {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Improved typography and spacing */
.post-content {
  line-height: 1.7;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 2em;
  margin-bottom: 1em;
}

.post-content p {
  margin-bottom: 1.5em;
}

/* Code block improvements */
pre {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 1rem;
  margin: 1.5em 0;
  overflow-x: auto;
}

html.dark-mode pre {
  background: #2d2d2d;
  border-color: #555;
}

/* Enhanced table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9em;
}

table th,
table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

table th {
  background: #f8f9fa;
  font-weight: 600;
}

html.dark-mode table th {
  background: #3a3a3a;
}

html.dark-mode table th,
html.dark-mode table td {
  border-color: #555;
}

/* Notification/Toast system (for future use) */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.error {
  background: #dc3545;
}

.toast.warning {
  background: #ffc107;
  color: #212529;
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-radius: 50%;
  border-top: 2px solid #008AFF;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
  .left-sidebar,
  #scroll-to-top,
  #reading-progress,
  .sidebar-toggle,
  .navbar {
    display: none !important;
  }
  
  .main-content {
    padding-top: 0 !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* Keyboard shortcuts modal */
.shortcuts-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.shortcuts-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.shortcuts-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

.shortcuts-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.shortcuts-header h3 i {
  margin-right: 10px;
  color: #008AFF;
}

.shortcuts-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.shortcuts-close:hover {
  color: #333;
}

.shortcuts-body {
  padding: 20px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-item kbd {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #495057;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.shortcut-item span {
  color: #666;
  font-size: 14px;
}

/* Dark mode styles for shortcuts modal */
html.dark-mode .shortcuts-content {
  background: #2d2d2d;
  color: #ddd;
}

html.dark-mode .shortcuts-header {
  background: #3a3a3a;
  border-bottom-color: #555;
}

html.dark-mode .shortcuts-header h3 {
  color: #ddd;
}

html.dark-mode .shortcuts-close {
  color: #aaa;
}

html.dark-mode .shortcuts-close:hover {
  color: #ddd;
}

html.dark-mode .shortcut-item {
  border-bottom-color: #444;
}

html.dark-mode .shortcut-item kbd {
  background: #3a3a3a;
  border-color: #555;
  color: #ddd;
}

html.dark-mode .shortcut-item span {
  color: #aaa;
}
