/*
 * The main dark mode styles
 */

@mixin dark-scheme {
  /* Framework color */
  --main-bg: rgb(27, 27, 30);
  --mask-bg: rgb(68, 69, 70);
  --main-border-color: rgb(44, 45, 45);

  /* Common color */
  --text-color: rgb(175, 176, 177);
  --text-muted-color: #868686;
  --heading-color: #cccccc;
  --label-color: #a7a7a7;
  --blockquote-border-color: rgb(66, 66, 66);
  --blockquote-text-color: #868686;
  --link-color: rgb(138, 180, 248);
  --link-underline-color: rgb(82, 108, 150);
  --button-bg: #1e1e1e;
  --btn-border-color: #2e2f31;
  --btn-backtotop-color: var(--text-color);
  --btn-backtotop-border-color: #212122;
  --btn-box-shadow: var(--main-bg);
  --card-header-bg: #292929;
  --checkbox-color: rgb(118, 120, 121);
  --checkbox-checked-color: var(--link-color);
  --img-bg: radial-gradient(circle, rgb(22, 22, 24) 0%, rgb(32, 32, 32) 100%);
  --shimmer-bg: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(58, 55, 55, 0.4) 50%,
      rgba(255, 255, 255, 0) 100%
  );

  /* Sidebar */
  --site-title-color: #717070;
  --site-subtitle-color: #868686;
  --sidebar-bg: #1e1e1e;
  --sidebar-border-color: #292929;
  --sidebar-muted-color: #868686;
  --sidebar-active-color: rgb(255, 255, 255, 0.95);
  --sidebar-hover-bg: #262626;
  --sidebar-btn-bg: #232328;
  --sidebar-btn-color: #787878;
  --avatar-border-color: rgb(206, 206, 206, 0.9);

  /* Topbar */
  --topbar-bg: rgb(27, 27, 30, 0.64);
  --topbar-text-color: var(--text-color);
  --search-border-color: rgb(55, 55, 55);
  --search-icon-color: rgb(100, 102, 105);
  --input-focus-border-color: rgb(112, 114, 115);

  /* Home page */
  --post-list-text-color: rgb(175, 176, 177);
  --btn-patinator-text-color: var(--text-color);
  --btn-paginator-hover-color: #2e2e2e;

  /* Posts */
  --toc-highlight: rgb(116, 178, 243);
  --tag-hover: rgb(43, 56, 62);
  --tb-odd-bg: #252526; /* odd rows of the posts' table */
  --tb-even-bg: rgb(31, 31, 34); /* even rows of the posts' table */
  --tb-border-color: var(--tb-odd-bg);
  --footnote-target-bg: rgb(63, 81, 181);
  --btn-share-color: #6c757d;
  --btn-share-hover-color: #bfc1ca;
  --card-bg: #1e1e1e;
  --card-hovor-bg: #464d51;
  --card-shadow: rgb(21, 21, 21, 0.72) 0 6px 18px 0,
  rgb(137, 135, 135, 0.24) 0 0 0 1px;
  --kbd-wrap-color: #6a6a6a;
  --kbd-text-color: #d3d3d3;
  --kbd-bg-color: #242424;
  --prompt-text-color: rgb(216, 212, 212, 0.75);
  --prompt-tip-bg: rgb(22, 60, 36, 0.64);
  --prompt-tip-icon-color: rgb(15, 164, 15, 0.81);
  --prompt-info-bg: rgb(7, 59, 104, 0.8);
  --prompt-info-icon-color: #0075d1;
  --prompt-warning-bg: rgb(90, 69, 3, 0.88);
  --prompt-warning-icon-color: rgb(255, 165, 0, 0.8);
  --prompt-danger-bg: rgb(86, 28, 8, 0.8);
  --prompt-danger-icon-color: #cd0202;

  /* tags */
  --tag-border: rgb(59, 79, 88);
  --tag-shadow: rgb(32, 33, 33);
  --dash-color: rgb(63, 65, 68);
  --search-tag-bg: #292828;

  /* categories */
  --categories-border: rgb(64, 66, 69, 0.5);
  --categories-hover-bg: rgb(73, 75, 76);
  --categories-icon-hover-color: white;

  /* archives */
  --timeline-node-bg: rgb(150, 152, 156);
  --timeline-color: rgb(63, 65, 68);
  --timeline-year-dot-color: var(--timeline-color);

  /* Plugin-Search-Widget */
  --halo-search-widget-color-modal-layer: rgba(10, 11, 12, 0.8);
  --halo-search-widget-color-modal-content-bg: rgb(27, 27, 30);
  --halo-search-widget-color-form-input: #afb0b1;
  --halo-search-widget-color-form-input-placeholder: #868686;
  --halo-search-widget-color-form-input-bg: rgb(27, 27, 30);
  --halo-search-widget-color-form-divider: #292929;
  --halo-search-widget-color-result-item-bg: #232323;
  --halo-search-widget-color-result-item-hover-bg: #2b3033;
  --halo-search-widget-color-result-item-title: #afb0b1;
  --halo-search-widget-color-result-item-content: #868686;
  --halo-search-widget-color-command-kbd-item: #868686;
  --halo-search-widget-color-command-kbd-border: #868686;
  --halo-search-widget-color-result-empty: #868686;

  /* Plugin-Comment-Widget */
  --halo-comment-widget-base-color: #adbac7;
  --halo-comment-widget-base-info-color: #64748b;
  --halo-comment-widget-component-form-input-bg-color: #22272e;
  --halo-comment-widget-component-form-input-color: #afb0b1;
  --halo-comment-widget-component-form-input-border-color: #444c56;
  --halo-comment-widget-component-form-input-border-color-focus: #65a3ff;
  --halo-comment-widget-component-form-input-box-shadow-focus: 0 0 0 0.15em #1c3966;
  --halo-comment-widget-component-form-button-login-bg-color: #22272e;
  --halo-comment-widget-component-form-button-login-bg-color-hover: #22222c;
  --halo-comment-widget-component-form-button-login-border-color: #475569;
  --halo-comment-widget-component-form-button-submit-bg-color: #347d39;
  --halo-comment-widget-component-form-button-submit-border-color: #cdd9e51a;
  --halo-comment-widget-component-form-button-submit-border-color-hover: #cdd9e51a;
  --halo-comment-widget-component-form-button-emoji-color: #adbac7;

  --halo-comment-widget-component-comment-item-action-bg-color-hover: #475569;
  --halo-comment-widget-component-comment-item-action-color-hover: #94a3b8;

  --halo-comment-widget-component-pagination-button-bg-color-hover: #475569;
  --halo-comment-widget-component-pagination-button-bg-color-active: #475569;
  --halo-comment-widget-component-pagination-button-border-color-active: #475569;

  --halo-comment-widget-component-emoji-picker-rgb-color: 222, 222, 221;
  --halo-comment-widget-component-emoji-picker-rgb-accent: 58, 130, 247;
  --halo-comment-widget-component-emoji-picker-rgb-background: 21, 22, 23;
  --halo-comment-widget-component-emoji-picker-rgb-input: 0, 0, 0;
  --halo-comment-widget-component-emoji-picker-color-border: rgba(255, 255, 255, 0.1);
  --halo-comment-widget-component-emoji-picker-color-border-over: rgba(255, 255, 255, 0.2);

  .light {
    display: none;
  }

  hr {
    border-color: var(--main-border-color);
  }

  /* categories */
  .categories.card,
  .list-group-item {
    background-color: var(--card-bg);
  }

  .categories {
    .card-header {
      background-color: var(--card-header-bg);
    }

    .list-group-item {
      border-left: none;
      border-right: none;
      padding-left: 2rem;
      border-color: var(--categories-border);

      &:last-child {
        border-bottom-color: var(--card-bg);
      }
    }
  }

  #archives li:nth-child(odd) {
    background-image: linear-gradient(
        to left,
        rgb(26, 26, 30),
        rgb(39, 39, 45),
        rgb(39, 39, 45),
        rgb(39, 39, 45),
        rgb(26, 26, 30)
    );
  }

  color-scheme: dark;

  /* stylelint-disable-next-line selector-id-pattern */
  #disqus_thread {
    color-scheme: none;
  }
}

/* dark-scheme */
