/* ===============================
   Dark Mode: Base Styling
   =============================== */
html.dark {
  background-color: #181818;
  color: #f4f4f9;
}

/* Headings & page titles */
html.dark h2,
html.dark .page-title {
  color: #f8f9fa;
}

/* Fallback <textarea> styling */
html.dark textarea {
  background-color: #2a2734;
  color: #f8f8f2;
}

/* QUICK GUIDE */
html.dark .quick-guide {
  color: #ccc;
}

/* COMPARE BUTTON CUSTOMIZATION DARK MODE */
html.dark #compareBtn {
  background: #3399ff; /* Brighter blue for dark backgrounds */
  color: #fff;
  border: none;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: background 0.3s ease, transform 0.1s ease;
}

html.dark #compareBtn:hover {
  background-color: #1a73e8;
  transform: scale(1.02);
}

html.dark #compareBtn:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

html.dark #compareBtn {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(51, 153, 255, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(51, 153, 255, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(51, 153, 255, 0.4);
  }
}

/* ===============================
   CodeMirror: Dark Theme Adjustments
   =============================== */

/* Base CodeMirror editor background */
html.dark .CodeMirror {
  background-color: #282a36;
  color: #f8f8f2;
  border: 1px solid #444;
  border-radius: 4px;
}

/* Cursor visibility */
html.dark .CodeMirror-cursor {
  border-left: 1px solid #f8f8f2;
}

/* Gutter (line numbers) */
html.dark .CodeMirror-gutters {
  background-color: #282a36 !important;
  border-right: 1px solid #444 !important;
  color: #ccc !important;
}

/* Line number contrast */
html.dark .CodeMirror-linenumber {
  color: #ccc !important;
}

/* Active line highlight */
html.dark .CodeMirror-activeline-background {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ===============================
   Word-level diff panel
   =============================== */
html.dark #wordDiff {
  background-color: #1e1e2f;
  color: #e0e0e0;
  border: 1px solid #444;
  padding: 1em;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
}

html.dark #wordDiff ins {
  background-color: #264f28;
  color: #a6e22e;
  text-decoration: none;
  padding: 0 2px;
  border-radius: 3px;
}

html.dark #wordDiff del {
  background-color: #5a1e2d;
  color: #ff6e6e;
  text-decoration: none;
  padding: 0 2px;
  border-radius: 3px;
}

html.dark #wordDiff span {
  color: #ccc;
}

/* ===============================
   Dracula-like Styling (if using cm-s-default)
   =============================== */
html.dark .cm-s-default {
  background-color: #282a36 !important;
  color: #f8f8f2 !important;
}

html.dark .cm-s-default .cm-variable   { color: #ffffff !important; }
html.dark .cm-s-default .cm-keyword    { color: #ff79c6 !important; }
html.dark .cm-s-default .cm-string     { color: #f1fa8c !important; }
html.dark .cm-s-default .cm-comment    { color: #6272a4 !important; font-style: italic; }
html.dark .cm-s-default .cm-number     { color: #bd93f9 !important; }
html.dark .cm-s-default .cm-attribute  { color: #50fa7b !important; }
html.dark .cm-s-default .cm-tag        { color: #ff79c6 !important; }
html.dark .cm-s-default .cm-def        { color: #8be9fd !important; }

/* ===============================
   MergeView Chunk Backgrounds
   =============================== */
html.dark .CodeMirror-merge-r-chunk,
html.dark .CodeMirror-merge-l-chunk {
  background-color: #3a3a3a !important;
}

html.dark .CodeMirror-merge-r-chunk-start,
html.dark .CodeMirror-merge-l-chunk-start {
  border-top: 1px solid #666;
}

html.dark .CodeMirror-merge-r-chunk-end,
html.dark .CodeMirror-merge-l-chunk-end {
  border-bottom: 1px solid #666;
}

/* ===============================
   Scrollbar Styling (WebKit)
   =============================== */
html.dark ::-webkit-scrollbar {
  width: 8px;
}

html.dark ::-webkit-scrollbar-track {
  background: #1e1e2f;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.dark .homepage-seo-content {
  background-color: #1c1c1c;
  color: #e0e0e0;
  border: 1px solid #333;
}

.dark .homepage-seo-content a {
  color: #66b3ff;
}

.dark .homepage-seo-content h1,
.dark .homepage-seo-content h2,
.dark .homepage-seo-content h3 {
  color: #fff;
}


html.dark .perf-time {
  color: #ccc; /* Light gray for visibility on dark backgrounds */
}

html.dark .intro-blurb {
  color: #ccc;
}