* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background: #000;
  height: 100vh;
  overflow: hidden;
}

.layout {
  display: flex;
  height: 100vh;
}

.sidebar-header {
  margin-bottom: 30px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sidebar {
  width: 350px;
  background: #111;
  color: #e0e0e0;
  padding: 30px;
  overflow-y: auto;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  border-right: 1px solid #333;
}

.sidebar h1 {
  color: #00ff7f;
  margin-bottom: 0;
  font-size: 1.8em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.sidebar h1 a {
  color: inherit;
  text-decoration: none;
}

.sidebar h1 a:hover {
  text-decoration: none;
}

.sidebar h1 .emoji {
  filter: grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(90deg)
    brightness(1.2);
}

.sidebar .version {
  color: #666;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.info-box {
  border: 1px solid #333;
  background: #111;
  margin-bottom: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.info-box h3 {
  background: #181818;
  border-bottom: 1px solid #333;
  padding: 6px 10px;
  font-size: 13px;
  color: #00ff7f;
  margin: 0;
  font-weight: 600;
}

.info-box-content {
  background: #000;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #e5e5e5;
}

.info-box-content p {
  margin: 8px 0;
}

.info-box-content ul {
  margin: 8px 0;
  padding-left: 20px;
  list-style-type: none;
}

.info-box-content li {
  margin: 4px 0;
  padding-left: 1.2em;
  position: relative;
}

.info-box-content li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #00ff7f;
}

.info-box-content pre {
  margin: 10px 0;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 3px;
  overflow-x: auto;
}

.info-box-content pre code {
  display: block;
  padding: 10px;
  margin: 0;
  border: none;
}

.info-box code {
  background: #0a0a0a;
  color: #5fafff;
  padding: 4px 8px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  display: block;
  margin: 10px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  border: 1px solid #333;
}

.info-box a {
  color: #5fafff;
  text-decoration: none;
  font-weight: 500;
}

.info-box a:hover {
  text-decoration: underline;
}

.info-box-content del,
.info-box-content s {
  text-decoration: line-through;
  opacity: 0.7;
}

.info-box-content strong {
  font-weight: bold;
}

.info-box-content em {
  font-style: italic;
}

/* Blockquote support for markdown */
.info-box-content blockquote {
  border-left: 4px solid #00ff7f;
  margin: 12px 0;
  padding: 8px 0 8px 12px;
  background: #0a0a0a;
  color: #ccc;
  font-style: italic;
}

.info-box-content blockquote p {
  margin: 4px 0;
}

/* Heading support */
.info-box-content h1,
.info-box-content h2,
.info-box-content h3,
.info-box-content h4,
.info-box-content h5,
.info-box-content h6 {
  color: #00ff7f;
  margin: 12px 0 8px 0;
  font-weight: bold;
}

.info-box-content h1 { font-size: 1.5em; }
.info-box-content h2 { font-size: 1.3em; }
.info-box-content h3 { font-size: 1.1em; }
.info-box-content h4 { font-size: 1em; }
.info-box-content h5 { font-size: 0.9em; }
.info-box-content h6 { font-size: 0.85em; }

/* Horizontal rule */
.info-box-content hr {
  border: none;
  border-top: 1px solid #333;
  margin: 15px 0;
}

/* Ordered lists */
.info-box-content ol {
  margin: 8px 0;
  padding-left: 20px;
  list-style-type: decimal;
  list-style-position: outside;
}

.info-box-content ol li {
  margin: 4px 0;
  padding-left: 0.5em;
  color: #e5e5e5;
}

.info-box-content ol li::before {
  content: none;
}

/* Tables */
.info-box-content table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
}

.info-box-content th,
.info-box-content td {
  border: 1px solid #333;
  padding: 6px 10px;
  text-align: left;
}

.info-box-content th {
  background: #181818;
  color: #00ff7f;
  font-weight: bold;
}

.info-box-content td {
  background: #0a0a0a;
}

.main-content {
  margin-left: 350px;
  flex: 1;
  background: #000;
  overflow-y: auto;
  height: 100vh;
}

.content-wrapper {
  max-width: 1200px;
  padding: 30px;
}

.timeline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  max-width: 800px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}

