/* ----------------------------------------- */
/* Map v1 styling to v2 values               */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="light"] {
  // --color-shadow-primary: transparent;
  // --color-shadow-highlight: transparent;
  // --color-border-light-highlight: var(--color-secondary-3);
  // --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(--accent-color);
  --color-border-highlight-alt: var(--accent-color-dark);
  // --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: white;
}

/* ----------------------------------------- */
/* Light theme                                  */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="light"] {
  --accent-text-color: white;
  --accent-color-light: var(--primary-light);
  --accent-color: var(--primary-light);
  --accent-color-dark: var(--primary);

  &.window-app button.bright {
    --dui-button-background: var(--accent-color);
    --dui-button-border-color: var(--accent-color-dark);
    --dui-button-text-color: white !important;
    --dui-button-hover-text-color: white !important;
    --app-text-shadow: none;
  }

  input[type="range"] + .range-value {
    border: none;
  }
  .tags > .tag {
    --text-color-2: black;
  }
}

/* ----------------------------------------- */
/* PF2e sheets                               */
/* ----------------------------------------- */
[data-theme^="crb"][data-color-scheme="light"] {
  --sheet: var(--sheet-light);
  --ornamentation: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33' height='33' overflow='scroll'%3E%3Cstyle%3E.st1%7Bstroke:%23231f20;stroke-miterlimit:10%7D.st1,.st2%7Bfill:none%7D%3C/style%3E%3Cg opacity='.25'%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%3Cg%3E%3Cpath class='st1' d='M.5.5h3.1v3.1H.5zM3.6 3.6h3.1v3.1H3.6zM6.8 3.6h3.1v3.1H6.8zM3.6 6.8h3.1v3.1H3.6zM3.6 6.8H.5V13M13 .5H6.8v3.1'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st1' d='M29.4.5h3.1v3.1h-3.1zM26.3 3.6h3.1v3.1h-3.1zM26.3 6.8h3.1v3.1h-3.1zM23.1 3.6h3.1v3.1h-3.1zM26.3 3.6V.5H20'/%3E%3Cpath class='st1' d='M32.5 13V6.8h-3.1'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st1' d='M29.4 29.4h3.1v3.1h-3.1z'/%3E%3Cpath class='st1' d='M26.3 26.3h3.1v3.1h-3.1zM23.1 26.3h3.1v3.1h-3.1zM26.3 23.1h3.1v3.1h-3.1z'/%3E%3Cpath class='st1' d='M29.4 26.3h3.1V20M20 32.5h6.3v-3.1'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st1' d='M.5 29.4h3.1v3.1H.5zM3.6 26.3h3.1v3.1H3.6zM3.6 23.1h3.1v3.1H3.6zM6.8 26.3h3.1v3.1H6.8z'/%3E%3Cpath class='st1' d='M6.8 29.4v3.1H13M.5 20v6.3h3.1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  //   --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");
  --window-app-background: var(--sheet);
  --window-app-border-color: var(--tertiary);
  --window-app-border-width: 1px;
  --color-text-dark-primary: #191813;
  --color-text-dark-secondary: #4b4a44;

  // --text-color-3: black;
  --color-secondary-5-75: rgba(96, 88, 86, 0.25);

  &.application {
    --text-color-1: black;
    --text-color-2: var(--color-text-dark-primary);
    --text-color-3: var(--color-text-dark-primary);
    --dui-button-hover-text-color: white;
    --color-text-primary: var(--color-text-dark-primary);
  }

  --app-background: rgba(255, 255, 255, 0.5);
  --app-border-color: transparent;
  --app-border-width: none;
  --app-text-shadow: none;
  --dui-button-text-color: black;
  --box-shadow: var(--gold-and-glow);

  --dui-button-focus-outline-color: transparent;
  --input-disabled-background: rgba(255, 255, 255, 0.2);
  --input-disabled-border-color: transparent;

  --window-app-box-shadow: 0px 5px 20px 3px black;

  --fieldset-border-color: gray;
  --fieldset-background-color: transparent;
  --fieldset-legend-color: black;

  tagify,
  select,
  input {
    --dui-input-border-color: var(--color-text-light-5);
    --dui-input-text-color: var(--color-text-dark-input);
    --dui-input-focus-text-color: var(--color-text-dark-input);
    --dui-input-background: rgba(255, 255, 255, 0.5);
    --dui-input-focus-outline-color: var(--primary-light);
    --dui-input-placeholder-color: var(--color-text-dark-secondary);

    --app-border-width: 1px;
    --box-shadow: none;
  }

  #context-menu {
    --app-background: var(--glass-bg);
    color: var(--color-text-light-heading);
  }

  &.chat-message button,
  &.window-app button,
  &.package-configuration aside.sidebar nav.tabs .category-tab {
    --box-shadow: none;
    --app-border-width: 1px;
    --dui-button-border-color: var(--color-text-light-5);
    --dui-button-background: rgba(255, 255, 255, 0.5);
    --dui-button-text-color: black;
    text-shadow: none;
  }

  &.pf2e.item.sheet form .sheet-body input[type="text"]:not(:disabled),
  &.pf2e.item.sheet form .sheet-body input[type="number"]:not(:disabled) {
    --dui-input-background: rgba(0, 0, 0, 0.05);
    --dui-input-border-color: var(--color-text-light-5);
  }

  .tagify,
  input {
    --dui-input-background: rgba(0, 0, 0, 0.05);
    --dui-input-border-color: transparent;
  }

  &#homebrew-settings section.window-content .form-group.setting tags {
    --tag-color: black;
  }

  &.sheet.hazard .section-container .section-header input,
  &.sheet.hazard .section-container.publication .section-body input[type="text"] {
    --dui-input-text-color: var(--text-color-2);
    --dui-input-focus-text-color: var(--text-color-1);
  }

  &[data-dorako-ui-scope="limited"].actor.npc.sheet form .notes.active .notes-section > h4 {
    color: var(--color-pf-primary);
  }

  .directory .directory-header .header-search input {
    --dui-input-border-color: var(--color-text-light-5);
    --dui-input-text-color: var(--color-text-dark-input);
    --dui-input-focus-text-color: var(--color-text-dark-input);
    --dui-input-background: rgba(255, 255, 255, 0.5);
    --dui-input-focus-outline-color: var(--primary-light);
  }

  &.chat-message {
    color: black;
    --ornamentation: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='33' height='33' overflow='scroll'%3E%3Cstyle%3E.st1%7Bstroke:%23231f20;stroke-miterlimit:10%7D.st1,.st2%7Bfill:none%7D%3C/style%3E%3Cg opacity='.25'%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%3Cg%3E%3Cpath class='st1' d='M.5.5h3.1v3.1H.5zM3.6 3.6h3.1v3.1H3.6zM6.8 3.6h3.1v3.1H6.8zM3.6 6.8h3.1v3.1H3.6zM3.6 6.8H.5V13M13 .5H6.8v3.1'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st1' d='M29.4.5h3.1v3.1h-3.1zM26.3 3.6h3.1v3.1h-3.1zM26.3 6.8h3.1v3.1h-3.1zM23.1 3.6h3.1v3.1h-3.1zM26.3 3.6V.5H20'/%3E%3Cpath class='st1' d='M32.5 13V6.8h-3.1'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st1' d='M29.4 29.4h3.1v3.1h-3.1z'/%3E%3Cpath class='st1' d='M26.3 26.3h3.1v3.1h-3.1zM23.1 26.3h3.1v3.1h-3.1zM26.3 23.1h3.1v3.1h-3.1z'/%3E%3Cpath class='st1' d='M29.4 26.3h3.1V20M20 32.5h6.3v-3.1'/%3E%3C/g%3E%3Cg%3E%3Cpath class='st1' d='M.5 29.4h3.1v3.1H.5zM3.6 26.3h3.1v3.1H3.6zM3.6 23.1h3.1v3.1H3.6zM6.8 26.3h3.1v3.1H6.8z'/%3E%3Cpath class='st1' d='M6.8 29.4v3.1H13M.5 20v6.3h3.1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --app-background: rgba(255, 255, 255, 0.2);
    --app-background: rgba(0, 0, 0, 0.1);
    --app-border-width: 1px;
    --box-shadow: 0px 0px 0px 1px var(--gold-brown);
    --app-text-shadow: none;

    hr {
      --app-border-color: #23231f20;
    }

    button {
      --dui-button-hover-text-color: white;
      &:hover {
        outline: 1px solid var(--gold-brown);
      }
    }
    .message-content {
      text-shadow: unset;
      --text-color-1: black;
      --text-color-2: black;
      --text-color-3: black;
      text-shadow: 0px 1px 0px white;
      color: black;
      .dice-roll {
        --app-border-color: var(--tertiary);
        .dice-total,
        .dice-formula {
          button {
            --dui-button-border-color: var(--alt-dark);
            --dui-button-background: var(--alt);
            --dui-button-text-color: white;
            --app-text-shadow: none;
            --dui-button-focus-outline-color: transparent;
            --button-hover-background: var(--tertiary-dark);
            --button-hover-border-color: var(--gold-brown);
          }
        }
        .part-total {
          --app-border-color: var(--color-text-light-6);
        }
      }
    }
  }
  &#rolodex {
    .window-header {
      color: black;
      text-shadow: none;
    }
    .sheet-navigation-controls {
      margin-top: 2px;
      --app-background: var(--secondary);
      // --text-color-3: black;
    }
  }

  &:not([data-dorako-ui-scope="limited"], .journal-sheet).window-app .window-header {
    color: black;
    text-shadow: none;
  }

  &.journal-entry-page.window-app .window-header {
    color: black;
    text-shadow: none;
  }

  /* ----------------------------------------- */
  /* Familiar sheet                            */
  /* ----------------------------------------- */
  &.sheet.familiar .section-container {
    color: black;
    --app-background: rgba(255, 255, 255, 0.2);
    --app-border-width: 1px;
    --app-border-color: var(--tertiary);
    --box-shadow: 0px 0px 0px 1px var(--gold-brown);
    --app-text-shadow: none;
  }

  /* ----------------------------------------- */
  /* NPC sheet                                 */
  /* ----------------------------------------- */
  &.sheet.pf2e.actor.npc.app {
    --section-background: var(--sheet-light);
    --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: black;
    --tag-background-color: transparent;
    --tag-text-color: black;
    --color-text-dark-input: black;
    --dui-input-border-color: transparent;
    --dui-input-background: rgba(0, 0, 0, 0.1);
    --dui-input-focus-outline-color: var(--tertiary);
    --dui-input-placeholder-color: rgba(40, 40, 40, 1);
    --text-dark: black;
    --contrastive-transparent: rgba(0, 0, 0, 0.5);
    --text-color-3: var(--color-text-dark-primary);
    --app-text-shadow: none;

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

    // .side-bar-section-header input {
    //   --dui-input-focus-outline-color: var(--tertiary);
    // }

    &.actor.npc.sheet form .sheet-body .entries-list .spellcasting-entry .header .inline-field .attack-input,
    &.actor.npc.sheet form .sheet-body .entries-list .spellcasting-entry .header .inline-field .dc-input {
      --dui-input-text-color: white;
    }

    &.actor.npc.sheet form a.roll:hover {
      --color-pf-primary-light: var(--primary-light);
    }

    .window-header {
      color: black;
      text-shadow: none;
    }

    &.actor.npc.sheet form .side-bar-section.initiative select {
      --box-shadow: none;
    }

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