/**
 * CSS custom properties (aka variables).
 */

:root {
  --body-main-text-size: 0.9rem;
  --color-white: #fff;
  --color-grey-50: #111;
  --color-grey-100: #262626;
  --color-grey-200: #333;
  --color-grey-300: #444;
  --color-grey-325: #555;
  --color-grey-350: #565d64;
  --color-grey-400: #666;
  --color-grey-500: #777;
  --color-grey-600: #999;
  --color-grey-700: #cbcbcb;
  --color-grey-750: #ddd;
  --color-grey-800: #e0e0e0;
  --color-grey-850: #eee;
  --color-grey-900: #f2f2f2;
  --color-black: #000;
  --color-dark-red: #a00;
  --color-light-red: #dd0000;

  --color-background-page: var(--color-grey-100);
  --color-background-gradient-first: #5ad8f7;
  --color-background-gradient-second: #2f50af;
  --color-background-gradient-third: #9150bf;
  --color-background: var(--color-white);
  --color-text: var(--color-grey-200);
  --color-link: #1b98f8;
  --color-menu-accent: #ed5900;
  --color-background-code: var(--color-grey-850);
  --color-error: var(--color-dark-red);
  --color-error-input: #ffebeb;
  --color-error-list: var(--color-light-red);
  --color-table-background: var(--color-background);
  --color-table-stripe: var(--color-grey-900);

  --watchlist-row-selected: #e3f0ff; // light blue highlight for checkbox-selected rows
  --watchlist-row-hover: #f2f2f2;     // light grey highlight on row hover

  --color-text-tab: var(--color-white);
  --color-background-tab: rgba(255, 255, 255, 0.2);
  --color-background-tab-hover: rgba(255, 255, 255, 0.5);
  --color-text-tab-active: #222;
  --color-api-key: #0078e7;

  --color-background-button-primary: #0078e7;
  --color-background-button-green: #42dd53;
  --color-background-button-red: #dd4242;
  --color-background-button-success: rgb(28, 184, 65);
  --color-background-button-error: rgb(202, 60, 60);
  --color-text-button-error: var(--color-white);
  --color-background-button-warning: rgb(202, 60, 60);
  --color-text-button-warning: var(--color-white);
  --color-background-button-secondary: rgb(66, 184, 221);
  --color-background-button-cancel: rgb(200, 200, 200);
  --color-text-button: var(--color-white);
  --color-background-button-tag: rgb(99, 99, 99);
  --color-background-snapshot-age: #dfdfdf;
  --color-error-text-snapshot-age: var(--color-white);
  --color-error-background-snapshot-age: #ff0000;
  --color-background-button-tag-active: #9c9c9c;

  --color-text-messages: var(--color-white);
  --color-background-messages-message: rgba(255, 255, 255, .2);
  --color-background-messages-error: rgba(255, 1, 1, .5);
  --color-background-messages-notice: rgba(255, 255, 255, .5);
  --color-border-notification: #ccc;

  --color-background-checkbox-operations: rgba(0, 0, 0, 0.05);
  --color-warning: #ff3300;
  --color-border-warning: var(--color-warning);
  --color-text-legend: var(--color-white);

  --color-link-new-version: #e07171;
  --color-last-checked: #bbb;
  --color-text-footer: #444;
  --color-border-watch-table-cell: #eee;

  --color-text-watch-tag-list: rgba(231, 0, 105, 0.4);
  --color-background-new-watch-form: rgba(0, 0, 0, 0.05);
  --color-background-new-watch-input: var(--color-white);
  --color-background-new-watch-input-transparent: rgba(255, 255, 255, 0.1);
  --color-text-new-watch-input: var(--color-text);

  --color-border-input: var(--color-grey-500);
  --color-shadow-input: var(--color-grey-400);
  --color-background-input: var(--color-white);
  --color-text-input: var(--color-text);
  --color-text-input-description: var(--color-grey-500);
  --color-text-input-placeholder: var(--color-grey-600);

  --color-background-table-thead: var(--color-grey-800);
  --color-border-table-cell: var(--color-grey-700);

  --color-text-menu-heading: var(--color-white);
  --color-text-menu-link: var(--color-grey-500);
  --color-background-menu-link-hover: var(--color-grey-850);
  --color-text-menu-link-hover: var(--color-grey-300);

  --color-shadow-jump: var(--color-grey-500);
  --color-icon-github: var(--color-black);

  --color-watch-table-error: var(--color-dark-red);
  --color-watch-table-row-text: var(--color-grey-100);
  --color-table-line: #e7e9ee;

  --highlight-trigger-text-bg-color: #1b98f8;
  --highlight-ignored-text-bg-color: var(--color-grey-700);
  --highlight-blocked-text-bg-color: rgb(202, 60, 60);

  // Left rail — light mode defaults
  --color-sidebar-bg: rgba(255, 255, 255, 0.97);
  --color-sidebar-text: var(--color-text);
  --color-sidebar-shadow: 6px 0 28px rgba(0, 0, 0, 0.18);
  --color-sidebar-item-hover-bg: rgba(0, 0, 0, 0.06);
  --color-sidebar-item-active-bg: rgba(0, 0, 0, 0.10);

  --common-round-border: 8px;
}

