/* ----------------------------------------- */
/* Map v1 styling to v2 values               */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="dark"] {
  // --color-shadow-primary: transparent;
  // --color-shadow-highlight: transparent;
  --color-border-light-highlight: black;
  // --color-border-light-primary: var(--color-secondary-4);
  // --color-border-light-secondary: var(--color-secondary-4);
  // --color-border-light-tertiary: var(--color-secondary-4);
  // --color-border-dark-1: var(--color-secondary-4); // darkest
  // --color-border-dark-2: var(--color-secondary-4);
  // --color-border-dark-3: var(--color-secondary-4);
  // --color-border-dark-4: var(--color-secondary-3);
  // --color-border-dark-5: var(--color-secondary-2);
  // --color-border-dark-primary: var(--color-secondary-4);
  // --color-border-dark-secondary: var(--color-secondary-5);
  // --color-border-light-1: var(--color-secondary-3);
  // --color-border-light-2: var(--color-secondary-4);
  // --color-underline-header: var(--color-primary-2);
  // --color-underline-active: var(--color-primary-1);
  // --color-text-hyperlink: var(--color-primary-1);
  // --color-border-highlight: var(--color-primary-1);
  // --color-border-highlight-alt: var(--color-primary-2);
  // --color-border-light-tertiary: var(--color-secondary-4);
  // --color-bg-btn-minor-inactive: var(--app-background);
  // --color-bg-btn-minor-active: var(--color-primary-2);
  --color-text-dark-primary: var(--text-color-3);
  --color-text-dark-secondary: var(--text-color-5);
  --color-bg-option: black;
  --accent-text-color: black;
  --accent-color-light: var(--tertiary);
  --accent-color: var(--tertiary-dark);
  --accent-color-dark: var(--gold-brown);
}

/* ----------------------------------------- */
/* Limited                                   */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="dark"][data-dorako-ui-scope="limited"] {
  --dui-input-background: var(--glass-bg);
  --color-primary-2: var(--tertiary-dark);
  --color-secondary-5-25: rgba(0, 0, 0, 0.25);
  --color-border-light-2: black;
  --dui-button-hover-text-color: black;
}

/* ----------------------------------------- */
/* Unlimited                                 */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="dark"][data-dorako-ui-scope="unlimited"] {
  .tagify,
  select,
  input,
  button {
    --app-background: var(--glass-bg-light);
    --dui-input-border-color: transparent;
    --dui-input-background: var(--glass-bg);
    --dui-input-focus-outline-color: var(--tertiary);
    --input-box-shadow: var(--glassy);
  }
}

/* ----------------------------------------- */
/* General                                   */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="dark"] {
  --sheet: var(--sheet-dark);
  --ornamentation: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33' height='33' overflow='scroll'%3E%3Cstyle%3E.st1{stroke:wheat;stroke-miterlimit:10}.st1,.st2{fill:none}%3C/style%3E%3Cg opacity='1'%3E%3Cpath class='st1' d='M.5 20v-7'/%3E%3Cpath class='st2' d='M13 20v-7'/%3E%3Cpath class='st1' d='M13 .5h7'/%3E%3Cpath class='st2' d='M13 13h7'/%3E%3Cpath class='st1' d='M32.5 13v7'/%3E%3Cpath class='st2' d='M20 13v7'/%3E%3Cpath class='st1' d='M20 32.5h-7'/%3E%3Cpath class='st2' d='M20 20h-7'/%3E%3Cpath class='st1' d='M.5.5h3.1v3.1H.5zm3.1 3.1h3.1v3.1H3.6zm3.2 0h3.1v3.1H6.8zM3.6 6.8h3.1v3.1H3.6zm0 0H.5V13M13 .5H6.8v3.1M29.4.5h3.1v3.1h-3.1zm-3.1 3.1h3.1v3.1h-3.1zm0 3.2h3.1v3.1h-3.1zm-3.2-3.2h3.1v3.1h-3.1zm3.2 0V.5H20M32.5 13V6.8h-3.1M29.4 29.4h3.1v3.1h-3.1z'/%3E%3Cpath class='st1' d='M26.3 26.3h3.1v3.1h-3.1zm-3.2 0h3.1v3.1h-3.1zm3.2-3.2h3.1v3.1h-3.1z'/%3E%3Cpath class='st1' d='M29.4 26.3h3.1V20M20 32.5h6.3v-3.1'/%3E%3Cg%3E%3Cpath class='st1' d='M.5 29.4h3.1v3.1H.5zm3.1-3.1h3.1v3.1H3.6zm0-3.2h3.1v3.1H3.6zm3.2 3.2h3.1v3.1H6.8zM6.8 29.4v3.1H13M.5 20v6.3h3.1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

  --color-secondary-4: #26231f;
  --text-color-1: color-mix(in srgb, var(--color-text-light-highlight), 20% white)
  --text-color-2: var(--color-text-light-highlight);
  --text-color-3: var(--color-text-light-heading);
  --text-color-5: color-mix(in srgb, var(--color-text-light-heading), 20% black);

  --window-app-background: var(--sheet-dark);
  --app-background: var(--glass-bg);
  --app-border-width: 0px;

  --dui-input-text-color: var(--text-color-3);
  --dui-input-background: var(--glass-bg);
  --input-box-shadow: var(--glassy);
  --dui-input-border-color: transparent;
  --dui-input-focus-text-color: var(--text-color-2);
  --dui-input-placeholder-color: var(--text-color-5);
  --input-disabled-background: black;
  --input-disabled-border-color: black;
  --button-bright-text-color: black;

  --color-border-medium: var(--tertiary) !important;
  --color-border-divider: var(--tertiary) !important;
  --bg: rgba(0, 0, 0, 0.5);

  --fieldset-border-color: var(--tertiary);
  --fieldset-background-color: transparent;
  --fieldset-legend-color: var(--text-color-2);

  // .spell-button button {
  //   background: var(--primary);
  // }


  input[type="range"] + .range-value {
    color: black;
    text-shadow: none;
    font-weight: 800;
    --dui-input-focus-text-color: black;
  }
  --text-dark: var(--text-color-2);
}

