/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');

:root {
    --base-fontsize: 1.0rem;
    --header-scale: 1.125;
    --line-height: 1.618;

    /* Dark Theme (Default) */
    --main-bg: #000;
    --text-color: #bfbfbf;
    --link-color: #9fc6e0;
    --header-color: #bfbfbf;
    --wikilink-color: deepskyblue;
    --wikilink-visited-color: deepskyblue;
    --wikilink-hover-color: hotpink;
    --accent-bg: #2B2B2B;
    --border: #666;
    --node-bg: #191919;
    --graph-bg: #222;
    --links-bg: #222;
    --subnode-bg: #303030;
    --subnode-text-color: #cfcfcf;
    --pulled-pushed-bg: #101010;
    --info-box-bg: #4a3b6a; /* A cool, violet color */
    --info-box-text-color: #cfcfcf;
    --intro-footer-bg: #2a3a59;
    --intro-footer-text-color: #cfcfcf;
    --button-bg: #2d2d2d;
    --button-text-color: #ddd;
    --button-border-color: #999;
    --logo-filter: invert(1);
    --tab-active-bg: #ffffff20;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --separator-border: #ddd;
    --blockquote-border: #bfbfbf;
    --agora-protocol-text: #ffffff80;
    --agora-protocol-bg: black;
    --dismiss-button-color: white;
}

[data-theme="light"] {
    --main-bg: #e9e9e9;
    --text-color: #000000;
    --link-color: #377ba8;
    --header-color: #377ba8;
    --wikilink-color: #1e53a6;
    --wikilink-visited-color: #1e53a6;
    --wikilink-hover-color: hotpink; /* Or something else */
    --accent-bg: #F5F7FF;
    --border: #D8DAE1;
    --node-bg: #f0f0f0;
    --graph-bg: #fdfdfd;
    --links-bg: #fdfdfd;
    --subnode-bg: #f8f8f8;
    --subnode-text-color: #000;
    --pulled-pushed-bg: #fdfdfd;
    --info-box-bg: #ffedb1;
    --info-box-text-color: #000;
    --intro-footer-bg: #ffe17e;
    --intro-footer-text-color: #000;
    --button-bg: #ddd;
    --button-text-color: #000;
    --button-border-color: #999;
    --logo-filter: none;
    --tab-active-bg: rgba(255, 255, 255, 1);
    --overlay-bg: rgba(238, 238, 238, 0.7);
    --separator-border: #222;
    --blockquote-border: #000; /* Or a shade of grey */
    --agora-protocol-text: #00000080;
    --agora-protocol-bg: #ffffff;
    --dismiss-button-color: black;
}


html {
    font-family: 'Noto Sans', sans-serif;
}

body {
    background: var(--main-bg);
    color: var(--text-color);
    width: 100%;
    font-size: var(--base-fontsize);
    margin: 0;
}

.content {
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    display: flex;
    justify-content: center;
    gap: 10px;
}


.async-content {
    max-width: 80em;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    display: flex;
    justify-content: center;
    border: 2px solid red !important;
}


pre {
    white-space: pre-line;
}

a {
    color: var(--link-color);
}

.navigation > a {
  display: flex;
}

.navigation > a > span {
    flex-grow: 1;
    flex-shrink: 0;
    padding: 2px;
}

nav {
    font-family: sans-serif;
    max-width: 100%;
    position: sticky;
    top: 0;
    z-index: 4;
    background-color: var(--main-bg);
    padding: 0.25em;
    padding-bottom: 0px;
}

.navbar-item {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: row;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    border: 1px solid var(--button-border-color);
    border-radius: 4px;
    background: var(--button-bg);
    color: var(--button-text-color);
    text-transform: capitalize;
    padding: 3px 6px 3px 6px;
    white-space: nowrap;
}

ul {
    line-height: 1.7em;
    padding-right: 0.34em;
    padding-left: 2em;
}

li {
    padding: 0.17em;
}