.timeline-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
  white-space: nowrap;
}

.timeline-link {
  color: #888;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.timeline-link:hover {
  color: #00ff7f;
  background: rgba(0, 255, 127, 0.1);
}

.timeline-link.active {
  color: #00ff7f;
  font-weight: bold;
}

.timeline-separator {
  color: #444;
}

h2 {
  color: #00ff7f;
  margin-bottom: 0;
  font-size: 1.8em;
  padding-bottom: 0;
}

.server-message {
  background: #1a1a1a;
  border: 2px solid #00ff7f;
  border-radius: 4px;
  padding: 15px 20px;
  margin-bottom: 20px;
  color: #e0e0e0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  max-width: 800px;
}

.server-message strong {
  color: #00ff7f;
  margin-right: 8px;
}

.post {
  border: 1px solid #333;
  background: #111;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  margin-bottom: 20px;
  max-width: 800px;
}

.post:last-child {
  margin-bottom: 20px;
}

.boost-indicator {
  background: #1a1a2e;
  padding: 4px 10px;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.boost-indicator .boost-icon {
  margin-right: 4px;
}

.post-meta {
  background: #181818;
  border-bottom: 1px solid #333;
  padding: 6px 10px;
  font-size: 13px;
  color: #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-author {
  font-weight: 600;
  color: #00ff7f;
  text-decoration: none;
}

.post-author:hover {
  text-decoration: underline;
}

.post-permalink {
  color: #666;
  text-decoration: none;
  font-size: 12px;
}

.post-permalink:hover {
  color: #00ff7f;
  text-decoration: underline;
}

.post-content {
  background: #000;
  padding: 10px;
  font-size: 14px;
  line-height: 1;
  color: #e5e5e5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-time {
  margin: 0;
  padding: 0 0 2px 0;
  line-height: 0.8;
  color: #666;
  font-size: 14px;
  font-style: italic;
}

.post-time::before {
  content: "# ";
}

.post-text {
  margin: 0;
  position: relative;
  padding-left: 1.8em;
  line-height: 1.5em;
}

.post-text a {
  color: #5fafff;
  text-decoration: underline;
}

.post-text a:hover {
  color: #7fc8ff;
}

.post-text::before {
  content: "$";
  position: absolute;
  left: 0;
  top: 0;
  color: #5fafff;
}

.pagination {
  display: flex;
  justify-content: normal;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.pagination a,
.pagination span {
  padding: 10px 20px;
  background: #181818;
  color: #00ff7f;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid #333;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.pagination a:hover {
  background: #222;
  border-color: #00ff7f;
}

.pagination span {
  background: #0a0a0a;
  color: #666;
  cursor: not-allowed;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-style: italic;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.scroll-up {
  display: none;
}

.toggle-btn {
  display: none;
}

/* Backdrop overlay for mobile menu */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  body {
    overflow: auto;
    overflow-y: scroll;
  }
  body.menu-open {
    overflow: hidden;
  }
  .layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    position: sticky;
    top: 0;
    height: auto;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 100;
    padding: 15px 30px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }
  .sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
  }
  .sidebar.minimized {
    max-height: none;
    overflow: visible;
    cursor: pointer;
  }
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }
  .sidebar.minimized .sidebar-header {
    margin-bottom: 0;
  }
  .sidebar h1 {
    margin-bottom: 0;
    flex: 1;
    font-size: 1.5em;
  }
  /* Animated info-box for smooth open/close */
  .sidebar .info-box {
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
  }
  .sidebar.minimized .info-box {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
  }
  .sidebar .toggle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    border: 1px solid #333;
    border-radius: 6px;
    background: #181818;
    transition: transform 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  }
  .sidebar .toggle-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #00ff7f;
    border-radius: 1px;
  }
  .sidebar .toggle-btn:hover {
    background: #222;
    border-color: #00ff7f;
  }
  .sidebar:not(.minimized) .toggle-btn {
    transform: rotate(90deg);
  }
  .main-content {
    margin-left: 0;
    height: auto;
    overflow: visible;
  }
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #333;
  padding-bottom: 30px;
  max-width: 800px;
}

