:root {
  --bg: #f7f7f7;
  --fg: #232323;
  --sidebar-bg: #eaeaea;
  --sidebar-fg: #232323;
  --accent: #3a7bd5;
  --menu-bg: var(--bg);
  --menu-fg: #232323;
  --border: #cccccc;
  --muted: #666666;
  --link: #232323;
  --success-color: #28a745;
  --success-hover-color: #218838;
  --danger-color: #dc3545;
  --danger-hover-color: #c82333;
  --btn-text-color: white;
  --unit: 100px; /* Base unit size - same as editor */
}

body.light-mode {
  --bg: #f7f7f7;
  --fg: #232323;
  --sidebar-bg: #eaeaea;
  --sidebar-fg: #232323;
  --accent: #3a7bd5;
  --menu-bg: #ffffff;
  --menu-fg: #232323;
  --border: #cccccc;
  --muted: #666666;
  --link: #232323;
  --success-color: #28a745;
  --success-hover-color: #218838;
  --danger-color: #dc3545;
  --danger-hover-color: #c82333;
  --btn-text-color: white;
}

body.dark-mode {
  --bg: #272727;
  --fg: #acada8;
  --sidebar-bg: #232323;
  --sidebar-fg: #acada8;
  --accent: #c7c9c3;
  --menu-bg: #1a1a1a;
  --menu-fg: #acada8;
  --border: #343235;
  --muted: #6a696c;
  --link: #c7c9c3;
  --success-color: #28a745;
  --success-hover-color: #218838;
  --danger-color: #dc3545;
  --danger-hover-color: #c82333;
  --btn-text-color: white;
}

body.custom-mode {
  /* --bg and --fg will be set inline by JS */
  --link: var(--fg);
}

#customColorInput {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2000;
}

#customColorMenu {
  display: none;
  position: absolute;
  min-width: 220px;
  background: var(--menu-bg);
  color: var(--menu-fg);
  border: 1px solid var(--border);
  padding: 14px 18px 14px 18px;
  z-index: 2001;
  box-shadow: none;
  border-radius: 3px;
}

#customColorMenu label {
  font-size: 12px;
  margin-right: 8px;
  display: block;
  margin-bottom: 6px;
}

#customColorMenu .slider-group {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

#customColorMenu .slider-group label {
  min-width: 22px;
  margin: 0 6px 0 0;
  font-size: 12px;
}

/* Global link styling - make all links italic and underlined */
a {
  color: var(--link);
  text-decoration: underline;
  font-style: italic;
}

a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Site map scrollbar styling */
#site-map::-webkit-scrollbar {
  width: 8px;
}

#site-map::-webkit-scrollbar-track {
  background: transparent;
}

#site-map::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
}

#site-map::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Site map fade indicators */
#site-map::before,
#site-map::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.2s ease;
}

#site-map::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  opacity: var(--show-top-fade, 0);
}

#site-map::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  opacity: var(--show-bottom-fade, 0);
}

/* Post navigation styling */
.post-navigation {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: monospace;
  font-size: 9px;
  line-height: 1.4;
  clear: both; /* Ensure navigation is below any floating images */
  position: relative; /* Establish positioning context */
  z-index: 1; /* Ensure navigation appears above content */
}

.post-navigation .nav-link {
  color: var(--link);
  text-decoration: none;
  font-style: normal;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: block;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 500;
}

.post-navigation .nav-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Ensure navigation container is visible */
.post-navigation {
  background: var(--bg);
  padding: 20px 0;
  border-radius: 4px;
  margin: 20px 0;
}



/* Minimal scrollbar styling for image magazine */
#imageGallery::-webkit-scrollbar {
  width: 6px;
}

#imageGallery::-webkit-scrollbar-track {
  background: transparent;
}

#imageGallery::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}

#imageGallery::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Custom scrollbar styling for submenus */
.submenu::-webkit-scrollbar {
  width: 6px;
}

.submenu::-webkit-scrollbar-track {
  background: transparent;
}

.submenu::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}

.submenu::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

#customColorMenu input[type="range"] {
  width: 100px;
  margin: 0 8px 0 0;
}

#customColorMenu .color-preview {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-left: 8px;
}

#customColorMenu .close-btn {
  background: none;
  border: none;
  color: var(--menu-fg);
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 2px;
}