.subnode-content > ul {
    filter: brightness(100%);
    display: inline-block;
    padding-right: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.subnode-content > ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.subnode-content > ul {
    filter: brightness(100%);
    display: inline-block;
    padding-right: 1em;
    padding-top: 5px;
    padding-bottom: 2em;
    background-color: var(--agora-protocol-bg);
    position: relative;
    min-height: 2.5em;
    min-width: 10em;
}

.subnode-content > ul::after {
    content: '(Agora Protocol inferred.)';
    position: absolute;
    bottom: 5px;
    font-size: smaller;
    font-style: italic;
    color: var(--agora-protocol-text);
}

li img {
    vertical-align: top;
}

.iframe-container {
    display: flex;
    flex-direction: column;
}

.iframe-url-overlay {
    align-self: flex-end;
    margin-top: 5px;
    margin-right: 10px;
    position: relative;
    z-index: 1;
    font-size: smaller;
    font-style: italic;
    color: var(--agora-protocol-text);
    background-color: var(--agora-protocol-bg);
    padding: 2px 5px;
    border-radius: 3px;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.1));
}

iframe {
    margin-top: 2px;
    margin-bottom: 2px;
    border-color: gray;
    border-style: dashed;
    border-width: 1px;
    height: 53em;
    width: 99.5%;
}

.mastodon-embed > iframe {
    height: auto;
    width: auto;
}

details .mastodon, .twitter {
    display: inline;
    max-width: 100%;
    vertical-align: top;
}

details[open] > :not(summary) {
    animation: slide-down 0.3s ease;
}
  
@keyframes slide-down {
    from { 
      opacity: 0;
      transform: translateY(-10px);
    }
    to { 
      opacity: 1;
      transform: translateY(0);
    }
}

@media screen and (max-width: 60em) {
    iframe {
        max-height: 35em;
    }
}

.container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
}

.column {
    background-color: #f0f0f0;
    padding: 20px;
    border: 1px solid #ccc;
}

@media (min-width: 60em) {
    .container {
        flex-direction: row;
    }

    .column {
        flex: 1;
    }
}

.navigation .logo {
    vertical-align: middle;
    max-width: 32px;
    max-height: 32px;
    margin-bottom: 4px;
}

.logo {
    filter: var(--logo-filter);
}

.spinner-container {
    overflow: hidden;
    text-align: center;
    overflow-x: hidden;
}

.spinner {
    animation: heartbeat 1s infinite;
}

.spinner2 {
    transform: translateZ(1px);
    animation: flipping 10s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes heartbeat {
  0% { transform: scale(0.95); }
  5% { transform: scale(1.1); }
  39% { transform: scale(0.85); }
  45% { transform: scale(1); }
  60% { transform: scale(0.95); }
  100% { transform: scale(0.9); }
}

@keyframes flipping {
  0%, 100% { animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); }
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(1800deg); animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1); }
  100% { transform: rotateY(3600deg); }
}

.content {
    line-height: var(--line-height);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--header-color);
    line-height: 1.1;
}

h1 { font-size: calc(var(--base-fontsize) * var(--header-scale) * var(--header-scale) * var(--header-scale) * var(--header-scale) * var(--header-scale)); margin-block-start: 10px; }
h2 { font-size: calc(var(--base-fontsize) * var(--header-scale) * var(--header-scale) * var(--header-scale)); margin-top: calc(var(--line-height) * 0.8rem); }
h3 { font-size: calc(var(--base-fontsize) * var(--header-scale)); margin-top: calc(var(--line-height) * 0.8rem); }
h4 { font-size: calc(var(--base-fontsize)); margin-top: calc(var(--line-height) * 0.8rem); }
h5 { font-size: calc(var(--base-fontsize) / var(--header-scale)); margin-top: calc(var(--line-height) * 0.8rem); }
h6 { font-size: calc(var(--base-fontsize) / var(--header-scale) / var(--header-scale)); }

