:root {
  --card-bg: #fff;
  --card-border: solid 0.5px #414141;
  --bg: #f3f3f3;
  --text-input-bg: #10141c;
  --input-bg1: #f3f3f3;
  --corner-r: 21px;
  --text: #fff;
  --action-btn-bg: #6ea9ff;
  --action-btn-border: 2px solid #4c91f6;
}

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
* {
  font-family: "Inter", sans-serif;
  color: #424242;
  box-sizing: border-box;
}

*::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
*::-webkit-scrollbar-track {
  border-radius: 5px;
  background-color: transparent;
}
*::-webkit-scrollbar-track:hover {
  background-color: #d1dadc23;
}
*::-webkit-scrollbar-track:active {
  background-color: #d1dadc3b;
}
*::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #3c4353;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: #444c5e;
}
*::-webkit-scrollbar-thumb:active {
  background-color: #5b667e;
}

body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
}

.container {
  width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 10px;

  .login-container {
    position: relative;
    background: #fff;
    border-radius: 30px;
    padding: 10px;
    width: 100%;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .app-image {
      width: 100px;
      height: 100px;
      position: absolute;
      left: 50%;
      top: -50px;
      transform: translateX(-50%);
    }
    h1 {
      margin: 25px 0 5px 0;
    }
    h3 {
      margin: 0;
      font-size: 30px;
    }
    #username,
    #password {
      background: var(--input-bg1);
      height: 50px;
      width: 100%;
      margin: 4px 40px;
      padding: 0 20px;
      border-radius: 30px 30px 20px 20px;
      border: none;
      font-size: 16px;
      &:focus {
        outline: var(--action-btn-border);
      }
    }
    #password {
      border-radius: 20px;
    }
    #loginBtn {
      width: 100%;
      height: 50px;
      margin: 4px 40px;
      padding: 0 20px;
      border-radius: 20px 20px 30px 30px;
      background: var(--action-btn-bg);
      border: var(--action-btn-border);
      font-size: 16px;
      font-weight: 600;
      &:hover {
        cursor: pointer;
        background: #98c1ff !important;
      }
    }
    span {
      opacity: 0.5;
      #open-register-text {
        opacity: 1;
        color: #6ea9ff;
        text-decoration: underline;
        cursor: pointer;
      }
    }
  }
  .go-to-install-container {
    background: #fff;
    border-radius: 30px;
    padding: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    p {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
    }
    a {
      background: var(--action-btn-bg);
      border: var(--action-btn-border);
      border-radius: 30px;
      padding: 5px 15px;
      display: flex;
      justify-content: center;
      align-items: center;
      text-decoration: none;
    }
  }
}

#login {
  margin: auto;
}

#app {
  display: none;
  width: 100%;
  height: 100vh;
}

#sidebar {
  width: 260px;
  height: calc(100% - 80px);
  padding: 10px;
  background: var(--card-bg);
  margin: 10px 5px 10px 10px;
  border-radius: var(--corner-r);
  color: var(--text);
  .sidebar-header {
    width: 100%;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    h4 {
      margin: 10px 0;
    }
    #chat-update-btn {
      border: none;
      border-radius: 50%;
      width: 30px;
      height: 30px;
    }
  }
}

.user-profile-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 260px;
  height: 50px;
  padding: 10px;
  background: var(--card-bg);
  margin: 10px 5px 10px 10px;
  border-radius: var(--corner-r);
  color: var(--text);
  #user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
  .user-info {
    .user-name {
      font-weight: 600;
    }
  }
  button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #ef233c;
    display: flex;
    align-items: center;
    justify-content: center;
    span {
      font-size: 15px;
      color: #fff;
    }
    &:hover {
      background: #f14357;
    }
  }
}

.chat-btn {
  width: 100%;
  background: #f3f3f3;
  border: none;
  text-align: left;
  padding: 8px;
  margin-bottom: 3px;
  height: 56px;
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  flex-direction: row;

  gap: 8px;
  &:first-child {
    border-radius: 20px 20px 12px 12px;
  }
  &:last-child {
    border-radius: 12px 12px 20px 20px;
  }

  img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
  .chat-info {
    width: 100%;

    .title-block {
      width: 100%;
      display: inline-flex;
      justify-content: space-between;
      align-items: center;
      .chat-title {
        font-weight: 600;
      }
      .time-block {
        font-size: 12px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 3px;
        .status {
          transform: translateY(-1px);
          font-family: "Segoe UI Emoji", "Segoe UI Symbol", Arial, sans-serif;
        }
      }
    }
    .subtitle-block {
      width: 100%;
      display: inline-flex;
      justify-content: space-between;
      align-items: center;
      .chat-subtitle {
        font-size: 16px;
      }
      .unread-count {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        font-size: 14px;
        background-color: #6ea9ff;
      }
    }
  }
}

#chat {
  position: relative;
  margin: 10px 10px 10px 5px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--card-bg);
  border-radius: var(--corner-r);
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 60px;
}

.message {
  max-width: 70%;
  padding: 8px;
  border-radius: 15px;
  font-size: 14px;
  position: relative;
}

.mine {
  align-self: flex-end;
  background: radial-gradient(
    circle farthest-corner at top center,
    #2f91fb 0%,
    #297ad2 100%
  );
  border: solid 1px #2580e3;
  border-radius: 16px 8px 8px 16px;
}

.other {
  align-self: flex-start;
  background: #2a2a2a;
  color: white;
  border: solid 1px #202020;
  border-radius: 8px 16px 16px 8px;
}

.message.read {
  opacity: 0.8;
}

.meta {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.reply {
  font-size: 12px;
  border-left: 3px solid #bbb;
  padding-left: 6px;
  margin-bottom: 4px;
  opacity: 0.8;
  background-color: #20000000;
}

#typing {
  font-size: 12px;
  padding: 6px 12px;
  color: #666;
  display: none;
}

#replyBox {
  padding: 6px 12px;
  background: #eee;
  font-size: 13px;
  display: none;
}

#send {
  position: absolute;
  width: calc(100% - 20px);
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: transparent;
}

#send input {
  flex: 1;
  padding: 10px 20px;
  height: 40px;
  background: var(--text-input-bg);
  border-radius: var(--corner-r);
  outline: none;
  border: none;
  color: #fff;
}

#send button {
  padding: 10px 16px;
  border-radius: var(--corner-r);
  background: radial-gradient(
    circle farthest-corner at top center,
    #2f91fb 0%,
    #297ad2 100%
  );
  border: solid 1px #2580e3;
}

#scrollDown {
  position: absolute;
  right: 16px;
  bottom: 80px;
  padding: 6px 10px;
  display: none;
}
