:root {
    --bg-color: rgba(26, 26, 26, 0.85);
    --text-color: #f0f0f0;
    --link-color: #4da6ff;
    --heading-color: #ffffff;
    --chatroom-bg: rgba(42, 42, 42, 0.9);
    --overlay-color: rgba(0, 0, 0, 0.4);
  }

  .light-mode {
    --bg-color: rgba(255, 255, 255, 0.85);
    --text-color: #333333;
    --link-color: #0066cc;
    --heading-color: #1a1a1a;
    --chatroom-bg: rgba(240, 240, 240, 0.9);
    --overlay-color: rgba(255, 255, 255, 0.4);
  }

  body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), 
                url('/assets/plato.jpg') no-repeat top center fixed;
    background-size: cover;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    position: relative;
    z-index: 1;
  }

  h1,
  h2,
  h3 {
    color: var(--heading-color);
  }

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

  .chatroom-link {
    display: block;
    margin-top: 20px;
    padding: 10px;
    background-color: var(--chatroom-bg);
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
  }

  #mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    background-color: var(--chatroom-bg);
    border: none;
    color: var(--text-color);
    cursor: pointer;
  }

  /* Responsive design for smaller screens */
  @media screen and (max-width: 768px) {
    body {
      padding: 15px;
      font-size: 16px;
    }

    h1 {
      font-size: 24px;
    }

    h2 {
      font-size: 20px;
    }

    h3 {
      font-size: 18px;
    }

    ul,
    ol {
      padding-left: 20px;
    }

    #mode-toggle {
      top: 10px;
      right: 10px;
      padding: 8px;
      font-size: 14px;
    }
  }

  /* Further adjustments for very small screens */
  @media screen and (max-width: 480px) {
    body {
      padding: 10px;
      font-size: 14px;
    }

    h1 {
      font-size: 22px;
    }

    h2 {
      font-size: 18px;
    }

    h3 {
      font-size: 16px;
    }

    ul,
    ol {
      padding-left: 15px;
    }
  }

  /* Markdown Content Styling */
  #content a {
    color: var(--link-color);
  }

  #content h1,
  #content h2,
  #content h3 {
    color: var(--heading-color);
  }

  /* You can add more styles to match your existing styles */

  .simplex-link-container {
    background-color: var(--chatroom-bg);
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
  }

  .simplex-link {
    word-break: break-all;
    font-family: monospace;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    margin: 10px 0;
    display: block;
  }

  .copy-button {
    background-color: var(--link-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
  }

  .copy-button:hover {
    opacity: 0.9;
  }

  #content {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
  }

  .simplex-link-container {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .chart-container {
    width: 100%;
    height: auto;
    margin: 40px 0;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
  }

  .chart-container:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
  }

  /* Debug styles */
  .chart-container::before {
    content: attr(id);
    display: block;
    color: var(--text-color);
    margin-bottom: 10px;
  }

  /* Dark/Light mode adaptations */
  .light-mode .chart-container {
    background: rgba(255, 255, 255, 0.9);
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    .chart-container {
      margin: 20px 0;
      padding: 10px;
    }
  }

  .navigation {
    background-color: var(--chatroom-bg);
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .nav-header {
    margin-bottom: 15px;
  }

  .back-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--link-color);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
  }

  .back-button:hover {
    transform: translateX(-3px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
  }

  .nav-links a:hover {
    background-color: var(--link-color);
    color: white;
    transform: translateY(-1px);
  }

  /* Remove scrollbar styles */
  .nav-links::-webkit-scrollbar {
    display: none;
  }

  /* Responsive adjustments */
  @media screen and (max-width: 768px) {
    .navigation {
      padding: 12px;
      margin: 15px 0 25px 0;
    }
    
    .nav-links a {
      padding: 5px 8px;
      font-size: 12px;
    }
  }

  #content a[href*="/analysis/"] {
    display: inline-block;
    margin: 15px 0;
    padding: 8px 15px;
    background-color: var(--link-color);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: opacity 0.3s;
  }

  #content a[href*="/analysis/"]:hover {
    opacity: 0.9;
  }

  #content a[href*="/analysis/"]::after {
    content: " →";
  }

  /* Table styling */
  #content table {
    margin: 20px auto;  /* Centers the table with auto margins */
    width: auto;        /* Allows table to size to content */
    border-collapse: collapse;
  }

  #content th,
  #content td {
    padding: 8px 16px;
    border: 1px solid var(--text-color);
    text-align: left;
  }

  #content th {
    background-color: var(--chatroom-bg);
  }

  /* Responsive table adjustments */
  @media screen and (max-width: 768px) {
    #content table {
      width: 100%;
      margin: 15px 0;
    }
    
    #content th,
    #content td {
      padding: 6px 12px;
    }
  }

  /* Add to existing CSS */
  sup {
    font-size: 0.6em;
    opacity: 0.5;
    text-decoration: none;
    margin-left: 0.5em;
  }

  sup:hover {
    opacity: 1;
  }

  /* Add to styles.css */
  #content .copy-button {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    background-color: var(--link-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
  }

  #content .copy-button:hover {
    opacity: 0.9;
  }

  #content blockquote {
    border-left: 3px solid var(--link-color);
    margin: 5px 0;
    padding-left: 10px;
    color: var(--text-color);
    opacity: 0.8;
    font-style: italic;
  }