
/* Base Styling */
.modern-theme body {
  font-family: 'Raleway', Arial;
  background-color: #f9fafb;
  color: #333;
  text-align: center; /* Center all text */
  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* Title */
.modern-theme #title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(45deg, #ff3cac, #784ba0, #2b86c5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 20px 0;
}

/* Subtitle */
.modern-theme #subtitle {
  font-size: 1.25rem;
  color: #888;
  margin-bottom: 40px;
}

/* Navbar Styling */
.modern-theme #navbar ul {
  list-style-type: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modern-theme #navbar li {
  margin: 0 15px;
  position: relative; /* Position relative for dropdowns */
}

.modern-theme #navbar a {
  display: inline-block;
  padding: 12px 20px;
  font-weight: 600;
  text-transform: uppercase;
  color: #555;
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.modern-theme #navbar a:hover {
  background-color: #f0f0f0;
  color: #2b86c5;
}

/* Dropdown Menu */
.modern-theme #navbar .dropdown {
  display: none; /* Hide dropdowns by default */
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.modern-theme #navbar li:hover .dropdown {
  display: block; /* Show dropdown on hover */
}

.modern-theme #navbar .dropdown a {
  display: block;
  padding: 10px 15px;
  color: #555;
  transition: background-color 0.3s;
}

.modern-theme #navbar .dropdown a:hover {
  background-color: #e0e0e0;
}

.modern-theme #saving-pop {
  color: dimgray;
}

/* Editor Container */
.modern-theme #editor-container {
  width: 80%;
  max-width: 1200px;
  margin: auto;
  padding: 20px;
  border: 2px solid #e5e7eb;
  border-radius: 15px;
  background-color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center; /* Center content */
  transition: transform 0.3s ease;
}

/* Toolbar */
.modern-theme #toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 6px;
  margin-bottom: 10px;
}

.modern-theme #toolbar button {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background-color: #e5e7eb;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modern-theme #toolbar button:hover {
  background-color: #2b86c5;
  color: #ffffff;
  transform: scale(1.05);
}

.modern-theme #toolbar button i {
  margin-right: 0 auto; /* Space for icons */
}

/* Editor */
.modern-theme #editor {
  min-height: 300px;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background-color: #f9fafb;
  font-size: 1rem;
  color: #333;
  outline: none;
  text-align: left;
}

.modern-theme .menu {
  position: fixed; /* better than absolute for screen bounds */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: min(90vw, 420px); 
  max-height: 80vh; 

  padding: 20px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);

  overflow-y: auto; 
  overscroll-behavior: contain;

  z-index: 1000;
  display: none;

  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.modern-theme .menu h3 {
  top: 0;

  margin: -20px -20px 15px -20px;
  padding: 15px 20px;

  font-size: 1.4rem;
  text-align: center;
  color: #2b86c5;

  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;

  z-index: 1;
}

.modern-theme .menu .ending-section {
  bottom: 0;

  margin: 0px -20px 5px -20px;
  padding: 15px 20px;

  font-size: 1.4rem;
  text-align: center;
  color: #2b86c5;

  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
  z-index: 1;
}

.modern-theme .menu button {
  display: block;
  width: 100%;

  padding: 12px 16px;
  margin: 6px 0;

  border: none;
  border-radius: 8px;

  background-color: #e5e7eb;
  color: #333;

  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.15s ease;
}

.modern-theme .menu button:hover {
  background-color: #2b86c5;
  color: #ffffff;
  transform: scale(1.03);
}

.modern-theme .menu .menu-section {
  margin-bottom: 15px;
  border: #e5e7eb;
}

.modern-theme .menu .menu-section-title {
  font-size: 0.9999rem;
  font-weight: bold;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 10px 0 15px;
}

/* Overlay */
.modern-theme #overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
}

/* Light/Dark Themes */
.modern-theme {
  background-color: #ffffff;
  color: #333;
}

/* Codeblock */


