/* ==UserStyle==
@name ListenBrainz Catppuccin
@namespace github.com/catppuccin/userstyles/styles/listenbrainz
@homepageURL https://github.com/catppuccin/userstyles/tree/main/styles/listenbrainz
@version 2024.12.31
@updateURL https://github.com/catppuccin/userstyles/raw/main/styles/listenbrainz/catppuccin.user.less
@supportURL https://github.com/catppuccin/userstyles/issues?q=is%3Aopen+is%3Aissue+label%3Alistenbrainz
@description Soothing pastel theme for ListenBrainz
@author Catppuccin
@license MIT

@preprocessor less
@var select lightFlavor "Light Flavor" ["latte:Latte*", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha"]
@var select darkFlavor "Dark Flavor" ["latte:Latte", "frappe:Frappé", "macchiato:Macchiato", "mocha:Mocha*"]
@var select accentColor "Accent" ["rosewater:Rosewater", "flamingo:Flamingo", "pink:Pink", "mauve:Mauve*", "red:Red", "maroon:Maroon", "peach:Peach", "yellow:Yellow", "green:Green", "teal:Teal", "blue:Blue", "sapphire:Sapphire", "sky:Sky", "lavender:Lavender", "subtext0:Gray"]
==/UserStyle== */

@-moz-document domain("listenbrainz.org") {
  :root {
    @media (prefers-color-scheme: light) {
      #catppuccin(@lightFlavor);
    }
    @media (prefers-color-scheme: dark) {
      #catppuccin(@darkFlavor);
    }
  }

  #catppuccin(@flavor) {
    @rosewater: @catppuccin[@@flavor][@rosewater];
    @flamingo: @catppuccin[@@flavor][@flamingo];
    @pink: @catppuccin[@@flavor][@pink];
    @mauve: @catppuccin[@@flavor][@mauve];
    @red: @catppuccin[@@flavor][@red];
    @maroon: @catppuccin[@@flavor][@maroon];
    @peach: @catppuccin[@@flavor][@peach];
    @yellow: @catppuccin[@@flavor][@yellow];
    @green: @catppuccin[@@flavor][@green];
    @teal: @catppuccin[@@flavor][@teal];
    @sky: @catppuccin[@@flavor][@sky];
    @sapphire: @catppuccin[@@flavor][@sapphire];
    @blue: @catppuccin[@@flavor][@blue];
    @lavender: @catppuccin[@@flavor][@lavender];
    @text: @catppuccin[@@flavor][@text];
    @subtext1: @catppuccin[@@flavor][@subtext1];
    @subtext0: @catppuccin[@@flavor][@subtext0];
    @overlay2: @catppuccin[@@flavor][@overlay2];
    @overlay1: @catppuccin[@@flavor][@overlay1];
    @overlay0: @catppuccin[@@flavor][@overlay0];
    @surface2: @catppuccin[@@flavor][@surface2];
    @surface1: @catppuccin[@@flavor][@surface1];
    @surface0: @catppuccin[@@flavor][@surface0];
    @base: @catppuccin[@@flavor][@base];
    @mantle: @catppuccin[@@flavor][@mantle];
    @crust: @catppuccin[@@flavor][@crust];
    @accent: @catppuccin[@@flavor][@@accentColor];

    color-scheme: if(@flavor = latte, light, dark);

    ::selection {
      background-color: fade(@accent, 30%);
    }

    input,
    textarea {
      &::placeholder {
        color: @subtext0 !important;
      }
    }

    // We can't control which theme is passed to Toastify's props from CSS, but
    // we can replace the default theme with whatever colours we want.
    --toastify-color-light: @overlay0;
    --toastify-text-color-light: @text;
    --toastify-color-info: @blue;
    --toastify-color-success: @green;
    --toastify-color-warning: @yellow;
    --toastify-color-error: @red;

    body {
      color: @text;
      background-color: @base;

      nav[role="navigation"] {
        .navbar-header .navbar-toggle {
          border-color: @accent;
          .icon-bar {
            background-color: @accent;
          }
        }

        .navbar-logo > img {
          @svg: escape(
            '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 30"><path fill="@{mauve}" d="M13 1 1 8v14l12 7z"/><path fill="@{peach}" d="m14 1 12 7v14l-12 7z"/></svg>'
          );
          content: url("data:image/svg+xml,@{svg}");
        }

        #side-nav {
          background-color: @mantle;
          a,
          a:visited {
            color: @blue;
            &:hover {
              color: @sky;
            }
          }

          .search-bar input {
            background-color: @surface0;
            color: @text;
            &:focus {
              box-shadow: inset 1px 2px 4px @surface1;
              ~ button {
                box-shadow: inset -3px 2px 4px @surface2;
              }
            }
            ~ button {
              background-color: @surface1;
              color: @text;
            }
          }

          .mobile-nav-fix {
            background-color: transparent;
          }
        }

        #side-nav-overlay {
          background-color: @crust;
        }
      }
    }

    a {
      color: @blue;
      &:hover {
        color: @sky;
      }
      &:visited:not(.btn) {
        color: @lavender;
        &:hover {
          color: @sky;
        }
      }
    }

    h2,
    h3,
    h4 {
      color: @text;
    }

    .text-muted,
    .help-block {
      color: @subtext0;
    }

    .text-success {
      color: @green;
    }

    .text-danger {
      color: @red;
    }

    a > svg.fa-link {
      color: @text;
    }

    .form-control {
      border-color: @base;
      background-color: @surface0;
      color: @text;
    }

    .panel {
      background-color: @surface0;
      color: @text;
      border-color: @surface1;
      .panel-heading {
        background-color: @surface1;
        outline-color: @surface2;
      }
    }

    .well {
      background-color: @surface0;
      border-color: @mantle;
    }

    .toggle-switch {
      background-color: @surface0;
      &::before {
        background-color: @overlay0;
      }
    }
    .toggle-checkbox:checked + .toggle-switch {
      background-color: @surface1;
      &::before {
        background-color: @accent;
      }
    }

    .table {
      tr {
        > td,
        > th {
          border-color: @surface1;
        }
      }

      &.table-striped > tbody > tr:nth-of-type(2n+1) {
        background-color: @surface0;
      }
    }

    .music-service-selection .music-service-option {
      label {
        background-color: @surface1;
        border-color: fade(@green, 50%);
      }

      input[type="radio"]:checked + label {
        background-color: fade(@green, 50%);
        &::after {
          color: @green;
          border-color: @green;
          background-color: @surface1;
        }
      }
    }

    .pill.secondary {
      color: @text;
      border-color: @subtext0;
    }

    .btn-primary,
    .btn-info,
    .btn-outline,
    .musicbrainz-profile-button,
    .lb-follow-button.block,
    .pill.secondary.active {
      color: @crust;
      background-color: @accent;
      border-color: transparent;

      &:hover {
        color: @crust;
        background-color: darken(@accent, 5%);
      }
    }

    .open > .dropdown-toggle.btn-info {
      color: @crust;
      background-color: darken(@accent, 10%);
    }

    .secondary-nav > ol.breadcrumb {
      background-color: @mantle;
      border-color: @crust;
      > li.active {
        color: @text;
        border-color: transparent;
      }
    }

    .secondary-nav .nav.nav-tabs {
      background-color: @mantle;
      border-color: @crust;
      > li {
        background-color: @mantle;
        border-color: @crust;
        > a {
          background-color: transparent;
          border-color: @crust;
          color: @subtext1;
          &.active {
            border-bottom-color: transparent;
          }
        }
        &:hover {
          background-color: @surface0;
        }

        &.active {
          background-color: @base;
          border-bottom-color: transparent;
        }
      }
    }

    @media (max-width: 991px) {
      .secondary-nav::after {
        background: linear-gradient(270deg, @crust, transparent);
      }
    }

    .listen-header h3 {
      color: @subtext0;
      &::after {
        border-top-color: @surface1;
      }
    }

    .webSocket-box {
      border-bottom-color: @mantle;
      .read-more {
        background-image: linear-gradient(to bottom, transparent, @base);
      }
    }

    .heart-actions() {
      .love {
        stroke: @text;
        &.loved {
          color: @red;
          stroke: transparent;
        }
        &:hover {
          color: transparent;
          stroke: @red;
        }
      }

      .hate {
        stroke: @text;
        &.hated {
          color: @mauve;
          stroke: transparent;
        }
        &:hover {
          color: transparent;
          stroke: @mauve;
        }
      }
    }

    .card {
      background-color: @surface0;
      border-color: transparent;
      box-shadow:
        fade(@surface0, 10%) 0 1px 1px,
        fade(@surface0, 15%) 0 2px 2px,
        fade(@surface0, 20%) 0 4px 4px;

      &#listen-count-card {
        margin-bottom: 5px;
        border-color: @surface1;
      }

      &.listen-card {
        .listen-thumbnail > div {
          color: @accent;
          background-color: @surface1;
          border-top-left-radius: 7px;
          border-bottom-left-radius: 7px;
        }

        .listen-time {
          color: @subtext0;
        }
        .listen-controls {
          .btn.dropdown-toggle,
          .btn.play-button,
          .btn-transparent[title="Reset"] {
            color: @text;
            &:hover,
            &.playing {
              color: @accent;
            }
          }

          .heart-actions();
        }

        &.playing-now,
        &.current-listen {
          background-color: @surface1 !important;

          .listen-thumbnail > div {
            background-color: @surface2;
            height: 100%;
          }
        }
      }
    }

    hr,
    #listen-count-card hr,
    .card-user-sn hr {
      border-top-color: @surface1;
    }

    .follower-following-list,
    .similar-users-list {
      box-shadow: inset 0 11px 8px -10px @base;
      > :not(:first-child) {
        border-color: @surface1;
      }
    }

    .progress {
      background-color: @surface1;

      .progress-bar.purple {
        background-color: @mauve;
      }

      .progress-bar.orange {
        background-color: @peach;
      }

      .progress-bar.red {
        background-color: @red;
      }
    }

    .dropdown-menu {
      background-color: @overlay0;
      button,
      a {
        color: @text !important;
        &:visited {
          color: @text !important;
        }
        &:hover {
          background-color: fade(@accent, 30%) !important;
        }
      }
    }

    .pager li {
      > a,
      > a:focus,
      > a:visited,
      a:active,
      > span {
        background-color: @surface0;
        border-color: @surface1;

        &:hover {
          background-color: @surface1;
        }
      }

      > a,
      > a:focus,
      > a:visited,
      > a:active {
        color: @blue;
        &:hover {
          color: @sky;
        }
      }

      &.disabled {
        > a,
        > a:focus,
        > a:visited,
        > a:active,
        > span {
          color: @text;
          background-color: @surface0;
          &:hover {
            background-color: inherit;
          }
        }
      }
    }

    .react-datetime-picker {
      .react-datetime-picker__wrapper {
        border-color: @mantle;
      }
      .react-calendar {
        background-color: @surface0;
        border-color: @surface1;

        .react-calendar__navigation,
        .react-calendar__viewContainer {
          button:disabled {
            background-color: @surface2;
          }
          button:enabled:hover {
            background-color: @surface1;
          }
          button:enabled:focus {
            background-color: transparent;
          }

          .react-calendar__tile--now {
            background-color: @peach;
            color: @crust;
            &:enabled:hover {
              background-color: @yellow;
            }
          }

          .react-calendar__tile--hasActive,
          .react-calendar__tile--active {
            color: @text;
            background-color: fade(@accent, 40%);
            &:enabled:hover {
              background-color: fade(@accent, 50%);
            }
          }
        }

        .react-calendar__month-view__days__day--neighboringMonth {
          color: @subtext0;
        }

        .react-calendar__month-view__days__day--weekend {
          color: @red;
        }
      }
    }

    .stats-full-width-graph {
      line {
        stroke: @subtext0 !important;
      }

      text {
        fill: @text !important;
      }

      &.user-artist-map > div + div > div,
      svg + div > div {
        background-color: @overlay0 !important;
        color: @text !important;
      }
    }
    rect[fill="#353070"] {
      fill: @mauve;
    }
    rect[fill="#eb743b"] {
      fill: @peach;
    }
    .badge-info {
      background-color: @surface1;
      color: @text;
    }

    .modal-content {
      background-color: @mantle;
      button.close {
        color: @text;
        opacity: 1;
        text-shadow: none;
      }

      .track-search {
        #recording-mbid,
        .track-search-dropdown {
          background-color: @surface0;
          color: @text;
          border-color: @crust;
        }
      }

      .modal-header,
      .modal-footer {
        border-color: @crust;
      }
    }

    .explore-card {
      background-color: @surface0;
      filter: drop-shadow(0 4px 4px fade(@overlay0, 25%));
      .explore-card-img {
        border-color: @surface0;
      }
      .explore-card-text {
        background-color: @surface0;
      }
    }

    .sidebar {
      background-color: @mantle;
      .sidebar-header {
        background-color: @crust;
        color: @text;
      }
      .sidenav-content-grid {
        background: transparent;
      }
    }
    .rc-slider-rail {
      background-color: @surface1;
    }
    .rc-slider-handle {
      background-color: @accent;
      &.rc-slider-handle-dragging {
        background-color: @accent;
        border-color: @accent;
      }
    }
    .rc-slider-mark-text {
      color: @subtext0;
    }
    .release-card-grid-title {
      background-color: transparent;
      &::before,
      &::after {
        border-color: @surface0;
      }
    }

    #homepage-container {
      @homepage-bg: linear-gradient(288deg, @peach 16.96%, @mauve 98.91%);
      @flipped-blue: if(
        @flavor = latte,
        @catppuccin[@mocha][@blue],
        @catppuccin[@latte][@blue]
      );
      @flipped-sky: if(
        @flavor = latte,
        @catppuccin[@mocha][@sky],
        @catppuccin[@latte][@sky]
      );

      .homepage-upper {
        background: @homepage-bg;

        h1 {
          color: @crust;
        }
        .homepage-info {
          h1 {
            color: @text;
          }

          .homepage-info-links > a {
            color: @blue;
            &:hover {
              color: @sky;
            }
          }
        }

        .homepage-upper-grey-box {
          background-color: @base;
        }
      }

      .homepage-lower {
        background: @homepage-bg;
        h1 {
          color: @text;
        }

        .homepage-info {
          color: @crust;
          h1 {
            color: @crust;
          }

          .homepage-info-links > a {
            color: @flipped-blue;
            &:hover {
              color: @flipped-sky;
            }
          }
        }

        .homepage-lower-grey-box {
          background-color: @base;
        }
      }

      .homepage-info {
        color: @text;
        .create-account-button {
          background-color: @accent;
          color: @crust;
          &:hover {
            background-color: darken(@accent, 5%);
          }
        }
      }
    }

    #brainz-player {
      background-color: @mantle;
      border-color: @crust;

      .progress {
        background-color: @surface1;
        > .progress-bar {
          background-color: @accent;
        }
      }

      .no-album-art {
        background-color: transparent;
      }

      .controls > .btn-link,
      .actions > a {
        color: @accent;
      }

      .actions {
        .heart-actions();

        .fa-ellipsis-vertical {
          stroke: @accent;
        }
      }

      .dropup-content {
        .dropdown-menu();
      }
    }

    .footer {
      background-color: @mantle;
      color: @text;
      border-color: @crust;
      .color-gray {
        color: @subtext0;
      }
      .section-line {
        border-color: @crust;
      }
    }
  }
}