#customColorMenu .close-btn:hover {
  background: var(--sidebar-bg);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
  margin: 0;
  padding: 0;
}

body {
  height: 100%;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.55;
  letter-spacing: -0.2px;
  font-size: 13px;
  margin: 0;
  padding: 0;
  padding-top: 22px; /* Account for fixed taskbar */
}

/* Ensure background covers all content */
#app, .container, .main-content, .page-container, .main-column {
  background: var(--bg);
  min-height: 100vh;
}

/* Fix for any scrollable content */
:root {
  background: var(--bg);
}

/* Prevent over-scrolling on short posts */
body {
  overflow-x: hidden;
}

.page-container {
  min-height: calc(100vh - 24px); /* Account for taskbar height */
}

/* Remove embedded scrollbars - let page scroll naturally */
.main-column {
  min-height: calc(100vh - 24px);
}

/* Taskbar */
.menu-bar {
  user-select: none;
  background-color: var(--bg); /* Match the main background color */
  border: none; /* Remove any borders */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 22px; /* Reduced height */
  min-height: 0;
  border-bottom: 1px solid var(--border); /* Use theme border color */
}

.menu-bar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px; /* Reduced vertical padding */
  font-size: 12px;
  height: 100%;
}

/* Responsive taskbar - reduce spacing on narrow windows */
/* Star button (sitemap toggle) is hidden at multiple breakpoints for mobile optimization */
@media (max-width: 1200px) {
  .menu-bar-inner {
    gap: 10px;
  }
}

@media (max-width: 1000px) {
  .menu-bar-inner {
    gap: 8px;
  }
}

@media (max-width: 800px) {
  .menu-bar-inner {
    gap: 6px;
  }
  
  /* Hide PiousPigeon label on very narrow windows */
  .pigeon-label {
    display: none;
  }
}

@media (max-width: 700px) {
  .menu-bar-inner {
    gap: 4px;
  }
  
  /* Hide star button when taskbar gets very condensed */
  .menu-star {
    display: none !important;
  }
}

.taskbar-status {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.taskbar-status span {
  cursor: pointer;
  padding: 1px 3px;
}

.taskbar-status span:hover {
  text-decoration: underline;
}

/* Hide editor-only elements on main site */
.editor-only {
  display: none !important;
}

.menu-item {
  position: relative;
  background: var(--bg);
  color: var(--fg);
}

.menu-item > .label {
  padding: 0 3px; /* Reduced vertical padding */
  cursor: default;
}

.menu-item:hover > .label,
.menu-item:focus-within > .label {
  text-decoration: underline;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px); /* Reduced distance */
  left: 0;
  min-width: max-content; /* Let the dropdown size to its content */
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px; /* Reduced padding */
  z-index: 10001;
}

.menu-item.open > .menu-dropdown {
  display: block;
}

.menu-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 6px; /* Reduced vertical padding */
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  font-style: normal !important;
  white-space: nowrap; /* Prevent text from wrapping */
}

.menu-entry:hover {
  background: rgba(255, 255, 255, 0.05);
}

.menu-entry a {
  font-style: normal !important;
}

/* Menu separator */
.menu-separator {
  height: 1px;
  background: #555555;
  margin: 2px 0; /* Reduced margin */
}

/* Submenu styles */
.menu-entry.has-submenu {
  position: relative;
}

.menu-submenu {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 200px;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  padding: 4px;
  z-index: 10001;
}

.menu-entry.has-submenu:hover .menu-submenu {
  display: block;
}

.menu-submenu .menu-entry {
  white-space: nowrap;
}

/* Make star clickable */
.menu-star {
  margin-right: 8px;
  opacity: .85;
  cursor: pointer;
  padding: 1px 3px;
}

.menu-star:hover {
  text-decoration: underline;
}

/* Layout - Unit-based system matching editor */
.page-container {
  min-height: calc(100vh - 24px);
  padding: calc(var(--unit) * 2) calc(var(--unit) * 3) calc(var(--unit) * 3) calc(var(--unit) * 3);
  box-sizing: border-box;
}

.main-column {
  width: calc(100vw - calc(var(--unit) * 6));
  max-width: calc(var(--unit) * 6);
  background: var(--bg);
  color: var(--fg);
  box-sizing: border-box;
  margin: 0 auto;
}