.modern-theme .codeblock {
  padding: 12px 14px;
  background: transparent;
}
/* Animations */
.modern-theme #editor-container {
  transition: transform 0.3s ease;
}

.modern-theme #editor-container:hover {
  transform: scale(1.01);
}



/* Input Fields and Selectors */
.modern-theme input[type="checkbox"],
.modern-theme select {
  width: auto; /* Full width for inputs */
  padding: 10px;
  margin: 15px 0;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  font-size: 1rem;
  outline: none;
  transition: border 0.3s ease;
}

.modern-theme input[type="checkbox"]:checked {
  accent-color: #2b86c5; /* Custom color for checked checkboxes */
}



/* Overlay */
.modern-theme #overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
}

.modern-theme .highlight {
  font-weight: bold;
  background: linear-gradient(90deg, #ff3cac, #784ba0, #2b86c5);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: highlightAnimation 3s ease infinite;
}

.modern-theme .current-highlight {
  font-weight: bold;
  background: linear-gradient(90deg, #A73CFF, #A04B6F, #2BC585);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: highlightAnimation 3s ease infinite;
}

@keyframes highlightAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Custom scrollbar styling */
.modern-theme #plugin-controls::-webkit-scrollbar {
  width: none;
}

.modern-theme #plugin-controls::-webkit-scrollbar-thumb {
  background-color: #C4C4C4;
  border-radius: 5px;
}

.modern-theme #plugin-controls::-webkit-scrollbar-thumb:hover {
  background-color: #A9A9A9;
}

.modern-theme #plugin-controls::-webkit-scrollbar-track {
  background-color: #E0E0E0;
  border-radius: 5px;
}

/* ===============================
   Snapshot System Styling
   =============================== */
/* Snapshot menu container */
.modern-theme #snapshotMenu {
  margin-top: 20px;
  text-align: left;
  border-left: 3px solid #e5e7eb;
  padding-left: 16px;
}

/* Snapshot card */
.modern-theme .snapshot-item {
  position: relative;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);

  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;

  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Timeline dot */
.modern-theme .snapshot-item::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #2b86c5;
  border-radius: 50%;
  left: -22px;
  top: 20px;
}

/* Hover effect */
.modern-theme .snapshot-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

/* Snapshot title */
.modern-theme .snapshot-item strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2b86c5;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

/* Pinned snapshot */
.modern-theme .snapshot-item.pinned {
  border: 2px solid #f59e0b;
  background: linear-gradient(180deg, #fff7ed, #fef3c7);
}

.modern-theme .snapshot-item.pinned::before {
  background: #f59e0b;
}

/* Metadata row */
.modern-theme .snapshot-meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
}

