/* =========================================
   MohakTools — Global Theme System
   File: assets/css/themes.css
   ========================================= */

:root {
  color-scheme: light;

  /* Brand colors */
  --color-primary: #0b6f83;
  --color-primary-hover: #07586b;
  --color-primary-text: #ffffff;

  /* Light theme */
  --color-bg: #f5f5ef;
  --color-surface: #fffefa;
  --color-surface-secondary: #edf1e9;
  --color-text: #202924;
  --color-text-secondary: #55625b;
  --color-border: #dce2d8;

  /* Feedback colors */
  --color-success: #15803d;
  --color-warning: #a16207;
  --color-danger: #dc2626;
  --color-info: #0369a1;

  /* Components */
  --color-input-bg: #fffefa;
  --color-input-border: #cbd5ce;
  --color-card-shadow: rgb(25 45 37 / 7%);
  --color-overlay: rgb(15 23 42 / 50%);

  /* Shared appearance */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* Explicit light mode */
html[data-theme="light"] {
  color-scheme: light;

  --color-bg: #f5f5ef;
  --color-surface: #fffefa;
  --color-surface-secondary: #edf1e9;
  --color-text: #202924;
  --color-text-secondary: #55625b;
  --color-border: #dce2d8;

  --color-input-bg: #fffefa;
  --color-input-border: #cbd5ce;
  --color-card-shadow: rgb(25 45 37 / 7%);
  --color-overlay: rgb(15 23 42 / 50%);
}


/* Explicit dark mode */
html[data-theme="dark"] {
  color-scheme: dark;

  /* Brand colors — neutral, accessible dark theme */
  --color-primary: #5cc6e2;
  --color-primary-hover: #88dbee;
  --color-primary-text: #05303d;

  /* Dark theme — neutral charcoal palette */
  --color-bg: #131b18;
  --color-surface: #1c2722;
  --color-surface-secondary: #25332d;
  --color-text: #f2f4ed;
  --color-text-secondary: #b6c2ba;
  --color-border: #35443c;

  /* Feedback colors */
  --color-success: #75d6a0;
  --color-warning: #f4d27d;
  --color-danger: #ff8b83;
  --color-info: #8ed8df;

  /* Components */
  --color-input-bg: #17211d;
  --color-input-border: #3b4c43;
  --color-card-shadow: rgb(0 0 0 / 24%);
  --color-overlay: rgb(0 0 0 / 72%);
}

/* System preference: dark */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;

    /* Brand colors — neutral, accessible dark theme */
    --color-primary: #5cc6e2;
    --color-primary-hover: #88dbee;
    --color-primary-text: #05303d;

    /* Dark theme — neutral charcoal palette */
    --color-bg: #131b18;
    --color-surface: #1c2722;
    --color-surface-secondary: #25332d;
    --color-text: #f2f4ed;
    --color-text-secondary: #b6c2ba;
    --color-border: #35443c;

    /* Feedback colors */
    --color-success: #75d6a0;
    --color-warning: #f4d27d;
    --color-danger: #ff8b83;
    --color-info: #8ed8df;

    /* Components */
    --color-input-bg: #17211d;
    --color-input-border: #3b4c43;
    --color-card-shadow: rgb(0 0 0 / 24%);
    --color-overlay: rgb(0 0 0 / 72%);
  }
}


/* Global accent customization */
html[data-accent="blue"] {
  --color-primary: #0b6f83;
  --color-primary-hover: #07586b;
}

html[data-accent="purple"] {
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
}

html[data-accent="green"] {
  --color-primary: #059669;
  --color-primary-hover: #047857;
}

html[data-accent="orange"] {
  --color-primary: #ea580c;
  --color-primary-hover: #c2410c;
}

html[data-accent="pink"] {
  --color-primary: #db2777;
  --color-primary-hover: #be185d;
}

/* Smooth theme transitions */
html {
  background-color: var(--color-bg);
}

body,
header,
footer,
main,
section,
article,
.card,
.tool-card,
input,
textarea,
select,
button {
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}