li > p {
    margin-block-start: 0;
    margin-block-end: 0;
}

.content blockquote {
    padding-left: 0.5em;
    margin-left: 1em;
    border-left: 2px solid var(--blockquote-border);
    font-style: italic;
}

summary::-webkit-scrollbar {
    display: none;
}

summary, #footer {
    gap: 5px;
    vertical-align: middle;
    align-items: center;
    overflow-x: scroll;
    white-space: nowrap;
    justify-content: space-between;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.navigation::-webkit-scrollbar {
    display: none;
}

.navigation {
    width: 100%;
    box-sizing: border-box;
    display: flex;
}

.navigation-content {
    display: flex;
    gap: 5px;
    align-items: center;
    white-space: nowrap;
    justify-content: space-between;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-grow: 1;
    min-width: 0;
}

.navigation-content::-webkit-scrollbar {
    display: none;
}

#join {
    margin-right: 0.5em;
}


.navigation, .intro {
    overflow-x: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
}

.webnav::-webkit-scrollbar {
    display: none;
}

.webnav{
    vertical-align: middle;
    align-items: center;
    overflow-x: scroll;
    white-space: nowrap;
    justify-content: space-between;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.topline-node {
    vertical-align: middle;
    overflow-y: auto;
}

.topline-node-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 4px;
}

.topline-cli {
    flex-grow: 1;
}

.action-bar {
    display: flex;
    align-items: center;
}

#scroll-toggle {
    margin-left: auto;
}

input[type="text"] {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

button, input {
    font-size: 0.9em;
}

.topline-agora {
    display: flex;
    justify-content: space-between;
    vertical-align: middle;
    overflow-y: auto;
    width: auto;
    margin-top: 10px;
    margin-right: 10px;
    margin-left: 10px;
}

.topline-query {
    flex: auto;
    display: inline;
    vertical-align: middle;
    margin-right: 4px;
}

.topline-cli {
    flex: auto;
    vertical-align: middle;
    width: 100%;
    margin-right: 4px;
}

#mini-cli {
    width: 100%;
    padding: 4px;
}

#scroll-toggle {
    height: 25px;
}

.cli-header {
    margin-right: 10px;
}

button {
    margin-right: 4px;
}

#mini-cli-demo.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(224, 168, 95, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(224, 168, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(224, 168, 95, 0);
    }
}


summary {
    line-height: 1.7;
}

.separator {
    margin-top: 15px;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
}

.user {
    font-weight: bold;
}

.node, .web, .stoa, .search, .genai {
    border-color: gray;
    background: var(--node-bg);
    border-width: 0px;
    border-style: dotted;
    padding: 10px;
    overflow-x: hidden;
}


.context {
    border-color: gray;
    border-style: dotted;
    border-width: 0px;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
}

.context-all {
    position: relative;
    height: 800px;
    border-color: gray;
    border-style: solid;
    border-width: 1px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.image-embed {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    max-height: 600px;
}

.subnode, .not-found {
    background: var(--subnode-bg);
    color: var(--subnode-text-color);
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    overflow-x: auto;
    position: relative;
    transition: background-color 0.8s ease-out;
}

.subnode-arrived {
    background-color: var(--intro-footer-bg);
}

.info-box {
    background: var(--info-box-bg);
    filter: brightness(100%);
    padding: 7px;
    font-style: italic;
    color: var(--info-box-text-color);
    border: 1px dashed var(--border);
}

.intro, #footer {
    background: var(--intro-footer-bg);
    padding: 7px;
    color: var(--intro-footer-text-color);
}

#footer {
    margin-bottom: 10px;
}

.subnode-arrived {
    background-color: var(--intro-footer-bg);
}

.info-box {
    background: var(--info-box-bg);
    filter: brightness(100%);
    padding: 7px;
    font-style: italic;
    color: var(--info-box-text-color);
    border: 1px dashed var(--border);
}

.dismiss-button {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
    color: var(--dismiss-button-color);
}

