/* Constants */
:root {
  --border-color: #d5d5d5;
  --border: 1px solid var(--border-color);
  --box-shadow: rgba(0, 0, 0, 0.22) 0 0.07px 0 0.7px;
  --box-shadow-focus: rgba(0, 0, 0, 1) 0 0.07px 0 0.7px;
  --background-color: #fff;
  --header-height: 58px;
}

/* Header & Tabs */
page {
  height: 100%;

  content {
    height: 100%;

    header {
      width: 100%;
      border-bottom: var(--border);
      height: 64px;
      padding: 15px 0 0;
      color: #000;
      font-size: 14px;

      .tabs {
        display: inline-flex;

        .tab {
          text-align: center;
          border-radius: 9px;
          height: 32px;
          cursor: pointer;
          border: 1px solid #fff;
          position: relative;
          padding: 2px 16px 0;
          margin-left: 4px;

          &:hover,
          &.active {
            border: 1px solid #d0d0d0;
            box-shadow: 0 0.5px 1.5px #0000000d;
          }
        }
      }
    }
  }
}

/* Visability */
.hide {
  display: none !important;
}

.visible {
  visibility: visible !important;
}

.invisible {
  visibility: hidden !important;
}

/* Alignment */
/* This is used beside custom top padding based on OS */
/* Usually macOS requires around 2 more pixles */
.center-text-vertically {
  display: flex;
  align-items: anchor-center;
  -webkit-align-items: center;
  justify-content: right;

  .text-container {
    height: fit-content;
    width: inherit;

    > .text {
      vertical-align: text-top;
      width: inherit;
      display: inline-flex;

      &.center {
        flex-wrap: wrap;
        flex-direction: column;
        align-content: space-around;
      }
    }
  }
}

/* Buttons */
.running {
  opacity: 0.8 !important;
  cursor: not-allowed;
  color: #ffffff30 !important;
}

button {
  .text-container .text {
    &::selection {
      color: inherit;
      background: transparent !important;
    }
  }
}

.button-white:disabled {
  opacity: 0.7;
}

.button-white {
  background: #fff;
  border: 0.8px solid #c2c2c2;
  font-size: 12px;
  padding: 9px 20px 9.5px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: padding 0.25s ease;
  color: #444;
  height: 33px;
  font-weight: 500;
  text-decoration: none;
}

.button-white:hover {
  color: #000;
  border: 0.8px solid #888;
}

.button-white.running {
  opacity: 0.7 !important;
  cursor: not-allowed;
}

.button-white.running:hover {
  color: #444;
}

/* .button-white .ld-ring:after {
  border: 0.3em solid #a2d7ff;
  border-left-color: #0091ff;
} */

:root {
  --button-blue-bg: #2292ee;
  /* --button-blue-bg: #319df6; */
  --button-blue-hover-bg: hsl(from var(--button-blue-bg) h s calc(l + -5));

  --button-light-blue-bg: #ecf4fb;
  --button-light-blue-hover-bg: #e3eef9;
}

.button-blue {
  background: var(--button-blue-bg) !important;
  border: 0.8px solid var(--button-blue-bg) !important;
  font-size: 12px;
  padding: 6.5px 20px 7px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  text-decoration: none;
  color: #fff !important;
  transition: padding 0.15s ease-in-out;
}

.button-blue:hover {
  background: var(--button-blue-hover-bg) !important;
  border: 0.8px solid var(--button-blue-hover-bg) !important;
}

.button-blue:active,
.button-blue.active {
  background: var(--button-blue-hover-bg) !important;
  border: 0.8px solid var(--button-blue-hover-bg) !important;
  color: #fff !important;
}

.button-blue.disabled,
.button-blue:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed;
  color: #eff7ffe8 !important;
}

.button-blue.disabled:hover,
.button-blue:disabled:hover {
  background: var(--button-blue-bg) !important;
  border: 0.8px solid var(--button-blue-bg) !important;
  cursor: not-allowed;
}