/* Responsive layout - empty space shrinks before main content */
@media (max-width: 1200px) {
  .page-container {
    padding: calc(var(--unit) * 2) calc(var(--unit) * 2) calc(var(--unit) * 3) calc(var(--unit) * 2);
  }
  
  .main-column {
    width: calc(100vw - calc(var(--unit) * 4));
    max-width: calc(var(--unit) * 6);
  }
}

@media (max-width: 900px) {
  .page-container {
    padding: calc(var(--unit) * 2) calc(var(--unit) * 1) calc(var(--unit) * 3) calc(var(--unit) * 1);
  }
  
  .main-column {
    width: calc(100vw - calc(var(--unit) * 2));
    max-width: calc(var(--unit) * 6);
  }
}

@media (max-width: 600px) {
  .page-container {
    padding: calc(var(--unit) * 2) calc(var(--unit) * 0.5) calc(var(--unit) * 3) calc(var(--unit) * 0.5);
  }
  
  .main-column {
    width: calc(100vw - calc(var(--unit) * 1));
    max-width: calc(var(--unit) * 6);
  }
  
  /* Ensure star button is hidden on very small mobile devices */
  .menu-star {
    display: none !important;
  }
}

/* Content */
.post-header {
  margin-bottom: 10px;
}

.post-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.post-date {
  color: var(--muted);
  font-size: 10px;
  margin: 2px 0 28px 0;
}

/* Post content with enhanced text flow for magazine-style layout */
.post-content {
  text-align: justify; /* Justify text for magazine appearance */
  line-height: 1.6; /* Slightly taller line height for readability */
  hyphens: auto; /* Enable automatic hyphenation */
  word-wrap: break-word; /* Allow long words to break */
  overflow: hidden; /* Ensure content doesn't overflow */
  position: relative; /* Establish positioning context */
}

.post-content p {
  margin: 0 0 14px 0;
  text-indent: 0; /* No paragraph indentation */
}

/* All images in posts - uniform 150x150 square format with text wrapping */
.post-content img {
  width: 150px !important;
  height: 150px !important;
  object-fit: cover !important;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  float: right; /* Default float right for text wrapping */
  margin: 8px 0 12px 16px; /* Enhanced margins for better text flow */
  shape-outside: margin-box; /* Better text wrapping around the entire margin box */
  clear: none; /* Allow images to stack/overlap for magazine-style layout */
}

/* Random asset images inserted by [R] - 44% of normal (150px => 54px) */
.post-content img.random-asset {
  width: 54px !important;
  height: 54px !important;
}

/* Specific float-left class for left-aligned images */
.post-content img.float-left {
  float: left;
  margin: 8px 16px 12px 0; /* Enhanced margins for better text flow */
  shape-outside: margin-box; /* Better text wrapping */
}

/* Float-right images (explicit class) */
.post-content img.float-right {
  float: right;
  margin: 8px 0 12px 16px; /* Enhanced margins for better text flow */
  shape-outside: margin-box; /* Better text wrapping */
}

/* Hover effects for all images */
.post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Click-to-expand functionality for all images */
.post-content img:active {
  transform: scale(0.98);
}

/* Responsive behavior for mobile */
@media (max-width: 640px) {
  .post-content img {
    width: 120px !important;
    height: 120px !important;
  }
  .post-content img.random-asset {
    width: 42px !important; /* 35% of 120px (mobile proportional bump) */
    height: 42px !important;
  }
  
  .post-video-thumbnail {
    width: 120px !important;
    height: 120px !important;
  }
  
  .post-video-play-button {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
  }
  
  /* Hide star button on small mobile devices */
  .menu-star {
    display: none !important;
  }
}

/* Extra small mobile devices */
@media (max-width: 500px) {
  /* Ensure star button is completely hidden on very small screens */
  .menu-star {
    display: none !important;
  }
}

/* Ensure images at the bottom of posts have proper spacing */
.post-content img:last-of-type {
  margin-bottom: 20px; /* Add extra bottom margin for last image */
}

/* Clearfix utility class for floating elements */
.post-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Image preview overlay styles */
#image-preview-overlay {
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
  overflow: hidden; /* Prevent any content from extending beyond overlay */
  /* Ensure overlay is visible and clickable */
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

#image-preview-overlay img {
  transition: transform 0.2s ease;
  display: block; /* Ensure proper block display */
}

