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

:root {
  --gray-100: #eceff1;
  --gray-200: #a5a3a3;
  --bluishCyan-100: #00b0ff;
}

/* ---------- */
/* Main Style */
/* ---------- */
.container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  min-width: 410px;
  padding: 2rem;
  background-image: url(images/ashok-acharya-G8XHYFHFgVc-unsplash.jpg);
}

/* messenger container */
.messenger {
  display: grid;
  margin: auto;
  background-color: white;
  font-family: 'Cairo', sans-serif;
}

/* chat list style */
.chat__list {
  padding: 2.3rem 2.4rem 2.3rem 2.2rem;
  min-width: 340px;
}

.chat__search {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding-bottom: 1.9rem;
}

.chat__search input {
  width: 14.2rem;
  padding-left: 0.8rem;
  border-style: none;
  border: 1px solid #e5e4e4;
  border-radius: 50px;
  background-color: var(--gray-100);
}

.chat__search .chat__post {
  height: 3.2rem;
  width: 3.2rem;
  background-color: var(--bluishCyan-100);
  border-style: none;
  border-radius: 50%;
  text-align: center;
  line-height: 3.8rem;
  cursor: pointer;
}

.chat__search .chat__post svg {
  height: 1.3rem;
  fill: white;
}

.chat__item,
.chat__search {
  border-width: 1px;
  border-style: none none solid;
  border-color: var(--gray-100);
}

.chat__item {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-width: 1px;
  border-style: none none solid;
  border-color: var(--gray-100);
  font-size: 1rem;
}

.chat__item:last-child {
  position: relative;
  border-style: none;
  z-index: 1;
}

.chat__item:last-child::before {
  content: '';
  position: absolute;
  width: calc(100% + 4.4rem);
  height: 100%;
  -webkit-transform: translateX(-2.1rem);
  -ms-transform: translateX(-2.1rem);
  transform: translateX(-2.1rem);
  background-color: var(--bluishCyan-100);
  z-index: -1;
}

.chat__item:last-child div {
  color: white;
}

.chat__main-info {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.chat__picture {
  margin-right: 0.5rem;
}

.chat__picture img {
  width: 3.5rem;
  border-radius: 50%;
}

.chat__info {
  margin-right: 1rem;
}

.chat__name {
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.chat__message {
  color: var(--gray-200);
}

.chat__hour {
  position: absolute;
  top: 0.8rem;
  right: 0;
  -ms-flex-item-align: start;
  align-self: flex-start;
  margin-top: 0.5rem;
  color: var(--gray-200);
}

/* chat content style */

.chat__receiver {
  padding: 1.3rem 2.3rem;
  background-color: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  border-left-color: transparent;
}

.chat__receiver span:first-child {
  color: var(--gray-200);
}

.chat__receiver span:last-child {
  font-weight: bold;
}

.chat__date--one {
  position: relative;
  margin: 3rem 0 1.8rem;
  text-align: center;
  color: var(--gray-200);
}

.chat__date--one::before,
.chat__date--one::after {
  content: '';
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 20%;
  height: 1px;
  background-color: var(--gray-100);
}

.chat__date--one::before {
  left: 1rem;
}

.chat__date--one::after {
  right: 1rem;
}

.chat__convo {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 10rem;
}

.message {
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  padding: 1rem;
  border-radius: 3px;
  font-size: 1.24rem;
}

.chat__received {
  position: relative;
  margin: 0.3rem 2.6rem;
  background-color: var(--bluishCyan-100);
  color: white;
}

.chat__received::before {
  content: '';
  position: absolute;
  top: 50%;
  top: 43%;
  left: -48px;
  -webkit-transform: translate(-100%, -50%);
  -ms-transform: translate(-100%, -50%);
  transform: translate(-100%, -50%);
  margin: 0.3rem 3rem;
  border: 5px solid transparent;
  border-left: 0;
  border-right: 8px solid var(--bluishCyan-100);
}

.chat__sent {
  position: relative;
  -ms-flex-item-align: end;
  align-self: flex-end;
  margin: 0.3rem 2.9rem;
  background-color: var(--gray-100);
  color: black;
}

.chat__sent::after {
  content: '';
  position: absolute;
  top: -10%;
  right: 0;
  -webkit-transform: translate(100%, -50%);
  -ms-transform: translate(100%, -50%);
  transform: translate(100%, -50%);
  margin: 2rem auto;
  border: 5px solid transparent;
  border-right: 0;
  border-left: 8px solid var(--gray-100);
}

.chat__send {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  width: calc(100% - 4.4rem);
  margin: 2rem auto;
  padding: 1rem;
  border-radius: 5px;
  background-color: var(--gray-100);
}

.chat__send div:first-child {
  display: flex;
  flex-basis: 75%;
}

.chat__send input[name='upload'] {
  display: none;
}

.chat__send label {
  cursor: pointer;
}

.chat__send svg {
  position: relative;
  top: 2px;
  fill: var(--gray-200);
}

.chat__send-message,
.chat__emoji {
  border-style: none;
  cursor: pointer;
}

input.chat__text {
  margin-left: 0.5rem;
  background-color: var(--gray-100);
  border-style: none;
}

input.chat__text:focus-visible {
  outline: none;
}

@media screen and (min-width: 1000px) {
  .messenger {
    grid-template-columns: 366px 1fr;
  }

  .chat__content {
    width: 614px;
  }
}

/* --------------- */
/* Personal Footer */
/* --------------- */

.footer {
  min-width: 300px;
  margin: 2rem 1rem;
  font-family: 'Cairo', sans-serif;
  line-height: 1.5;
  text-align: center;
}

.platform {
  font-weight: 600;
  color: #2eca7f;
}

.coder {
  font-weight: 600;
  color: #cf2937;
}

a {
  text-decoration: none;
}