.info-box::before {
  content: '🛈';
  width: 1em;
  margin-right: 0.3em;
  flex-shrink: 0;
  transition: 0.3s;
  font-style: normal;
}

.hidden {
    opacity: 0;
    visibility: hidden;
}

.intro {
    line-height: var(--line-height);
    font-style: normal;
}

.intro::before, #footer::before {
  content: '➼';
  width: 1em;
  margin-right: 0.3em;
  flex-shrink: 0;
  transition: 0.3s;
}

.pulled-subnode, .pushed-subnode, .stoa-public {
    background: var(--pulled-pushed-bg);
    color: var(--subnode-text-color);
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.pulled-search-embed {
    overflow-x: hidden;
}


.node-header, .context-header, .stoa-header, .ctzn-header {
    justify-content: space-between;
    text-align: left;
    padding-bottom: 2px;
}

.header-with-button {
    display: flex;
}

details > summary {
    cursor: pointer;
}

.with-spacing {
    margin-top: 10px;
}

.node-name {
    text-transform: capitalize;
}

.subnode-header, .links-header, .search-header, .subnode-id {
    width: 100%;
    padding-bottom: 2px;
}

.subnode-header {
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.subnode-id {
    flex-grow: 1;
}

.subnode-footer, .node-footer {
    font-size: smaller;
    font-weight: bolder;
    width: 100%;
    display: flex;
    padding-top: 6px;
    border-top: 1px solid #ccc;
    text-align: left;
}

.subnode-contrib {
    text-align: right;
    text-decoration: none;
    max-width: 19%;
    margin-left: auto;
}

.star-toggle {
    cursor: pointer;
}

.footer-links, .footer-id {
    text-align: right;
    margin-left: auto;
    text-decoration: none;
    font-weight: normal;
}

.agora-actions, .internet-actions {
    text-decoration: none;
    margin-left: auto;
    display: block;
}

.subnode-id {
    max-width: 81%;
}

.subnode-id a {
    text-decoration: none;
}

.search {
    overflow: auto;
    gap: 10px;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
    justify-content: space-between;
    width: 97%;
}

.inline-flex > div {
    flex: auto;
}

.subnodes {
    width: 100%;
}

.annotations, .delta {
    width: 100%;
    display: flex;
    background: var(--pulled-pushed-bg);
    color: var(--subnode-text-color);
    padding: 0.5em;
    margin-bottom: 10px;
    gap: 10px;
}

.delta-nodes {
    float: left;
    width: 50%;
}

.delta-annotations {
    background: var(--pulled-pushed-bg);
    float: left;
    width: 50%;
}

.backlinks, .forwardlinks {
    flex: 1;
}

.link-list-wrapper {
    /* Do not grow by default, only take content height */
    max-height: 50%; /* But do not exceed 50% of the container */
    overflow-y: auto; /* And scroll if you do */
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--links-bg);
}

.link-list-wrapper::-webkit-scrollbar {
    width: 8px;
}

.link-list-wrapper::-webkit-scrollbar-track {
    background: var(--links-bg);
}

.link-list-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
    border: 2px solid var(--links-bg);
}

.pushlinks, .pulllinks {
    width: 33%;
    overflow: auto;
}

.backlinks-header, .pushlinks-header, .pulllinks-header, .forwardlinks-header {
    font-style: italic;
}

#agoragraph {
    height: 90%;
    width: 100%;
    position: absolute;
}

.links {
    overflow: auto;
    padding: 10px;
    margin: 10px;
    gap: 10px;
    max-height: 400px;
    width: 50%;
}

.search-header {
    text-align: left;
    margin-bottom: 1em;
    margin-left: 0.2em;
}

.wikilink-marker {
    font-weight: lighter;
    color: grey;
}

.wikilink:link {
    color: var(--wikilink-color);
}

.wikilink:visited {
    color: var(--wikilink-visited-color);
}

.wikilink:hover {
    color: var(--wikilink-hover-color);
}