#image-preview-overlay img:hover {
  transform: scale(1.02);
}

/* Ensure image container properly constrains content */
#image-preview-overlay > div {
  overflow: hidden; /* Prevent image overflow */
  max-width: 100%;
  max-height: 100%;
  pointer-events: none; /* Allow clicks to pass through to overlay */
}

/* Ensure images can receive clicks */
#image-preview-overlay img {
  pointer-events: auto; /* Allow image clicks */
}

/* Video preview overlay styles */
#video-preview-overlay {
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
  overflow: hidden; /* Prevent any content from extending beyond overlay */
  /* Ensure overlay is visible and clickable */
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

#video-preview-overlay video {
  transition: transform 0.2s ease;
  display: block; /* Ensure proper block display */
}

#video-preview-overlay video:hover {
  transform: scale(1.02);
}

/* Ensure video container properly constrains content */
#video-preview-overlay > div {
  overflow: hidden; /* Prevent video overflow */
  max-width: 100%;
  max-height: 100%;
  pointer-events: none; /* Allow clicks to pass through to overlay */
}

/* Ensure videos can receive clicks */
#video-preview-overlay video {
  pointer-events: auto; /* Allow video clicks */
}

/* Ensure images in posts show they're clickable */
.post-content img {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clear-after {
  clear: both;
  height: 0;
  overflow: hidden;
} /* forces next block below floats */

/* Hover note tooltip */
.note-link {
  color: var(--link);
  text-decoration: underline;
  cursor: help;
  position: relative;
}

/* When note-link contains a URL, make it look clickable */
.note-link[data-note*="http"] {
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
}

.note-link[data-note*="http"]:hover {
  opacity: 0.8;
  text-decoration: underline;
}

#hoverNote {
  position: fixed;
  z-index: 1000;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 8px;
  min-width: 140px;
  max-width: 260px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 12px;
  color: var(--muted);
  display: none;
  box-shadow: none;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* New hover note syntax: [DISPLAY TEXT:HOVERNOTE CONTENT HERE] */
.hover-note {
  color: var(--accent);
  cursor: help;
  border-bottom: 1px dotted var(--accent);
  transition: color 0.2s;
}

.hover-note:hover {
  color: var(--fg);
}

/* Post media styling */
.post-media-content {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em 0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.post-media-content:hover {
  transform: scale(1.02);
}

/* Post image styling (backward compatibility) */
.post-image-content {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em 0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.post-image-content:hover {
  transform: scale(1.02);
}

/* Post video styling */
.post-video-content {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em 0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.post-video-content:hover {
  transform: scale(1.02);
}

/* Video thumbnail styling (in posts) */
.post-video-thumbnail {
  width: 120px !important;
  height: 120px !important;
  object-fit: cover;
  pointer-events: none; /* Disable video interaction in thumbnail */
}

/* Video wrapper for clickable thumbnail */
.post-video-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin: 1em 0;
  transition: transform 0.2s ease;
}

.post-video-wrapper:hover {
  transform: scale(1.02);
}

/* Play button overlay for video thumbnails */
.post-video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.post-video-wrapper:hover .post-video-play-button {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}

/* Image alignment classes */
.post-image-left {
  float: left;
  margin: 0 1em 1em 0;
  max-width: 50%;
}

.post-image-right {
  float: right;
  margin: 0 0 1em 1em;
  max-width: 50%;
}

/* Clear floats after images */
.post-image-left::after,
.post-image-right::after {
  content: "";
  display: table;
  clear: both;
}

/* PiousPigeon menu styling */
.menu-item[data-menu="pigeon"] > .label {
  font-family: monospace;
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
  user-select: none;
}

.menu-item[data-menu="pigeon"]:hover > .label {
  text-decoration: underline;
}

/* PiousPigeon dropdown positioning - anchor to right side and extend left */
.menu-item[data-menu="pigeon"] > .menu-dropdown {
  left: auto;
  right: 0;
  min-width: 200px;
}

/* Bottom-right logo slot */
#cornerGif {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  width: 100px;
  height: 100px;
  background: transparent center/contain no-repeat;
  opacity: .85;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure logo images scale properly within the container */
#cornerGif[style*="url(")] {
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

@media (max-width: 900px) {
  #cornerGif {
    width: 80px;
    height: 80px;
    right: 12px;
    bottom: 12px;
  }
}

/* Legacy modal styles - kept for potential future use */
.legacy-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
}

.legacy-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.close-btn {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 20px;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--accent);
}

