@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYREGULAR.OTF') format('opentype');
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SFPRODISPLAYBOLD.OTF') format('opentype');
  font-style: normal;
  font-weight: 700;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  font-family: 'SF Pro Display', sans-serif;
  background-color: #1a0933;
  overflow-x: hidden;
  line-height: 1.5;
}

/* SCROLLBAR */
.chat-messages::-webkit-scrollbar {
  width: 0.4vw;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: #060409;
  border-radius: 0.3vw;
}

.chat-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #9990aa;
}

.chat-container {
  display: flex;
  height: 100vh;
}

/* ZONA DEL CHAT */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 5% 3% 15%;
  background: linear-gradient(to bottom right, #850ba0, #4009ae, #770992, #4c00a8, rgb(231, 114, 56));
  text-align: center;
  position: relative;
}

/* Imagen centrada */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 2%;
  padding-top: 2%;
}

.avatar {
  width: 20%;
  max-width: 200px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1%;
  border: 0.4vw solid rgba(164, 160, 255, 0.7);
  box-shadow: 0 0.3vw 2vw rgba(26, 9, 51, 0.5);
  background: linear-gradient(to bottom right, #a4a0ff, #7d3fcf);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1 {
  font-size: 3vw;
  color: #ffffff;
  text-shadow: 0 0.15vw 0.3vw rgba(0, 0, 0, 0.3);
  margin-top: 2%;
  max-width: 80%;
  line-height: 1.2;
}

/* Contenedor del input centrado */
.input-container {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 80%;
  background-color: rgba(255, 255, 255, 0.079);
  border: 0.2vw solid rgba(165, 160, 255, 0.473);
  border-radius: 2vw;
  backdrop-filter: blur(1vw);
  box-shadow: 0 0.6vw 2vw rgba(0, 0, 0, 0.3);
  position: fixed;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  max-height: 30%;
  overflow-y: auto;
  z-index: 100;
  padding-bottom: 2%;
}

.chat-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  padding-bottom: 15%;
}

.chat-input {
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 2%;
  position: relative;
}

.input-fake {
  flex: 1;
  min-height: 10vh;
  font-size: 1.2rem;
  background: transparent;
  color: white;
  outline: none;
  border: none;
  overflow-y: hidden;
  word-break: break-word;
  white-space: pre-wrap;
  padding: 0;
  margin-bottom: 2%;
  line-height: 1.4;
  max-height: 40vh;
}

.input-fake:empty:before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.input-bottom-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.herramientas-btn {
  background: #7d3fcf;
  border: none;
  border-radius: 1vw;
  height: 5vh;
  min-width: 15%;
  padding: 0 2%;
  color: white;
  font-size: 1rem;
  font-weight: 500;
}

.left-buttons {
  display: flex;
  gap: 2%;
  align-items: center;
}

.right-buttons {
  display: flex;
  gap: 1%;
  align-items: center;
  margin-left: auto;
}

.func-btn {
  background: #7d3fcf;
  border: none;
  border-radius: 1vw;
  height: 5vh;
  width: 5vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.func-btn svg {
  width: 50%;
  height: 50%;
  stroke: white;
}

/* Mensajes */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 2%;
  overflow-y: auto;
  flex: 1;
  padding: 2% 0;
  width: 100%;
  max-width: 90%;
  margin: 0 auto;
  padding-bottom: 15%;
}

.message {
  display: flex;
  gap: 1%;
  align-items: flex-start;
  max-width: 80%;
}

.message .avatar {
  width: 6%;
  aspect-ratio: 1/1;
  border-radius: 50%;
}

.message .text {
  background-color: rgba(164, 160, 255, 0.25);
  padding: 1% 2%;
  border-radius: 1vw;
  font-size: 1rem;
  color: white;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.user .text {
  background-color: #7d3fcf;
}

/* Menú herramientas */
.herramientas-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 1vh);
  left: 0;
  width: 30vw;
  background: #2a0b5e;
  border-radius: 1vw;
  padding: 2%;
}

.herramientas-menu.active {
  display: block;
}

/* Responsive extra */
@media (max-width: 768px) {
  h1 {
    font-size: 5vw;
  }
  .avatar {
    width: 30%;
  }
  .input-container {
    max-width: 95%;
    border-radius: 4vw;
  }
}