#hypothesis-frame {
    display: none;
    position: fixed;
    top: 10%; 
    right: 10px;
    width: 380px;
    height: 80%;
    z-index: 1000;
    background-color: transparent;
    border: none;
    flex-direction: column;
}

#hypothesis-frame.visible {
    display: flex;
}

#hypothesis-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 2px 8px;
    border: 1px solid #444;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

#hypothesis-drag-handle {
    cursor: move;
    font-size: 0.9em;
    font-family: sans-serif;
    color: #ccc;
    flex-grow: 1;
    text-align: center;
}

#hypothesis-client-container {
    flex-grow: 1;
    position: relative;
}

#hypothesis-close-btn {
    cursor: pointer;
    color: #fff;
    background-color: #555;
    border: 1px solid #777;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    font-family: sans-serif;
    font-weight: bold;
}

.microblog_timeline {
    background: var(--pulled-pushed-bg);
    color: var(--subnode-text-color);
}

table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 10px 0;
}

td,
th {
    border: 1px solid var(--border);
    padding: .5rem;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-align: left;
}

th {
    background: var(--accent-bg);
    font-weight: bold;
}

tr:nth-child(even) {
    background: var(--accent-bg);
}

table caption {
    font-weight: bold;
    margin-bottom: .5rem;
}

.burger {
    font-size: 1.5em;
    cursor: pointer;
}

.content, .async-content {
    position: relative;
}



.overlay {
    min-height: 100vh;
    width: 100%;
    top: 0;
    left: 0; /* Start from the edge */
    position: fixed;
    background-color: rgba(20, 20, 20, 0);
    z-index: 3;
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: flex-start; /* Align to the top */
    visibility: hidden; /* Start hidden */
    opacity: 0; /* Start transparent */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, background-color 0.3s ease-in-out;
    overflow-y: auto; /* Allow the container to scroll */
}

.overlay.active {
    background-color: var(--overlay-bg);
    visibility: visible;
    opacity: 1;
}

#toast-container {
    position: fixed;
    bottom: 10px;
    right: 50px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background-color: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.4s, transform 0.4s ease-in-out;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.ai-provider-tab, .wiki-provider-tab, .web-provider-tab {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
}

.web-header + .web-provider-tab {
    padding-left: 0;
}

.ai-provider-tab.active, .wiki-provider-tab.active, .web-provider-tab.active, .graph-size-tab.active {
    font-weight: bold;
    background-color: var(--tab-active-bg);
    text-decoration: none;
}

.ai-generations-container {
    position: relative;
    overflow-x: hidden;
}

@keyframes slide-in-from-bottom {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-embed.visible {
    animation: slide-in-from-bottom 0.5s ease-out forwards;
}

.links-flex {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: space-between;
}

.overlay-content {
    padding: 20px;
    background-color: var(--node-bg);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    box-sizing: border-box;
    min-height: 100vh;
    padding-bottom: 80px; /* Extra space at the bottom */
}

@media (min-width: 60em) {
    .overlay-content {
        max-width: 70rem;
    }
}

@media screen and (max-width: 60em) {
    .overlay-content {
        width: 100%;
        border-radius: 0;
    }
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
    flex-shrink: 0;
}

.demo-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
    flex-shrink: 0;
}

.music-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
    flex-shrink: 0;
}

.settings-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
    flex-shrink: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
}


.toggle-container {
    display: flex;
    align-items: center;
    gap: 3px;
}

.theme-switch input, .demo-switch input {
    display:none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "🌞";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.demo-switch .slider:before {
    content: "🧍"; /* Person Standing */
}

.music-switch .slider:before {
    content: "🔇"; /* Muted Speaker */
}

.settings-switch .slider:before {
    content: "❌"; /* Off */
}

input:checked + .slider {
    background-color: #377ba8;
}

input:checked + .slider:before {
    transform: translateX(26px);
    content: "🌙";
}

.demo-switch input:checked + .slider:before {
    content: "🏃‍♀️"; /* Woman Running */
}

.music-switch input:checked + .slider:before {
    content: "🎵"; /* Musical Note */
}

.settings-switch input:checked + .slider:before {
    content: "✔️"; /* On */
}

/* Custom icons for Annotate toggle */
.settings-switch input.annotate-toggle-input + .slider:before {
    content: "🖋️"; /* Fountain Pen for both On and Off */
}


#demo-timer {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: bold;
    color: #fff; /* Bright white for contrast */
    display: none; /* Hidden by default */
}