.button-blue.running {
  opacity: 0.7 !important;
  cursor: not-allowed;
  color: #ffffff00 !important;
}

.button-blue.running:hover {
  background: var(--button-blue-bg) !important;
  border: 0.8px solid var(--button-blue-bg) !important;
  color: #ffffff00 !important;
}

/* .button-blue.ld-over:before {
  background: #1989ed !important;
  border: 0.8px solid #1989ed !important;
  border-radius: 5px;
} */

.button-light-blue {
  background: var(--button-light-blue-bg) !important;
  border: 0.8px solid var(--button-light-blue-bg) !important;
  font-size: 12px;
  padding: 6.5px 20px 7px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  text-decoration: none;
  color: #2383e2 !important;
  transition: padding 0.15s ease-in-out;
}

.button-light-blue:hover {
  background: var(--button-light-blue-hover-bg) !important;
  border: 0.8px solid var(--button-light-blue-hover-bg) !important;
}

.button-light-blue:active,
.button-light-blue.active {
  background: var(--button-light-blue-hover-bg) !important;
  border: 0.8px solid var(--button-light-blue-hover-bg) !important;
  color: #2383e2 !important;
}

.button-light-blue.disabled,
.button-light-blue:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed;
  color: #eff7ffe8 !important;
}

.button-light-blue.disabled:hover,
.button-light-blue:disabled:hover {
  background: var(--button-light-blue-bg) !important;
  border: 0.8px solid var(--button-light-blue-bg) !important;
  cursor: not-allowed;
}

.button-light-blue.running {
  opacity: 0.7 !important;
  cursor: not-allowed;
  color: #ffffff00 !important;
}

.button-light-blue.running:hover {
  background: var(--button-light-blue-bg) !important;
  border: 0.8px solid var(--button-light-blue-bg) !important;
  color: #ffffff00 !important;
}

/* .button-light-blue.ld-over:before {
  background: #1989ed !important;
  border: 0.8px solid #1989ed !important;
  border-radius: 5px;
} */

/* input {
  &:disabled {
    background: #f7fafe57;

    &:hover {
      cursor: not-allowed;
    }
  }
} */

/* Form */
form {
  font-size: 17px;

  .form-group {
    position: relative;
  }

  input,
  textarea {
    width: 100%;
    outline: none;
    border: 1px solid #d4d4d4;
    border-radius: 7px;
    padding: 15px 13px 12px;

    /* The trick to get the  */
    padding: 0;
    line-height: 20;
    font-family: "Heebo", "Tajawal", sans-serif;

    &::placeholder {
      color: #999;
      opacity: 1;
      overflow: visible;
    }

    &:focus {
      border: 1px solid #888;
    }

    &:disabled {
      background: #f5f5f5b5;
      cursor: not-allowed;
      opacity: 0.7;
    }
  }

  input {
    height: 50px;
    line-height: 50px;
    vertical-align: text-top;
  }

  textarea {
    resize: none;
    min-height: 150px;
    padding-top: 13px;
    line-height: 1.6;
  }
}

.selector {
  position: relative;

  /* TODO: change to placeholder? */
  .drop-btn-text {
    width: 100%;
    height: 50px;
    outline: none;
    border: var(--border);
    border-radius: 7px;
    padding: 16px 13px 12px;
    color: #999;
    cursor: pointer;

    ::selection {
      color: #999;
      background: transparent;
    }

    &.selected {
      color: #111;

      ::selection {
        color: #111;
        background: transparent;
      }
    }
  }

  &::after {
    border-color: #999 transparent transparent transparent;
    top: 28px;
    left: 17px;
    border-width: 6px;
    content: "";
    position: absolute;
    border-style: solid;
    transform: translateY(-50%);
    cursor: pointer;
  }

  &.active {
    .drop-btn-text {
      border: 1px solid #666;
    }

    &::after {
      border-color: transparent transparent #999 transparent;
      top: 22px;
    }
  }

  &[disabled] {
    background: #f5f5f5b5;
    cursor: not-allowed;
    opacity: 0.7;

    .drop-btn-text {
      cursor: not-allowed;
    }

    &::after {
      cursor: not-allowed;
    }
  }

  &.hide-nibble::after {
    border: none;
  }
}