/* ----------------------------------------- */
/* PF2e sheets                               */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="dark"] {
  .tags .tag.tag_transparent,
  .tags .tag option.tag_transparent {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  }

  /* ----------------------------------------- */
  /* NPC sheet                                 */
  /* ----------------------------------------- */
  &.sheet.pf2e.actor.npc.app {
    --section-background: var(--sheet-dark);
    --section-header: var(--primary);
    --section-border-color: var(--tertiary);
    --section-outline-color: var(--gold-brown);
    --section-header-text-color: var(--text-color-2);
    --tag-border-color: var(--text-color-5);
    --tag-background-color: var(--color-secondary-4);
    --tag-text-color: var(--text-color-4);
    --color-text-dark-input: var(--text-color-3);
    --dui-input-placeholder-color: var(--text-color-5);
    --dui-input-background: rgba(0, 0, 0, 0.1);
    --dui-input-focus-outline-color: var(--tertiary);
    --text-dark: var(--text-color-2);

    &.dorako-ux.sheet.pf2e.actor.npc form .sidebar .subsection,
    &.dorako-ux.sheet.pf2e.actor.npc form .section-container:not(.headerless) {
      background-image: var(--sheet);
    }

    input {
      --input-box-shadow: none;
    }
  }

  /* ----------------------------------------- */
  /* Actor sheet                               */
  /* ----------------------------------------- */
  &.actor.sheet .crb-style .sheet-body {
    --text-dark: var(--text-color-2);
    --color-border-light-primary: var(--tertiary);
    --color-border-light-highlight: var(--tertiary);
    // --sub: var(--text-color-disabled);
    // --alt: var(--text-color-5);
    // --bg: rgba(0, 0, 0, 0.5);
  }

  // prettier-ignore
  &.actor.sheet .inventory .list-row .item-controls,
  &.actor.sheet.character .crb-style .sheet-body .sheet-content .tab.feats .feat-item .item-name .feat-slot-title,
  &.actor.sheet .crb-style .sheet-body .sheet-content ol.spell-list > li .item-name h4:hover,
  &.actor.sheet.character .crb-style .sheet-body .sheet-content .tab.spellcasting .spellcasting-entry .spell-ability-data .skill-score {
    --secondary: var(--tertiary);
    --fa-inverse: black;
  }

  &.actor.sheet.character .crb-style .sheet-body .sheet-content .tab.proficiencies .lores-list .skill,
  &.actor.sheet.character .crb-style .sheet-body .sheet-content .tab.proficiencies .combat-list .skill,
  &.actor.sheet.character .crb-style .sheet-body .sheet-content .tab.proficiencies .skills-list .skill {
    --primary: var(--tertiary);
  }

  &.actor.sheet.character .crb-style .sheet-body .sheet-content .tab.effects .effects-list .item,
  &.actor.sheet .crb-style .sheet-body .sheet-content .tab.actions ol.actions-list li.action,
  &.actor.sheet .crb-style .sheet-body .sheet-content .tab.actions ol.actions-list li.strike {
    border-image: linear-gradient(90deg, transparent, var(--tertiary) 20%, transparent) 1;
  }
}

/* ----------------------------------------- */
/* Chat messages                             */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="dark"] {

  &.chat-message .dice-roll .dice-formula button,
  &.chat-message .dice-roll .dice-total button {
    background: var(--glass-bg-light);
    --dui-button-text-color: var(--text-color-2);
    &:hover {
      --dui-button-hover-text-color: var(--text-color-1);
      background: var(--glass-bg);
    }
  }
}