.demo-switch input:checked + .slider #demo-timer {
    display: inline; /* Show timer when active */
}




.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-toggle-text {
    cursor: pointer;
}

/* Styles for /nodes page grid */
.nodes-grid {
    margin: 1rem 0;
}

.nodes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.node-item {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--accent-bg);
    transition: background-color 0.2s;
}

.node-item:hover {
    background: var(--main-bg);
}

.node-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-link .node-name {
    font-weight: 500;
    flex-grow: 1;
}

.node-size {
    font-weight: lighter;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9em;
}

.remaining-nodes {
    margin-top: 1rem;
}

.context-flex {
    display: flex;
    flex-direction: row; /* Mobile-first: stack them by default */
    gap: 10px;
    position: relative; /* For positioning the toggle button */
    padding-top: 10px;
}

.context-flex .graph-container {
    width: 70%;
    order: 1; /* Graph comes first */
}

.links {
    width: 30%;
    order: 2; /* Links come second */
    background-color: var(--links-bg);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column; /* Stack children vertically */
    justify-content: flex-start; /* Align to the top */
    align-items: center; /* Center children horizontally */
    gap: 20px; /* Add some space between the link lists */
}

@media screen and (min-width: 60em) {
    .context-flex {
        flex-direction: row; /* Side-by-side on desktop */
        align-items: stretch; /* Make boxes the same height */
    }

    .context-flex .graph-container {
        width: 70%;
    }

    .links {
        width: 30%;
    }
}

.graph-container {
    position: relative;
    background-color: var(--graph-bg);
    padding: 10px;
    border-radius: 8px;
}

#graph {
    width: 100%;
    height: 400px;
}

#full-graph {
    width: 100%;
    height: 100%;
}

#graph-toggle-labels {
    position: absolute;
    top: 20px; /* Adjust as needed */
    right: 20px; /* Adjust as needed */
    padding: 3px 6px;
    z-index: 1; /* Ensure it's above the graph */
}

.ai-provider-tab, .wiki-provider-tab, .web-provider-tab, .graph-size-tab {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Pagination styles from nodes.html */
.pagination {
    display: flex;
    justify-content: space-between;
}
.next-link {
    text-align: right;
}

/* hexgame.html */
.hexgame-canvas {
    display: block;
    margin: auto;
    background-color: #f0f0f0;
}

/* Utility classes for inline styles */
.display-block {
    display: block;
}

.display-none {
    display: none;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.w-100 {
    width: 100%;
}

.w-30 {
    width: 30%;
}

.max-w-99 {
    max-width: 99.5%;
}

.mb-10 {
    margin-bottom: 10px;
}

.flex-grow {
    flex: auto;
    flex-grow: 1;
}

.no-border {
    border-style: none;
}

.no-text-decoration {
    text-decoration: none;
}

.all-unset {
    all: unset;
}

/* Meditation Popup Styles */
#meditation-popup-container {
    position: fixed;
    top: 10%;
    left: 10%;
    z-index: 1001; /* one above hypothesis */
    display: none; /* Hidden by default */
    animation: fadeIn 0.3s ease-in-out;
}

#meditation-popup-container.active {
    display: block; /* Shown when active */
}

#meditation-popup {
    background-color: var(--node-bg);
    border-radius: 8px;
    width: 72%;
    min-width: 400px;
    max-width: 864px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--link-color);
}

#meditation-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    color: #ccc;
    padding: 2px 8px;
    border: 1px solid #444;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: move; /* Draggable cue */
}