.dropdown {
  /* box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 6px 0 rgb(134 134 134 / 8%),
    0 1px 2px 0 rgb(209 209 209 / 39%);
  border-radius: 7px; */
  position: absolute;
  width: 100%;
  z-index: 9999999;
  top: revert;
  color: #111;
  margin-top: -1px;

  .item {
    position: relative;
    cursor: pointer;
    border-bottom: var(--border);
    padding: 0 13px;
    height: 62px;
    color: #000;
    font-size: 14px;
    background: #fff;

    .text-container {
      padding-top: 7px;
    }

    &:first-of-type {
      border-radius: 10px 10px 0 0;
    }

    &:last-of-type {
      border-bottom: none;
      border-radius: 0 0 10px 10px;
    }

    &:hover {
      background: #fafafa;
    }

    &.active,
    &.active:hover {
      background: #edf5ff;
      color: #0459a5;
    }
  }

  .dropdown-content {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 6px 0 rgb(134 134 134 / 8%),
      0 1px 2px 0 rgb(209 209 209 / 58%);
    border-radius: 10px;
    position: absolute;
    z-index: 9999999;

    ::selection {
      color: #111;
      background: transparent;
    }

    .dropdown-group {
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04),
        0 2px 6px 0 rgb(134 134 134 / 8%), 0 1px 2px 0 rgb(209 209 209 / 39%);
      border-radius: 10px;
      margin-bottom: 3px;

      &:last-of-type {
        margin-bottom: 0;
      }
    }

    .dropdown-item {
      position: relative;
      cursor: pointer;
      border-bottom: 1px solid #d4d4d4;
      padding: 0 13px;
      height: 65px;
      font-size: 17px;
      background: #fff;

      .text-container {
        padding-top: 3px;

        .text {
          display: block;

          .description {
            display: block;
            font-size: 13px;
            color: #666;
            margin-top: 5px;

            &::selection {
              color: #666;
            }
          }
        }
      }

      &:first-of-type {
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
      }

      &:last-of-type {
        border-bottom: none;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
      }

      &:hover {
        background: #f9f9f9;
      }

      &.active,
      &.active:hover {
        background: #edf5ff;

        .description {
          color: #1987d5;
          color: #111;

          &::selection {
            color: #111;
          }
        }
      }
    }
  }
}

/* .dropdown {
  .list {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04),
      0 2px 6px 0 rgb(134 134 134 / 8%), 0 1px 2px 0 rgb(209 209 209 / 58%);
    border-radius: 7px;
    position: absolute;
    width: 100%;
    z-index: 9999999;
    top: 49px;
    color: #111;

    ::selection {
      color: #111;
      background: transparent;
    }

    .item {
      position: relative;
      cursor: pointer;
      border-bottom: var(--border);
      padding: 0 13px;
      height: 48px;
      font-size: 15px;
      background: #fff;

      .text-container {
        padding-top: 3px;

        .text {
          display: block;

          .subtext {
            display: block;
            font-size: 13px;
            color: #666;
            margin-top: 5px;

            &::selection {
              color: #666;
            }
          }
        }
      }

      &:first-of-type {
        border-radius: 10px 10px 0 0;
      }

      &:last-of-type {
        border-bottom: none;
        border-radius: 0 0 10px 10px;
      }

      &:hover {
        background: #f9f9f9;
      }

      &.active,
      &.active:hover {
         background: #edf5ff;

        .subtext {
          color: #1987d5;
          color: #111;

          &::selection {
            color: #111;
          }
        }
      }
    }
  }
} */
