@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&family=Protest+Strike&display=swap");

@media (prefers-color-scheme: dark) or (prefers-color-scheme: light) {
  .chat-message-section .message-item .message-name-disp {
    color: var(--light-bg) !important;
  }
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.container {
  width: 90vmin;
  height: 95vh;
  box-shadow: var(--roundshadow);
  border-radius: var(--min);
  /* border-radius: calc(var(--min) + 5px) calc(var(--min) + 5px) var(--min) */
  /* var(--min); THIS IS SUPPOSEDLY JUST var(--min) but the top tips has a white mark for some reason */
  position: relative;
  /* display: flex; */
  /* flex-direction: column; */
  display: grid;
  /* grid-auto-rows: auto; */
  grid-template-rows: 3.3rem auto 4rem;
  overflow: hidden;
}

.chat-hat-section {
  background: var(--secondary);
  display: flex;
  align-items: end;
  width: 100%;
  position: relative;
  justify-content: space-between;
  /* padding: 0.3rem 0.8rem; */
  padding: 0px 0.6rem;
  align-items: center;
  box-shadow: 0px 6px 15px 6px rgba(0, 0, 0, 0.1),
    0px 0px 7px 2px rgba(0, 0, 0, 0.5);
  z-index: 100;
  /* border-radius: var(--min) var(--min) 0px 0px; */
}

.chat-hat-section header {
  /* background: blue; */
  padding: 1px;
  display: block;
  height: 2.5rem;
  /* place-items: center; */
}

.chat-hat-section header img {
  padding: 0;
  height: inherit;
  /* border: solid 1px red; */
}

.chat-hat-section h1 {
  color: var(--light-bg);
  opacity: 80%;
  font-size: 22px;
  /* padding: 10px; */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.chat-setting-section {
  display: none;
  background: var(--main-bg);
  position: absolute;
  width: 100%;
  overflow-y: auto;
  top: 3.3rem;
  padding: 1.5rem;
  height: calc(100vh - 3.3rem);
  flex-direction: column;
  color: var(--primary);
  gap: 14px;
  font-size: 16px;
  position: absolute;
  /* left: calc(100% + 10px); */
  transition: left 1s ease-out;
  box-shadow: -2px 0px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
  /*📝TO-DO: set opacity to low and while in front of the chat-message-section the message secton should be blurd, */
  /* opacity: 0.96; */
  /* backdrop-filter: blur(5px); */
}

.chat-setting-section h2 {
  color: var(--light-bg);
  font-weight: 600;
  font-size: 1.3rem;
  opacity: 1;
  opacity: 0.85;
}

/* .chat-setting-section .setting-input {} */

.chat-setting-section .setting-input {
  display: flex;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
}

.chat-setting-section .setting-input .icon {
  /* background: var(--main-bg); */
  background: black;
  height: 2rem;
  border-radius: 6px;
  font-weight: 700;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}

/* .chat-setting-section .setting-input label { */
/* font-weight: 600; */
/* font-size: 14px; */
/* } */

.chat-setting-section .setting-input input {
  max-width: 100%;
  border: none;
  padding: 10px;
  border-radius: 10px;
  /* background: var(--main-bg); */
}

.chat-setting-section .account-info-wrapper {
  margin-top: 1rem;
  color: white;
  padding-top: 1rem;
  outline: solid 0.1rem rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: var(--min);
}

.chat-setting-section .account-info-wrapper p {
  opacity: 0.45;
  margin-top: 0.3rem;
}

.chat-setting-section .account-info-wrapper p span {
  opacity: 0.65;
}

.chat-setting-section .account-info-wrapper #logout-btn {
  margin: 1rem 0;
  background: rgb(223, 79, 79);
  font-weight: 600;
  letter-spacing: 6%;
  /* background: red; */
  border-radius: var(--min);
  padding: 0.5rem 1.5rem;
  transition: background 0.2s ease-in;
  color: white;
}

.chat-setting-section .account-info-wrapper #logout-btn:hover {
  background: rgb(224, 42, 42);
  transition: background 0.2s ease-in;
  color: rgb(255, 255, 255);
  font-weight: 700;
}
.chat-setting-section .account-info-wrapper #logout-btn:active {
  background: white;
  color: rgb(223, 79, 79);
  transition: none;
}

