/**
 * Dark Mode Theme Overrides
 * Color palette adjustments for dark mode
 *
 * @package Baffled_Architect
 * @since 1.0.0
 */

[data-theme="dark"] {
  /* Colors - Dark Mode */
  --color-primary: #f9fafb;
  --color-secondary: #d1d5db;
  --color-accent: #a78bfa;
  --color-accent-alt: #22d3ee;
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-link: #a78bfa;
  --color-link-hover: #c4b5fd;

  /* Adjusted shadows for dark mode */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* ========================================================================
   Plugin Compatibility - Dark Mode
   ======================================================================== */

/* MathJax equations in dark mode */
[data-theme="dark"] .MathJax,
[data-theme="dark"] .MathJax * {
  color: var(--color-primary) !important;
}

[data-theme="dark"] .MathJax_Display {
  background: var(--color-surface);
  border-left-color: var(--color-accent);
}

/* Prism syntax highlighting - Dark mode compatible */
[data-theme="dark"] pre[class*="language-"] {
  background: var(--color-surface) !important;
  border-color: var(--color-border);
}

[data-theme="dark"] code[class*="language-"] {
  color: #e2e8f0;
}

/* Prism token colors for dark mode */
[data-theme="dark"] .token.comment,
[data-theme="dark"] .token.prolog,
[data-theme="dark"] .token.doctype,
[data-theme="dark"] .token.cdata {
  color: #64748b;
}

[data-theme="dark"] .token.punctuation {
  color: #94a3b8;
}

[data-theme="dark"] .token.property,
[data-theme="dark"] .token.tag,
[data-theme="dark"] .token.boolean,
[data-theme="dark"] .token.number,
[data-theme="dark"] .token.constant,
[data-theme="dark"] .token.symbol,
[data-theme="dark"] .token.deleted {
  color: #fb923c;
}

[data-theme="dark"] .token.selector,
[data-theme="dark"] .token.attr-name,
[data-theme="dark"] .token.string,
[data-theme="dark"] .token.char,
[data-theme="dark"] .token.builtin,
[data-theme="dark"] .token.inserted {
  color: #4ade80;
}

[data-theme="dark"] .token.operator,
[data-theme="dark"] .token.entity,
[data-theme="dark"] .token.url,
[data-theme="dark"] .language-css .token.string,
[data-theme="dark"] .style .token.string {
  color: #38bdf8;
}

[data-theme="dark"] .token.atrule,
[data-theme="dark"] .token.attr-value,
[data-theme="dark"] .token.keyword {
  color: #c084fc;
}

[data-theme="dark"] .token.function,
[data-theme="dark"] .token.class-name {
  color: #38bdf8;
}

[data-theme="dark"] .token.regex,
[data-theme="dark"] .token.important,
[data-theme="dark"] .token.variable {
  color: #fb923c;
}

/* Line numbers in dark mode */
[data-theme="dark"] .line-numbers .line-numbers-rows {
  border-right-color: var(--color-border);
}

/* Inline code in dark mode */
[data-theme="dark"] :not(pre) > code[class*="language-"] {
  background: var(--color-surface);
  color: var(--color-accent);
}

/* ========================================================================
   Image Adjustments for Dark Mode
   ======================================================================== */

[data-theme="dark"] img {
  opacity: 0.9;
}

[data-theme="dark"] img:hover {
  opacity: 1;
}

/* ========================================================================
   Form Elements in Dark Mode
   ======================================================================== */

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-primary);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--color-secondary);
}

/* ========================================================================
   Accessibility in Dark Mode
   ======================================================================== */

[data-theme="dark"] .screen-reader-text:focus {
  background-color: var(--color-surface);
  color: var(--color-primary);
}

/* ========================================================================
   Selection Color in Dark Mode
   ======================================================================== */

[data-theme="dark"] ::selection {
  background-color: var(--color-accent);
  color: var(--color-background);
}

[data-theme="dark"] ::-moz-selection {
  background-color: var(--color-accent);
  color: var(--color-background);
}

/* ========================================================================
   Social Links in Dark Mode
   ======================================================================== */

[data-theme="dark"] .social-github:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

/* ========================================================================
   Scroll to Top Button in Dark Mode
   ======================================================================== */

[data-theme="dark"] .scroll-to-top {
  color: #0f172a;
}
