@use "../vars/variables";
@use "mixins";

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  font-family: var(--uc-font-family-poppins);
  font-size: var(--uc-font-size-root);
  font-weight: normal;
  background: var(--uc-background);
}

body {
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: var(--uc-background);
  color: var(--uc-text-text-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  overflow: hidden;

  @media screen and (max-width: variables.$bp-tablet) {
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
  }

  &.overflow-hidden {
    overflow: hidden;
  }
}

a {
  color: var(--uc-text-text-primary);
  text-decoration: none;
}

ul,
li {
  list-style-type: none;
  padding: 0;
}

h1 {
  @include mixins.heading-1;
}

h2 {
  @include mixins.heading-2;
}

h3 {
  @include mixins.heading-3;
}

h4 {
  @include mixins.heading-4;
}

.vue-markdown {
  @include mixins.body-small;

  b,
  strong {
    font-weight: bold;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  p,
  li {
    font-weight: 300;
  }

  h1,
  h2,
  h3,
  h4,
  h5 {
    margin-bottom: 0.75rem;
  }

  p {
    margin-bottom: 0.5rem;
  }

  h2 {
    @include mixins.heading-4;
  }

  h3 {
    @include mixins.body-large;
  }

  a {
    text-decoration: underline;
  }

  ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;

    li {
      list-style-type: decimal;
    }
  }

  ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;

    li {
      list-style-type: disc;
    }
  }

  b,
  strong {
    font-weight: 500;
  }
}

.app {
  height: 100vh;
  height: 100dvh;
  max-width: var(--uc-app-max-width);
  margin: 0 auto;
  padding: calc(var(--uc-navbar-height) + 2.5rem) 1.25rem 1.25rem;

  @media screen and (max-width: variables.$bp-tablet) {
    // height: fit-content;
    padding: calc(var(--uc-navbar-height) + 0.625rem) 0.625rem 0;
    overflow-y: auto;
  }
}

.img-loading {
  @include mixins.spin;

  &--base {
    width: 2.25rem;
    height: 2.25rem;
  }

  &--small {
    width: 1.25rem;
    height: 1.25rem;
  }
}

.device-meta {
  &__name {
    @include mixins.heading-2;
  }

  &__host {
    @include mixins.secondary-body-large;
    color: var(--uc-theme-color-40);
  }
}

.drag-item-handle {
  &,
  body [data-draggable] & {
    //   font-size: 2.5rem;
    //   width: 2.5rem;
    //   text-align: center;
    //   cursor: move;
    //   color: var(--vt-c-black-description);
  }
}

.error-message {
  &--primary {
    @include mixins.secondary-body-extrasmall;
    color: var(--uc-error-error-60);
  }
}

.panel-col {
  display: flex;
  flex-direction: column;
  float: left;
  width: 50%;
  min-height: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);

  &--40 {
    width: 40%;
  }

  &--60 {
    width: 60%;
  }

  @media screen and (max-width: variables.$bp-tablet) {
    width: 100%;
    border-right: 0;
  }
}

.card {
  border-radius: 1rem;
  background: var(--uc-bg-bg-surface-1);
  padding: 1.25rem;
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.25rem 0.375rem;
  border-radius: 1.25rem;
  background: var(--uc-bg-bg-surface-1);
  font-size: 0.625rem;
  color: var(--uc-text-text-secondary);
  line-height: 1.3;
}

.link-box {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid var(--uc-theme-color-30);
  background: rgba(50, 55, 55, 0.5);

  ul {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
  }

  li {
    color: var(--uc-text-text-secondary);

    a,
    i {
      color: var(--uc-text-text-secondary);
    }

    a {
      @include mixins.secondary-body-extrasmall;

      @media (pointer: fine) {
        &:hover {
          text-decoration: underline;
        }
      }
    }

    i {
      font-size: 0.9rem;
    }
  }

  &__title {
    @include mixins.body-small;
    color: var(--uc-foreground);
  }
}

@keyframes blurAnimation {
  from {
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
  to {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
}