#meditation-popup-title {
    font-weight: bold;
    font-size: 0.9em;
    font-family: sans-serif;
    color: #ccc;
    flex-grow: 1;
    text-align: center;
}

#meditation-popup-close-btn {
    cursor: pointer;
    color: #fff;
    background-color: #555;
    border: 1px solid #777;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 16px; /* To make the 'x' look right */
}

#meditation-popup-content {
    padding: 1rem;
    line-height: 1.6;
    max-height: 70vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

#music-player-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    width: fit-content; /* Constrain container to its content */
}

#music-player-container.active {
    display: block;
}

#music-player {
    background-color: var(--node-bg);
    border-radius: 8px;
    width: 250px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--link-color);
}

#music-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    color: #ccc;
    padding: 2px 8px;
    border-radius: 5px 5px 0 0;
    cursor: move;
}

#music-player-title {
    font-weight: bold;
    font-size: 0.9em;
    font-family: sans-serif;
    color: #ccc;
    flex-grow: 1;
    text-align: center;
}

#music-player-close-btn {
    cursor: pointer;
    color: #fff;
    background-color: #555;
    border: 1px solid #777;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 18px;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 16px;
}

#music-player-content {
    padding: 0.5rem 1rem;
    font-size: 0.9em;
    text-align: center;
}

@media screen and (max-width: 60em) {
    #meditation-popup {
        width: 95%;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    #meditation-popup-content {
        overflow-y: auto;
    }
}

/* Responsive action bar */
@media screen and (max-width: 60em) {
    .topline-node-wrapper {
        flex-wrap: wrap;
    }

    .search-container {
        width: 100%;
        order: -1; /* Move search bar to the top */
        margin-bottom: 5px;
    }

    .action-bar {
        width: 100%;
        overflow-x: auto;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .action-bar::-webkit-scrollbar {
        display: none;
    }

    /* Wrapper elements get the relative positioning and the pseudo-element for the shadow. */
    .navigation, .topline-node-wrapper, .footer-wrapper {
        position: relative;
    }

    .navigation::after, .topline-node-wrapper::after, .footer-wrapper::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        background: linear-gradient(to right, transparent, var(--main-bg));
        opacity: 1;
        transition: opacity 0.2s ease-in-out;
    }

    /* When the wrapper has this class, the shadow fades out. */
    .navigation.scrolled-to-end::after, 
    .topline-node-wrapper.scrolled-to-end::after, 
    .footer-wrapper.scrolled-to-end::after {
        opacity: 0;
    }

    #scroll-toggle {
        margin-left: 0; /* Reset the margin for mobile */
    }

    .hide-on-mobile {
        display: none;
    }
}

.collapsible-content {
    max-height: 300px; /* Adjust as needed for ~10-15 lines */
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease-in-out;
}

.collapsible-content.expanded {
    max-height: none;
}

.collapsible-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--subnode-bg));
    pointer-events: none; /* Allows clicking through the gradient */
}

.collapsible-content.expanded::after {
    display: none; /* Hide the gradient when expanded */
}

.show-more-button {
    cursor: pointer;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    color: var(--link-color);
}

/* Mastodon Embed Styles */
.mastodon-embed-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: sans-serif;
    max-width: 500px;
}

.mastodon-embed-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.mastodon-embed-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 1rem;
}

.mastodon-embed-author {
    display: flex;
    flex-direction: column;
}

.mastodon-embed-author span {
    color: var(--text-color-light);
}

.mastodon-embed-content p {
    margin-top: 0;
}

.mastodon-embed-media {
    margin-top: 1rem;
}

.mastodon-embed-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.mastodon-embed-footer {
    margin-top: 1rem;
    font-size: 0.9em;
}

.mastodon-embed-footer a {
    color: var(--text-color-light);
    text-decoration: none;
}

.mastodon-embed-footer a:hover {
    text-decoration: underline;
}