.chat-message-section {
  background: var(--main-bg);
  padding: 1.5rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  /* justify-content: flex-end; */
  gap: 1.4rem;
  /* border: solid 2px red; */
  overflow-y: scroll;
  /* z-index: -2; */
  scroll-behavior: smooth;
}

.chat-message-section:empty::before {
  content: "No messages";
  display: grid;
  /* background-color: red !important; */
  height: 100%;
  opacity: 0.5;
  width: 100%;
  place-items: center;
}

.chat-message-section .message-item {
  display: flex;
  align-self: flex-start;
  align-items: center;
  max-width: 60vmin;
  gap: 10px;
  position: relative;
  /* overflow: scroll; */

  /* background: red; */
  /* border: solid 2px blue; */
}

.chat-message-section .message-item span {
  position: relative;
  background: rgb(79, 95, 108);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;

  color: var(--light-bg);
}

.chat-message-section .message-item > * {
  box-shadow: 1px 2px 7px rgba(0, 0, 0, 0.4);
}

.chat-message-section .message-item .message-name-disp {
  /* width: 3.8rem; */
  width: max-content;
  /* border: solid 1px red; */
  color: black;
  opacity: 0.411;
  font-size: 0.7rem;
  position: absolute;
  /* bottom: 98%; */
  top: -1.3rem;
  left: 0.7rem;
}

.chat-message-section .message-item:focus {
  margin-bottom: 1.2rem;
  /* background: red; */
}

.chat-message-section .message-item:focus .message-date-disp {
  display: inline-block;
}

.chat-message-section .message-item .message-date-disp {
  display: none;
}

.chat-message-section .message-item .message-date-disp {
  position: absolute;
  left: 0.5rem;
  width: max-content;
  min-width: 100%;
  text-align: center;
  top: calc(100% + 0.2rem);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.2);
}

.chat-message-section .message-item img {
  height: 2.5rem;
  align-self: flex-start;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-image: url("default-profile.jpg");
  background-position: center;
  background-size: contain;
}

.chat-message-section .message-item img[src$=".png"] {
  background: radial-gradient(white, rgb(180, 180, 180));
}

/* 
.chat-message-section .message-item[data-user="@dave190212"] {
  align-self: flex-end;
}

.chat-message-section .message-item[data-user="@dave190212"] img {
  display: none;
}

.chat-message-section .message-item[data-user="@dave190212"] span {
  background: rgb(50, 80, 131);
} */

.chat-send-section {
  background: rgb(39, 39, 39);
  display: grid;
  /* align-items: center; */
  /* padding: 0.5rem; */
  border-top: solid 1px rgb(47, 52, 56);
  grid-template-columns: 2.5rem auto 6rem;
  /* UPDATE THIS 🍟🍔🍔🍟🍟🍟🌭🧈🥙🧈🥗🥗 */
  padding: 0rem 1rem;
  grid-template-columns: auto 3rem;
  grid-auto-rows: 2.5rem;
  gap: 0.2rem;
  align-content: center;
  /* background: var(--secondary); */
  z-index: 5;
}

.chat-send-section #message-send-button {
  display: grid;
  place-items: center;
  /* background: rgb(22, 22, 22); */
  background: transparent;
  /* height: 2.5rem; */
  /* padding: 0px 10px; */
  border-radius: 0.5rem;
  fill: var(--light-bg);
}
.chat-send-section #message-send-button:active {
  background: rgba(255, 255, 255, 0.03);
  fill: rgb(255, 255, 255);
}

.chat-send-section #message-send-button svg {
  width: 1.5rem;
  /* padding: 0 0.1rem; */
}

