@import "./reset.scss";
@import "./fonts.scss";
@import "./components.scss";

img {
  pointer-events: none;
  cursor: pointer;
}

a {
  color: black;
  text-decoration: none;
}

input.error {
  border: 1px red solid;
  border-radius: 0.1rem;
}

.spinner_large {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner_large .block {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border-top: 3px solid rgba(0, 0, 0, 0.1);
  border-right: 3px solid rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid rgba(0, 0, 0, 0.1);
  border-left: 3px solid rgb(129, 138, 145);
  -webkit-animation: spinner 0.5s infinite linear;
  animation: spinner 0.5s infinite linear;
}

.spinner {
  width: 16px;
  height: 16px;
}

.spinner .block {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border-top: 3px solid rgba(0, 0, 0, 0.1);
  border-right: 3px solid rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid rgba(0, 0, 0, 0.1);
  border-left: 3px solid rgb(129, 138, 145);
  -webkit-animation: spinner 0.5s infinite linear;
  animation: spinner 0.5s infinite linear;
}

@-webkit-keyframes spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

body {
  position: relative;
  scroll-behavior: auto;

  .float-view-container {
    top: 0;
    left: 0;
    position: absolute;
    width: 100dvw;
    height: 100dvh;
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;

    .float-view {
      width: calc(100dvw - 100px);
      height: 90dvh;
      background-color: #fff;
      padding: 1rem;
      border-radius: 1rem;
      display: flex;
      z-index: 101;
      flex-direction: column;

      .row {
        display: flex;
        justify-content: space-between;
        overflow: scroll;

        button {
          height: 100%;
          background-color: transparent;
          border: none;
        }
      }

      .row:first-child {
        margin-bottom: 0.7rem;
      }

      .table-container {
        height: 100%;
        width: 100%;
        overflow: scroll;

        table {
          width: 100%;
          border-collapse: collapse;
          border-left: 2px solid black;
          border-right: 2px solid black;

          @media (hover: hover) {
            tr:not(:first-child):hover {
              background-color: #b0b0b0;
            }
          }

          tr {
            border-bottom: 2px solid black;
          }

          thead th {
            border-top: 2px solid black;
            border-right: 2px solid black;
            padding: 0.7rem;
          }

          tbody th {
            border-right: 2px solid black;
          }

          td {
            display: flex;
            align-items: center;
            justify-content: center;

            button {
              border: none;
              width: 40px;
              height: 40px;
              display: flex;
              align-items: center;
              justify-content: center;
              color: #fff;
              border-radius: 50%;
              background-color: rgba(0, 0, 0, 0);
            }
          }
        }
      }
    }
  }

  .float-view-hidden {
    height: 0;
    visibility: hidden;
  }

  .popup-container {
    top: 0;
    left: 0;
    position: absolute;
    width: 100vw;
    height: 100dvh;
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 110;

    .popup-content {
      width: 50vw;
      height: -webkit-max-content;
      height: -moz-max-content;
      height: max-content;
      background-color: #fff;
      padding: 1rem;
      border-radius: 1rem;
      display: flex;
      flex-direction: column;
      z-index: 111;

      input {
        margin-bottom: 0.3rem;
        border: black 1px solid;
        border-radius: 1px;
      }

      .buttons {
        margin-top: 1rem;
        display: flex;
        justify-content: center;
        gap: 0.5rem;

        button {
          border: none;
          width: 100px;
          height: 30px;
          border-radius: .3rem;
          background-color: #000;
          color: #fff;
          transition: 200ms all ease;
        }

        @media (hover: hover) {
          button:hover {
            background-color: #fff;
            color: #000;
            border: 2px solid #000;
            box-sizing: border-box;
          }
        }

        button:active {
          background-color: #fff;
          color: #000;
          border: 2px solid #000;
          transform: scale(0.9);
          box-sizing: border-box;
        }
      }
    }
  }

  .popup-hidden {
    height: 0;
    visibility: hidden;
  }

  .app {
    width: 100%;
    z-index: 1;
    padding-inline: 1rem;

    header.header {
      display: flex;
      justify-content: space-between;
      padding-block: 0.5rem;

      .logo {
        width: 50px;

        img {
          width: 100%;
        }
      }

      .avatar {
        position: relative;
        width: 50px;

        .user-menu {
          z-index: 20;
          position: absolute;
          width: -webkit-max-content;
          width: -moz-max-content;
          width: max-content;
          background-color: #b0b0b0;
          right: 0;
          padding: 1rem;
          border-radius: 1rem;
        }

        img {
          border-radius: 50%;
          width: 100%;
        }
      }
    }

    main.main {
      padding-bottom: 1rem;

      .login-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;

      }

      .login {
        display: flex;
        flex-direction: column;

        .login-label {
          margin-bottom: .5rem;
        }

        .login-form {
          display: flex;
          justify-content: space-between;
          gap: 1rem;

          input {
            width: 100%;
            border: 2px solid black;
            outline: none;
          }

          input::-webkit-outer-spin-button,
          input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            appearance: textfield;
            margin: 0;
          }

          input[type=number] {
            -moz-appearance: textfield;
            -webkit-appearance: textfield;
                    appearance: textfield;
          }

          input::-webkit-outer-spin-button,
          input::-webkit-inner-spin-button {
            display: none;
          }

          input.error {
            border: 2px solid red;
          }

          input.error::-webkit-input-placeholder {
            color: red;
          }

          input.error::-moz-placeholder {
            color: red;
          }

          input.error:-ms-input-placeholder {
            color: red;
          }

          input.error::-ms-input-placeholder {
            color: red;
          }

          input.error::placeholder {
            color: red;
          }

          button {
            border: none;
            width: 100px;
            height: 30px;
            border-radius: .3rem;
            background-color: #000;
            color: #fff;
            transition: 200ms all ease;
            display: flex;
            align-items: center;
            justify-content: center;
          }

          @media (hover: hover) {
            button:hover {
              background-color: #fff;
              color: #000;
              border: 2px solid #000;
              box-sizing: border-box;
            }
          }

          button:active {
            background-color: #fff;
            color: #000;
            border: 2px solid #000;
            transform: scale(0.9);
            box-sizing: border-box;
          }
        }
      }

      .table-container {
        width: 100%;
        height: calc(100dvh - 6rem);
        overflow-x: auto;
        border-left: 1px black solid;
        border-top: 1px black solid;

        .table {
          position: relative;
          border-collapse: collapse;
          height: 400px;
          table-layout: fixed;

          td,
          th {
            min-width: 50px;
            max-width: 50px;
            padding: 0.25em;
            height: 50px;
            z-index: 10;
            background: #fff;
            text-overflow: ellipsis;
          }

          thead tr th {
            position: relative;
          }

          thead tr th button {
            width: -webkit-max-content;
            width: -moz-max-content;
            width: max-content;
            height: -webkit-max-content;
            height: -moz-max-content;
            height: max-content;
            position: absolute;
            background-color: transparent;
            right: 0;
            top: 0;
            padding: 0.2rem 0.1rem;
          }

          .buttons {
            display: flex;
            align-items: center;
            justify-content: center;

            button {
              border: none;
              width: 40px;
              height: 40px;
              display: flex;
              align-items: center;
              justify-content: center;
              color: #fff;
              border-radius: 50%;
              background-color: rgba(0, 0, 0, 0);
            }

          }

          .wrapper {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            overflow: hidden;

            p {
              width: 90%;
              text-overflow: ellipsis;
              overflow: hidden;
            }

            button {
              width: 50;
              height: 100%;
              border: none;
              background-color: transparent;
            }
          }

          thead th:not(:last-child),
          tbody td {
            border-right: 1px solid black;
          }

          thead tr:not(:last-child),
          tbody tr:not(:last-child) {
            border-bottom: 1px black solid;
          }

          thead tr th span {
            -webkit-writing-mode: vertical-rl;
            -ms-writing-mode: tb-rl;
            writing-mode: vertical-rl;
            transform: rotate(180deg);
          }

          tbody td:not(:first-child) {
            position: relative;
            z-index: 1;
          }

          thead tr th {
            min-height: 116px;
            max-height: 116px;
          }

          thead th:first-child::after,
          tbody th:first-child::after {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            border-right: 1px solid black;
            z-index: -1;
          }

          thead th::after {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            border-bottom: 1px solid black;
            z-index: -1;
          }

          thead th {
            position: -webkit-sticky !important;
            position: sticky !important;
            top: 0;
            background-color: rgb(208, 208, 208);
          }

          tbody th:first-child,
          thead th:first-child {
            min-width: 100px;
            max-width: 200px;
            left: 0;
            z-index: 11;
            border: none;
            background-color: rgb(208, 208, 208);
            overflow: hidden;
            text-overflow: ellipsis;
          }

          tbody th:first-child {
            z-index: 10;
          }

          tbody th {
            position: -webkit-sticky;
            position: sticky;
            left: 0;
            background: #fff;
            z-index: 100;
            border-right: 1px solid black;
          }

          @media (hover: hover) {
            tbody tr:hover {
              td {
                background-color: #b0b0b0;
              }

              td:hover {
                background-color: #646464;
              }

              td:hover::after {
                content: "";
                width: 100%;
                height: 10000px;
                bottom: 50px;
                left: 0;
                background-color: rgba(100, 100, 100, 0.2);
                position: absolute;
                pointer-events: none;
              }
            }
          }

          button {
            background-color: #fff;
            border: none;
          }
        }
      }
    }
  }

  .hide {
    visibility: hidden;
    height: 0;
    width: 0;
  }
}