/* -------------------- Global Layout -------------------- */

body {
  margin: 0;
  font-family: sans-serif;
  display: flex;
  min-height: 100vh;
  padding-top: 50px;
  background-color: #0e0e0e;
  color: #ddd;
}

/* -------------------- Navbar -------------------- */
.navbar {
  background: #1a1a1a;
  color: #eee;
  padding: 10px 20px;
  display: flex;
  gap: 20px;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 50px;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.navbar a {
  color: #8fb4ff;
  text-decoration: none;
  transition: 0.2s;
}

.navbar a:hover {
  color: #fff;
  text-decoration: underline;
}

/* -------------------- Sidebar -------------------- */
.sidebar {
  width: 250px;
  background: #141414;
  padding: 1rem;
  height: calc(100vh - 50px);
  overflow-y: auto;
  border-right: 1px solid #222;
  color: #ccc;
}

.sidebar a {
  color: #a8b9ff;
  text-decoration: none;
}

.sidebar a:hover {
  color: #fff;
}

/* -------------------- Content -------------------- */
.content {
  flex: 1;
  padding: 40px 60px;
  box-sizing: border-box;
  background: #0e0e0e;
  color: #ddd;
}

.markdown-body {
  background: #151515;
  padding: 2rem 3rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* -------------------- Headings & Typography -------------------- */
h1, h2, h3, h4, h5 {
  color: #f2f2f2;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

hr {
  border: none;
  border-top: 1px solid #333;
  margin: 1.5rem 0;
}

a {
  color: #64a9ff;
  text-decoration: none;
}

a:hover {
  color: #a6c8ff;
  text-decoration: underline;
}



/* -------------------- Buttons & Inputs -------------------- */
button,
input[type="submit"],
select {
  background-color: #222;
  color: #eee;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
select:hover {
  background-color: #333;
  color: #fff;
}

/* -------------------- Tag Block -------------------- */
.tag-block {
  background: #1a1a1a;
  border-left: 4px solid #444;
  padding: 0.6rem;
  margin: 1rem 0;
}

.tag-block .tag {
  display: inline-block;
  background: #2b2b2b;
  color: #ccc;
  border-radius: 4px;
  font-size: 0.85em;
  padding: 2px 6px;
  margin: 0 0.4rem 0.3rem 0;
}

.tag-block .tag:hover {
  background: #3a3a3a;
  color: #fff;
}

/* -------------------- Prism Code Block -------------------- */
pre[class*="language-"] {
  border-radius: 8px;
  background: #1b1b1b;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.9rem;
  position: relative;
  margin: 1.4em 0;
}

code[class*="language-"] {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  color: #eee;
}

.line-numbers-rows > span {
  color: #666;
}

/* -------------------- Prism Copy Button -------------------- */
div.code-toolbar {
  position: relative;
}

div.code-toolbar > .toolbar {
  opacity: 1 !important;
  display: flex !important;
  position: absolute !important;
  top: 6px;
  right: 6px;
  z-index: 5;
}

div.code-toolbar > .toolbar button {
  background: #2d2d2d;
  color: #ccc;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.9;
  transition: 0.2s;
}

div.code-toolbar > .toolbar button:hover {
  color: #fff;
  background: #444;
  opacity: 1;
}

/* -------------------- Image Lightbox -------------------- */
#image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#image-lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}


/* -------------------- Breadcrumb -------------------- */
/* Breadcrumb spacing & readability */
.breadcrumb {
  margin-left: 1rem;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  font-size: 0.9rem;
  color: #bbb;
}

.breadcrumb a {
  color: #8fb4ff;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}
.breadcrumb-separator {
  margin: 0 0.4rem;
  color: #666;
}


/* -----------------------------------------
   Visited Link Styling (Dark Theme)
----------------------------------------- */

/* Sidebar and Breadcrumb */
.sidebar a:link,
.breadcrumb a:link {
  color: #8fb4ff;
}

.sidebar a:visited,
.breadcrumb a:visited {
  color: #70cac3;  /* teal tint for differentiation */
}

.sidebar a:hover,
.breadcrumb a:hover {
  color: #a6c8ff;
  text-decoration: underline;
}

/* Markdown Content Links (inside articles, lists, etc.) */
.markdown-body a:link {
  color: #8fb4ff;
}



.markdown-body a:hover {
  color: #a6c8ff;
  text-decoration: underline;
}

.markdown-body a:active {
  color: #ff8b55;
}

/* Global fallback for any other content area */
.content a:visited {
  color: #7b95d6;
}

.markdown-body a:visited {
  color: #d6a86d;   /* subtle dim — same hue, lower brightness */
}






.python-runner .run-btn {
  background-color: #444;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 6px;
  cursor: pointer;
}
.python-runner .run-btn:hover {
  background-color: #666;
}
.python-runner .code-output {
  margin-top: 6px;
  padding: 6px 10px;
  background: #1e1e1e;
  border-left: 3px solid #7fdbca;
  color: #c7e8f0;
  font-family: monospace;
  font-size: 0.95em;
}









.py-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.py-modal.hidden {
  display: none;
}
.py-modal-content {
  background: #2c2c2c;
  color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  width: 300px;
}
.py-modal-content input {
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  font-size: 1rem;
  background: #1e1e1e;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
}
.py-modal-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  gap: 10px;
}
.py-modal-buttons button {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #70cac3;
  color: #000;
  font-weight: bold;
}
.py-modal-buttons button:hover {
  background-color: #8fd5cd;
}


/* 📱 Fix horizontal overflow on small screens */
/* ✅ Prevent horizontal overflow globally */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ✅ Prevent overflow in markdown and content blocks */
.content,
.markdown-body {
  max-width: 100vw;
  overflow-x: hidden;
  word-wrap: break-word;
  box-sizing: border-box;
  padding-right: 1rem;  /* Optional: ensure spacing inside view */
}

/* ✅ Allow horizontal scroll only inside code blocks */
.markdown-body pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ✅ Prevent links or inline code from breaking layout */
.markdown-body a,
.markdown-body code {
  word-break: break-word;
  overflow-wrap: break-word;
}

#todo-container {
  margin-left: 240px; /* adjust if your sidebar is wider or narrower */
  padding: 20px;
}

pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}