html[data-darkmode="true"] {
  --color-link: #59bdfb;
  --color-text: var(--color-white);
  --color-table-line: #262c37;
  --color-background-gradient-first: #3f90a5;
  --color-background-gradient-second: #1e316c;
  --color-background-gradient-third: #4d2c64;

  --color-background-new-watch-input: var(--color-grey-100);
  --color-background-new-watch-input-transparent: var(--color-grey-100);
  --color-text-new-watch-input: var(--color-text);
  --color-background-table-thead: var(--color-grey-200);
  --color-table-background: var(--color-grey-300);
  --color-table-stripe: var(--color-grey-325);

  --watchlist-row-selected: #1e3a5f; // darker blue highlight for selected rows in dark mode
  --watchlist-row-hover: #2a2a2a;     // subtle grey highlight on row hover (dark mode)

  --color-background: var(--color-grey-300);
  --color-text-menu-heading: var(--color-grey-850);
  --color-text-menu-link: var(--color-grey-800);
  --color-border-table-cell: var(--color-grey-400);
  --color-text-tab-active: var(--color-text);

  --color-border-input: var(--color-grey-400);
  --color-shadow-input: var(--color-grey-50);
  --color-background-input: var(--color-grey-350);
  --color-text-input-description: var(--color-grey-600);
  --color-text-input-placeholder: var(--color-grey-600);
  --color-text-watch-tag-list: rgba(250, 62, 146, 0.4);
  --color-background-code: var(--color-grey-200);

  --color-background-tab: rgba(0, 0, 0, 0.2);
  --color-background-tab-hover: rgba(0, 0, 0, 0.5);

  --color-background-snapshot-age: var(--color-grey-200);
  --color-shadow-jump: var(--color-grey-200);
  --color-icon-github: var(--color-white);
  --color-watch-table-error: var(--color-light-red);
  --color-watch-table-row-text: var(--color-grey-800);

  // Left rail — dark mode overrides
  --color-sidebar-bg: rgba(8, 10, 14, 0.97);
  --color-sidebar-text: var(--color-white);
  --color-sidebar-shadow: 6px 0 28px rgba(0, 0, 0, 0.45);
  --color-sidebar-item-hover-bg: rgba(255, 255, 255, 0.06);
  --color-sidebar-item-active-bg: rgba(255, 255, 255, 0.10);

  .icon-spread {
    filter: hue-rotate(-10deg) brightness(1.5);
  }

  .watch-table {

    .title-col a[target="_blank"]::after,
    .current-diff-url::after {
      filter: invert(.5) hue-rotate(10deg) brightness(2);
    }

    .status-browsersteps {
      filter: invert(.5) hue-rotate(10deg) brightness(1.5);
    }

    .watch-controls {
      .state-off {
        svg {
          opacity: 0.3;
        }
      }
      .state-on {
        svg {
          opacity: 1.0;
        }
      }
    }

    .unviewed {
      color: #fff;
      &.error {
        color: var(--color-watch-table-error);
      }
    }
  }
}
