@use "mixins";
@use "variables";

.layout-topbar {
  position: fixed;
  height: 3.85rem;
  z-index: 997;
  left: 0;
  top: 0;
  width: 100%;
  padding: 0 1rem;
  background-color: color-mix(in srgb, var(--card-background) 25%, transparent);
  border: none;
  border-bottom: 1px solid var(--p-content-border-color);
  transition: left variables.$transitionDuration;
  display: flex;
  align-items: center;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, .02), 0px 0px 2px rgba(0, 0, 0, .05), 0px 1px 4px rgba(0, 0, 0, .08);

  .layout-topbar-logo {
    display: flex;
    align-items: center;
    font-size: 1.7rem;
    font-weight: 500;
    width: 265px;
    border-radius: 12px;
  }
}

@media (max-width: 991px) {
  .layout-topbar {
    .layout-topbar-logo {
      display: none;
    }
  }
}

.topbar-items {
  display: flex;
  list-style-type: none;
  margin: 0;
  padding: 0;
  gap: 0.3rem;
  align-items: center;

  li {
    position: relative;
  }

  .topbar-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    width: 2.5rem;
    height: 2.5rem;
    transition: outline-color .2s, border-color .2s;
    border-radius: 6px;
    margin: 0;
    padding: 0;
    outline-color: transparent;
    background-color: var(--card-background);
    cursor: pointer;

    //@include focus-visible();

    &:hover {
      border-color: var(--primary-color);
    }

    i, span {
      color: var(--text-color);
    }
  }

  .config-item {
    background-color: var(--primary-color);

    i {
      color: var(--primary-contrast-color);
    }
  }

  .config-panel {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-end: 0;
    width: 18rem;
    padding: .75rem;
    background-color: var(--overlay-background);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transform-origin: top;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    &.notification-box {
      width: 30rem;
      background-color: var(--card-background);
      border: 0.25px solid var(--primary-color);
      border-radius: 4px;
      min-height: 5rem;
    }

    .config-panel-content {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .config-panel-label {
      font-size: .875rem;
      color: var(--text-secondary-color);
      font-weight: 600;
      line-height: 1;
    }

    .config-panel-colors {
      > div {
        justify-content: flex-start;
        padding-top: .5rem;
        display: flex;
        gap: .5rem;
        flex-wrap: wrap;

        button {
          border: none;
          width: 1.25rem;
          height: 1.25rem;
          border-radius: 50%;
          padding: 0;
          cursor: pointer;
          outline-color: transparent;
          outline-width: 2px;
          outline-style: solid;
          outline-offset: 1px;

          &.active-color {
            outline-color: var(--primary-color);
          }
        }
      }
    }

    .config-panel-settings {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
  }

}

.rotate-left {
  transform: rotate(0deg);
  transition: transform 0.3s ease-in-out;
}

.rotate-right {
  transform: rotate(180deg);
  transition: transform 0.3s ease-in-out;
}

.half-title {
  color: var(--primary-color);
}

.multi-color-chart-icon {
  width: 1.3rem;
  height: 1.3rem;
  display: inline-block;
}

// Animation classes for pStyleClass directive (theme configurator dropdown)
@keyframes scalein {
  0% {
    opacity: 0;
    transform: scaleY(0.8);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes fadeout {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.hidden {
  display: none !important;
}

.animate-scalein {
  animation: scalein 0.15s ease-out forwards;
}

.animate-fadeout {
  animation: fadeout 0.15s ease-out forwards;
}