/* NEED UPdATE THEN ADD THIS FEATURE 🍕🍕🍕🍳🍳🥖🍗🍗🍗🍗🍙🍙🍚🍚🍚🍧🍧🍧*/
.chat-send-section .send-media {
  display: none;
}

.chat-send-section .chat-send-btn {
  padding: 0px 10px;
  aspect-ratio: auto;
  /* transition: background 1s; */
}

.chat-send-section input {
  /* height: 2.5rem; */
  border-radius: 2rem;
  border: none;
  font-size: 1.2rem;
  /* color: rgb(49, 49, 49); */
  min-width: 10px;
  padding: 0.5rem 1rem;
  box-shadow: 0px 2px 8px 01px rgba(0, 0, 0, 0.138);
}

.chat-send-section ~ input:focus {
  grid-template-columns: 1rem auto 6rem;
  border: solid 1px red;
}

/* TO-DO: Remove default image borders */

/* TO-DO: MAKE A SHADOW FOR THE 'chat-hat-section' maybe include 'chat-send-section'. */
/* TO-DO: SET THE BEHAVIOUR OF THE 'chat-send-section' when INPUT AT FOCUS. */
/* TO-DO:  Make the chat boxes from users */
/* to-do: Set it that the last chats are the ones visible; */

/* TO-DO: SET THE CHAT SETTINGS UX/UI; */

/* TO-DO: Finalize make it responsive */

.spam-message-note {
  opacity: 0.3;
  font-size: 0.9rem;
  text-align: center;
}

/* MEDIA QUERY 🍙🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚🍚 */

/* MOBILE  📱📱📱📱📱📱📱📱📱📱📱*/

@media (max-width: 450px) {
  .container {
    width: 100%;
    height: 100vh;
  }

  .logo {
    display: grid;
    place-items: center;
  }

  .logo #logo-image {
    height: 2.5rem;
  }

  #room-name-title {
    /* background-color: red; */
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.5;
  }

  .chat-setting-section .setting-input input {
    width: 100%;
  }

  .hamburger-icon {
    margin-left: auto;
    /* background: red; */
  }

  .chat-message-section .message-item span {
    border-radius: 0.9rem;
    font-size: 0.9rem;
    /* background-color: red !important; */
  }

  .chat-send-section {
    padding: 0 0.5rem;
  }
}

@media (max-width: 350px) {
  .logo {
    display: none !important;
  }

  .chat-setting-section {
    padding: 1rem 0.7rem;
  }

  .chat-setting-section h2 {
    font-size: 1.1rem;
  }

  .chat-send-section *,
  .chat-send-section .chat-send-btn {
    font-size: 1rem !important;
  }

  .chat-message-section {
    padding: 10px;
  }

  .chat-message-section .message-item span {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 300px) {
  .chat-message-section .message-item {
    max-width: 85vmin !important;
    font-size: 0.9rem;
  }
}

@media (max-width: 240px) {
  .chat-message-section .message-item {
    font-size: 0.8rem !important;
  }

  .chat-send-section {
    grid-template-columns: auto 2rem;
  }

  .chat-send-section * {
    font-size: 0.86rem !important;
  }

  .chat-send-section #message-send-button {
    padding: 0;
  }

  .chat-send-section #message-send-button svg {
    width: 1.5rem;
  }

  .chat-message-section .message-item img {
    height: 2.1rem;
  }

  .chat-message-section .message-item span {
    font-size: 0.75rem;
  }
}

/*SPECIAL STYLINGS 👑👑👑👑👑*/

.chat-message-section .message-item[data-user="@DadosS5323sFS"]::before,
.chat-message-section .message-item[data-user="@Eee6gZbm8bfUM"]::before,
.chat-message-section .message-item[data-user="@JoyCPRrAmMQ1Z"]::before {
  content: "";
  background-image: url("crown.png");
  /* background-color: white; */
  /* display: inline-block; */
  bottom: 2rem;
  position: absolute;
  aspect-ratio: 1 / 1;
  background-size: contain;
  width: 1.3rem;
  left: calc(2.5rem / 2);
  transform: translateX(-50%);
  z-index: 1;
}