/* Editor page styles */
textarea#editorContent {
  width: 750px;
  height: 400px;
  font-family: inherit;
  font-size: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #1e1e1e;
  color: #ffffff;
  resize: none;
}

.bold-button {
  background: none;
  border: none;
  font-weight: bold;
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
}

.bold-button:hover {
  text-decoration: underline;
}

/* Editor Modal Styles */
.editor-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.editor-modal-content {
  background-color: var(--bg);
  color: var(--fg);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid var(--border);
  width: 400px;
  max-width: 90%;
  border-radius: 5px;
}

.editor-modal-content h3 {
  margin-top: 0;
}

.editor-modal-content label {
  display: block;
  margin: 10px 0 5px 0;
  font-weight: bold;
}

.editor-modal-content input,
.editor-modal-content textarea,
.editor-modal-content select {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--fg);
  border-radius: 3px;
}

.editor-modal-content textarea {
  height: 80px;
  resize: vertical;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.add-btn, .delete-btn, .cancel-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.add-btn {
  background-color: var(--success-color, #28a745);
  color: var(--btn-text-color, white);
}

/* Dark mode add button */
body.dark-mode .add-btn {
  background-color: var(--success-color, #28a745);
  color: var(--btn-text-color, white);
}

.delete-btn {
  background-color: var(--danger-color, #dc3545);
  color: var(--btn-text-color, white);
}

/* Dark mode delete button */
body.dark-mode .delete-btn {
  background-color: var(--danger-color, #dc3545);
  color: var(--btn-text-color, white);
}

.cancel-btn {
  background-color: var(--border);
  color: var(--fg);
}

.add-btn:hover {
  background-color: var(--success-hover-color, #218838);
}

.delete-btn:hover {
  background-color: var(--danger-hover-color, #c82333);
}

.cancel-btn:hover {
  background-color: var(--muted, #999);
}

/* Drafts Page Styles */
.drafts-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}

.drafts-container h2 {
  color: var(--fg);
  margin-bottom: 30px;
  text-align: center;
}

.drafts-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.draft-item {
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.draft-info {
  flex-grow: 1;
}

.draft-title {
  font-weight: bold;
  color: var(--fg);
  margin-bottom: 5px;
  font-size: 16px;
}

.draft-preview {
  color: var(--muted, #666);
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 1.4;
}

.draft-meta {
  font-size: 12px;
  color: var(--muted, #666);
}

.draft-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 15px;
}

.draft-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--fg);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.draft-btn:hover {
  background-color: var(--border);
}

.draft-btn.delete {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

/* Dark mode draft delete button */
body.dark-mode .draft-btn.delete {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

.draft-btn.delete:hover {
  background-color: #c82333;
}

/* Note link styles */
.note-link {
  background-color: rgba(58, 123, 213, 0.2);
  padding: 2px 4px;
  border-radius: 3px;
  cursor: help;
  border-bottom: 1px dotted var(--accent);
}

.note-link:hover {
  background-color: rgba(58, 123, 213, 0.3);
}

/* Image modal styles for click-to-expand functionality */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.image-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.image-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.image-modal-title {
  font-weight: 600;
  color: var(--fg);
}

.image-modal-close {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.full-size-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.image-modal-footer {
  padding: 12px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* Responsive design for narrow screens (mobile) */
@media (max-width: 768px) {
  /* Hide Edit menu and star button on narrow screens */
  .menu-item[data-menu="edit"],
  .menu-star {
    display: none !important;
  }
  
  /* Condense Navigation text to 'Nav' */
  .menu-item[data-menu="navigation"] .label {
    font-size: 11px;
  }
  
  /* Adjust spacing for remaining menu items */
  .menu-item[data-menu="navigation"] {
    margin-left: 0;
  }
  
  .menu-item[data-menu="projects"] {
    margin-left: 0;
  }
  
  .menu-item[data-menu="view"] {
    margin-left: 0;
  }
  
  .menu-item[data-menu="connect"] {
    margin-left: 0;
  }
  
  /* Ensure PiousPigeon menu stays on the right */
  .menu-item[data-menu="pigeon"] {
    margin-left: auto;
  }
}


