:root {
  --bg-size: 50px;
  --bg-color-light: #e5e5e5;
  --bg-color-dark: #0e160c;
  --txt-color-light: #4d4d4d;
  --txt-color-dark: #a3a8a2;
  --txt-color-annotation-dark: #535e52fa;
  --accent-color: #2ca7ad;
  --accent-color-dark: #2ca7ad;
  --accent-color-light: #751a42;
  --border-color: #3f493d;
  --border-color-light: #3f493d2e;
  --title-color: #3f493d;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #e5e5e5;
    --txt-color: #4d4d4d;
    --txt-color-annotation: #535e52fa;
    --accent-color: #751a42;
    --border-color: #3f493d2e;
    --title-color: #4D4D4;
    --border-width: 1px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0e160c;
    --txt-color: #a3a8a2;
    --txt-color-annotation: #535e52fa;
    --accent-color: #2ca7ad;
    --border-color: #3f493d;
    --title-color: #3f493d;
    --border-width: 0.5px;
  }
}

/*
 * _layouts/default
 */

html {
  scroll-behavior: smooth;
}

b,
p,
em > p,
em {
  transition: color 0.15s ease-in;
}
.LIGHT a {
  text-decoration: none;
  color: var(--txt-color-light);
  border-bottom: 1px dashed var(--txt-color-light);
}
.DARK a {
  text-decoration: none;
  color: var(--txt-color-dark);
  border-bottom: 1px dashed var(--txt-color-dark);
}

.link {
  color: var(--txt-color-light);
  border-bottom: 1px dashed var(--txt-color-light);
}

.button {
  color: var(--txt-color-light);
  border: 1px dashed var(--txt-color-light);
  border-spacing: 5px;
}

body {
  background-size: var(--bg-size);
  color: #f4f4f4 /* near-white */;
  height: 100%;
}

body.animate-bg {
  animation: bg-slide 640ms linear;
}

body.animate-bg-infinite {
  animation: bg-slide 750ms ease infinite;
}

/* DARK MODE */
body.LIGHT {
  background-image: url(https://surulere.dev/assets/img/suruleredotdev_background.svg);
  background-color: var(--bg-color-light);
}

body.DARK {
  background-image: url(https://surulere.dev/assets/img/suruleredotdev_green_bg_faint.svg);
  background-color: var(--bg-color-dark);
}

#titlebar {
  background-image: url(https://surulere.dev/assets/img/suruleredotdev_background.svg);
  background-color: var(--bg-color-light);
}

@-webkit-keyframes bg-slide {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 0;
  }
}

/* FADE-IN ANIMATIONS */
@-webkit-keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

#footer {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  margin-top: var(--bg-size);
  width: 100%;
  text-align: left;
  background-color: transparent;
  font-size: 10px;
}

@media screen and (max-width: 400px) {
  #footer {
    position: relative;
    font-size: 10px;
  }
}

.LIGHT #footer {
  color: var(--txt-color-light);
}

.DARK #footer {
  color: var(--txt-color-dark);
}

.hide {
  display: none;
}

#share-block:hover > .hide,
#share-block:active > .hide {
  display: block;
}

#settings-block:hover > .hide,
#share-block:active > .hide {
  display: block;
}

.list-item {
  padding-left: 16px;
}

.list-item:before {
  content: "–";
  padding-right: 8px;
}

.b-color {
  border-color: var(--border-color);
}

.horizontal-scroll-shadow {
  background-image:
    linear-gradient(to right, transparent, transparent),
    linear-gradient(to right, transparent, transparent),
    linear-gradient(to right, rgba(0, 0, 20, 0.1), rgba(255, 255, 255, 0)),
    linear-gradient(to left, rgba(0, 0, 20, 0.1), rgba(255, 255, 255, 0));
  /* Shadows */
  /* Shadow covers */
  background-position:
    left center,
    right center,
    left center,
    right center;
  background-repeat: no-repeat;
  background-color: transparent;
  background-size:
    10px 100%,
    10px 100%,
    10px 100%,
    10px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* Add button styles */
button {
  padding: 8px 12px;
  margin: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:disabled {
  cursor: not-allowed;
}

/* Responsive layout for toolbar sections */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
}

.toolbar > div {
  flex: 1;
  min-width: 150px;
  margin: 4px;
}

.toolbar input[type="file"] {
  display: none;
}

.toolbar label {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--txt-color);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toolbar label:hover {
  background-color: var(--accent-color-light);
}

/* Ensure the sidebar and other sections are responsive */
#sidebar,
#visited-nodes,
#commentary-section {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #sidebar,
  #visited-nodes,
  #commentary-section {
    width: 100%;
    height: auto;
    position: relative;
    border: none;
  }
}