.profile-header h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.back-link {
  color: #5fafff;
  text-decoration: none;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.back-link:hover {
  text-decoration: underline;
}

.post-caption {
  font-weight: 600;
  color: #00ff7f;
  text-decoration: none;
}

.user-profile {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  margin-bottom: 30px;
  max-width: 800px;
}

.user-info {
  background: #000;
  padding: 10px;
  font-size: 17px;
  line-height: 3;
  color: #e5e5e5;
}

.user-info p {
  margin: 0 0 5px 0;
  padding-left: 1.8em;
  position: relative;
  color: #ccc;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.user-info p::before {
  position: absolute;
  left: 0;
  top: 0;
  color: #00ff7f;
}

.user-info strong {
  color: #5fafff;
}

/* Avatar styling */
.user-avatar {
  margin-bottom: 15px;
}

.avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #333;
}

.avatar-small {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #333;
}

/* Hashtag styling */
.hashtag {
  color: #5fafff;
  text-decoration: none;
  font-weight: 500;
}

.hashtag:hover {
  text-decoration: underline;
  color: #7fc8ff;
}

/* Thread view styling */
.thread-context {
  margin-bottom: 20px;
  max-width: 800px;
}

.reply-indicator {
  color: #666;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  margin-bottom: 10px;
  padding-left: 10px;
}

.parent-post {
  border-left: 3px solid #5fafff;
  opacity: 0.8;
}

.parent-post:hover {
  opacity: 1;
}

.main-post {
  border-left: 3px solid #00ff7f;
}

.replies-section {
  margin-top: 30px;
  max-width: 800px;
}

.replies-header {
  color: #666;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.reply-post {
  margin-left: 20px;
  border-left: 3px solid #444;
}

.reply-post:hover {
  border-left-color: #5fafff;
}

.post-username {
  font-weight: 600;
  color: #00ff7f;
  text-decoration: none;
}

.post-username:hover {
  text-decoration: underline;
}

.post-actions {
  background: #0a0a0a;
  border-top: 1px solid #333;
  padding: 8px 10px;
}

.view-post-link {
  color: #5fafff;
  text-decoration: none;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.view-post-link:hover {
  text-decoration: underline;
}

/* Post footer with reply count */
.post-footer {
  background: #0a0a0a;
  border-top: 1px solid #333;
  padding: 6px 10px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.like-count,
.boost-count,
.reply-count {
  color: #666;
  text-decoration: none;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.post-footer .icon {
  filter: grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(90deg)
    brightness(1.2);
}

.reply-count {
  color: #00ff7f;
}

.reply-count:hover {
  color: #00ff7f;
  text-decoration: underline;
}

/* Engagement Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.modal-close {
  color: #666;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
  position: absolute;
  right: 15px;
  top: 15px;
}

.modal-close:hover,
.modal-close:focus {
  color: #00ff7f;
}

.modal-content h3 {
  color: #00ff7f;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
  font-size: 1.2em;
}

#modal-body {
  color: #e0e0e0;
}

.engagement-user {
  padding: 10px;
  border-bottom: 1px solid #222;
  transition: background-color 0.2s;
}

.engagement-user:last-child {
  border-bottom: none;
}

.engagement-user:hover {
  background-color: #181818;
}

.user-link {
  color: #5fafff;
  text-decoration: none;
  font-weight: 500;
}

.user-link:hover {
  color: #7fc8ff;
  text-decoration: underline;
}

#modal-body p {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Remote reply styling */
.remote-reply {
  border-left-color: #4a90a4;
}

.remote-reply:hover {
  border-left-color: #5fafff;
}

.remote-author {
  color: #4a90a4;
}

.remote-author:hover {
  color: #5fafff;
}