/* deno-fmt-ignore */
@catppuccin: {
  @latte:     { @rosewater: #dc8a78; @flamingo: #dd7878; @pink: #ea76cb; @mauve: #8839ef; @red: #d20f39; @maroon: #e64553; @peach: #fe640b; @yellow: #df8e1d; @green: #40a02b; @teal: #179299; @sky: #04a5e5; @sapphire: #209fb5; @blue: #1e66f5; @lavender: #7287fd; @text: #4c4f69; @subtext1: #5c5f77; @subtext0: #6c6f85; @overlay2: #7c7f93; @overlay1: #8c8fa1; @overlay0: #9ca0b0; @surface2: #acb0be; @surface1: #bcc0cc; @surface0: #ccd0da; @base: #eff1f5; @mantle: #e6e9ef; @crust: #dce0e8; };
  @frappe:    { @rosewater: #f2d5cf; @flamingo: #eebebe; @pink: #f4b8e4; @mauve: #ca9ee6; @red: #e78284; @maroon: #ea999c; @peach: #ef9f76; @yellow: #e5c890; @green: #a6d189; @teal: #81c8be; @sky: #99d1db; @sapphire: #85c1dc; @blue: #8caaee; @lavender: #babbf1; @text: #c6d0f5; @subtext1: #b5bfe2; @subtext0: #a5adce; @overlay2: #949cbb; @overlay1: #838ba7; @overlay0: #737994; @surface2: #626880; @surface1: #51576d; @surface0: #414559; @base: #303446; @mantle: #292c3c; @crust: #232634; };
  @macchiato: { @rosewater: #f4dbd6; @flamingo: #f0c6c6; @pink: #f5bde6; @mauve: #c6a0f6; @red: #ed8796; @maroon: #ee99a0; @peach: #f5a97f; @yellow: #eed49f; @green: #a6da95; @teal: #8bd5ca; @sky: #91d7e3; @sapphire: #7dc4e4; @blue: #8aadf4; @lavender: #b7bdf8; @text: #cad3f5; @subtext1: #b8c0e0; @subtext0: #a5adcb; @overlay2: #939ab7; @overlay1: #8087a2; @overlay0: #6e738d; @surface2: #5b6078; @surface1: #494d64; @surface0: #363a4f; @base: #24273a; @mantle: #1e2030; @crust: #181926; };
  @mocha:     { @rosewater: #f5e0dc; @flamingo: #f2cdcd; @pink: #f5c2e7; @mauve: #cba6f7; @red: #f38ba8; @maroon: #eba0ac; @peach: #fab387; @yellow: #f9e2af; @green: #a6e3a1; @teal: #94e2d5; @sky: #89dceb; @sapphire: #74c7ec; @blue: #89b4fa; @lavender: #b4befe; @text: #cdd6f4; @subtext1: #bac2de; @subtext0: #a6adc8; @overlay2: #9399b2; @overlay1: #7f849c; @overlay0: #6c7086; @surface2: #585b70; @surface1: #45475a; @surface0: #313244; @base: #1e1e2e; @mantle: #181825; @crust: #11111b; };
};