/* Action buttons row */
.modern-theme .snapshot-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Icon-only buttons */
.modern-theme .snapshot-actions button {
  padding: 8px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.modern-theme .snapshot-item button {
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background-color: #e5e7eb;
  transition: all 0.25s ease;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  margin-right: 0 auto;
}

/* Button hover */
.modern-theme .snapshot-item button:hover {
  transform: scale(1.05);
}

/* Restore button */
.modern-theme .snapshot-item button.restore {
  background: #dcfce7;
  color: #166534;
}

.modern-theme .snapshot-item button.restore:hover {
  background: #22c55e;
  color: #ffffff;
}

/* Delete button */
.modern-theme .snapshot-item button.delete {
  background: #fee2e2;
  color: #991b1b;
}

.modern-theme .snapshot-item button.delete:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Pin button */
.modern-theme .snapshot-item button.pin {
  background-color: #fde68a;
  color: #92400e;
}

.modern-theme .snapshot-item button.pin:hover {
  background-color: #f59e0b;
  color: #ffffff;
}

/* Keyboard accessibility */
.modern-theme .snapshot-item button:focus-visible {
  outline: 3px solid #2b86c5;
  outline-offset: 2px;
}

/* Create snapshot button */
.modern-theme #createSnapshotBtn {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 10px;
  background: linear-gradient(45deg, #ff3cac, #784ba0, #2b86c5);
  color: #ffffff;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.modern-theme #createSnapshotBtn:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* Filtering toggle */
.modern-theme #enableFiltering {
  margin-right: 10px;
  transform: scale(1.2);
}


/* ALERT FUCKASS ALERT */
.modern-theme input,
.modern-theme textarea,
.modern-theme select {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  padding: 10px 14px;
  margin: 6px 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background-color: #ffffff;
  color: #333;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  width: 100%; /* full-width by default */
  box-sizing: border-box;
}

/* Focus state */
.modern-theme input:focus,
.modern-theme textarea:focus,
.modern-theme select:focus {
  border-color: #2b86c5;
  box-shadow: 0 4px 12px rgba(43, 134, 197, 0.3);
}

/* Placeholder color */
.modern-theme input::placeholder,
.modern-theme textarea::placeholder {
  color: #888;
  opacity: 1;
}

/* Disabled state */
.modern-theme input:disabled,
.modern-theme textarea:disabled,
.modern-theme select:disabled {
  background-color: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
}

/* Buttons inside forms (optional consistency) */
.modern-theme input[type="submit"],
.modern-theme input[type="button"] {
  background: linear-gradient(45deg, #ff3cac, #784ba0, #2b86c5);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modern-theme input[type="submit"]:hover,
.modern-theme input[type="button"]:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(43, 134, 197, 0.3);
}

.sister-features {
  display: flex;
  padding: 6px;
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);

 /* box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 2px 6px rgba(0, 0, 0, 0.35);
    */
  position: relative;
}

#chapterList {
  padding: 10px;
  background: #151515;
  border-bottom: 1px solid #333;
}

.chapterItem {
  padding: 6px 4px;
  border-left: 3px solid #444;
  margin-bottom: 4px;
  cursor: pointer;
}

.chapterItem.active {
  border-left-color: #0af;
}

#update-badge {
  display: none;
  min-width: 44px;
  min-height: 44px;
  position: fixed;
  bottom: 12px;
  right: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: bold;
  margin: 6px 0;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  align-items: center;
  justify-content: center; 
  transition:
    background-color 0.25s ease,
    transform 0.15s ease;
}

.modern-theme #update-badge {
  background-color: #e5e7eb;
  color: #333;
}

#update-badge:hover {
  transform: scale(1.05);
}
.modern-theme #update-badge:hover {
  background-color: #2b86c5;
  color: #ffffff;
}

#update-badge i {
  font-size: 2rem;
}

#update-modal pre {
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}


.modern-theme .toolbar-remap {
  position: relative;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 12px;

  background-color: #f9fafb;
  border: 1px solid #e5e7eb;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);

  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;

  /* section behavior */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modern-theme .toolbar-remap .section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.modern-theme .toolbar-remap .tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 10px;
}

.modern-theme .toolbar-remap .tool-btn {
  position: relative;
  height: 40px;

  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  color: #374151;
}

.modern-theme .toolbar-remap .tool-toggle {
  position: absolute;
  top: -6px;
  right: -6px;

  width: 18px;
  height: 18px;
  border-radius: 50%;

  background: #ffffff;
  border: 1px solid #e5e7eb;

  font-size: 11px;
  color: #6b7280;

  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-theme .toolbar-remap .tool-hidden {
  opacity: 0.45;
  filter: grayscale(0.7);
}

.modern-theme .toolbar-remap .section-hint {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Toolbar-only hidden state */
#toolbar .tool-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.status-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'Raleway';
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  user-select: none;
}

.status-bar span {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.status-bar span:hover {
  opacity: 1;
}


#keyword-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
/* overlay for km */
.km-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.km-panel {
  position: relative;
  width: 320px;
  margin: 15vh auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

.km-panel label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-size: 12px;
  font-family: 'Raleway';
}


.km-preview {
  font-size: 12px;
  opacity: .8;
}

.km-actions button {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background-color: #e5e7eb;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.km-actions button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(43, 134, 197, 0.3);
}