/* ==========================================================================
   Dark Mode — NexusTheme
   Applied when html has .nx-dark class
   ========================================================================== */

.nx-dark {
  --nx-bg: #121218;
  --nx-bg-card: #1c1c26;
  --nx-bg-card-hover: #24242e;
  --nx-bg-header: #1c1c26;
  --nx-bg-footer: #0a0a10;
  --nx-bg-sidebar: #1c1c26;
  --nx-bg-code: #16161e;
  --nx-bg-input: #1c1c26;

  --nx-text: #e4e4e8;
  --nx-text-secondary: #a0a0b0;
  --nx-text-muted: #6c6c7c;
  --nx-text-inverse: #121218;

  --nx-border: #2a2a38;
  --nx-border-light: #1e1e2a;
  --nx-border-input: #3a3a4a;

  --nx-shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --nx-shadow: 0 2px 8px rgba(0,0,0,0.5);
  --nx-shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --nx-shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --nx-shadow-card: 0 1px 4px rgba(0,0,0,0.3);
  --nx-shadow-card-hover: 0 4px 20px rgba(0,0,0,0.5);
}

/* Smooth transition between modes */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body, .nx-header, .nx-post-card, .nx-widget, .nx-author-box,
.nx-related-card, .nx-toc, .nx-review-box, .nx-footer {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Dark mode icon swap */
.nx-dark .nx-icon-moon { display: none !important; }
.nx-dark .nx-icon-sun { display: inline !important; }

/* Image brightness reduction in dark mode */
.nx-dark .nx-entry-content img,
.nx-dark .nx-post-card__thumb img,
.nx-dark .nx-related-card img {
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

.nx-dark .nx-entry-content img:hover,
.nx-dark .nx-post-card__thumb img:hover {
  filter: brightness(1);
}

/* Code blocks in dark mode */
.nx-dark pre,
.nx-dark code {
  background: #0d0d14;
  border-color: #2a2a38;
}

.nx-dark code {
  color: #60a5fa;
}

/* Blockquote */
.nx-dark blockquote {
  background: rgba(197, 165, 90, 0.08);
  border-left-color: var(--nx-primary);
}

/* Search overlay */
.nx-dark .nx-search-overlay input {
  background: #1c1c26;
  color: #e4e4e8;
}

/* Verified badge */
.nx-dark .nx-verified-badge {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.15);
}

/* Pros/Cons in dark mode */
.nx-dark .nx-pros-cons__col--pros {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.12);
}

.nx-dark .nx-pros-cons__col--cons {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.12);
}

/* Selection color */
.nx-dark ::selection {
  background: var(--nx-primary);
  color: #fff;
}

/* Scrollbar */
.nx-dark ::-webkit-scrollbar {
  width: 10px;
}
.nx-dark ::-webkit-scrollbar-track {
  background: #121218;
}
.nx-dark ::-webkit-scrollbar-thumb {
  background: #2a2a38;
  border-radius: 5px;
}
.nx-dark ::-webkit-scrollbar-thumb:hover {
  background: #3a3a4a;
}

/* WordPress admin bar compatibility */
.nx-dark .admin-bar .nx-header {
  top: 32px;
}

@media (max-width: 782px) {
  .nx-dark .admin-bar .nx-header {
    top: 46px;
  }
}
