/* ==== VARIABLES ==== */
:root {
  --color-primary: #ff504d;
  --color-secondary: #00c9b7;
  --color-terciary: #ff8e43;
  --color-bg: #fffdf6;
  --color-dark: #333;
  --font-main: 'Poppins', sans-serif;
}

/* ==== BASE ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(to right, #fff8e7, #d9fff9);
  color: var(--color-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==== HEADER ==== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 60px;
  background: linear-gradient(to right, var(--color-terciary), var(--color-primary));
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  width: 65px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 25px;
}
.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: white;
  transition: width 0.3s ease;
}
.nav-links a:hover::after {
  width: 100%;
}

/* ==== CHAT GENERAL ==== */
#chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 700px;
  margin: 60px auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  overflow: hidden;
}

/* ==== MENSAJES ==== */
#messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#noMessages {
  text-align: center;
  color: #777;
  font-weight: 600;
}

.message {
  max-width: 65%;
  margin-bottom: 12px;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  word-wrap: break-word;
}

.message.sent {
  align-self: flex-end;
  background: var(--color-secondary);
  color: white;
}

.message.received {
  align-self: flex-start;
  background: #f3f3f3;
}

/* ==== INPUT Y BOTÓN ==== */
#sent {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
}

#messageInput {
  flex: 1;
  border: 2px solid var(--color-terciary);
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s ease;
}
#messageInput:focus {
  border-color: var(--color-primary);
}

#sendButton {
  background: var(--color-primary);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 25px;
  padding: 10px 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#sendButton:hover {
  background: var(--color-terciary);
  transform: scale(1.05);
}

/* ==== HOST LAYOUT ==== */
.host-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  margin: 60px;
}

.listaUsers {
  background: white;
  border-radius: 20px;
  padding: 25px;
  width: 250px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.listaUsers h2 {
  background: var(--color-primary);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 20px;
  margin-bottom: 20px;
}

#userList {
  width: 100%;
  height: 300px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}

#userList div {
  background: white;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}
#userList div:hover {
  background: var(--color-secondary);
  color: white;
}

/* ==== BOTÓN SUBIR PRODUCTO ==== */
#uploadButton {
  background: var(--color-terciary);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s ease;
  margin-top: 20px;
}
#uploadButton:hover {
  background: var(--color-primary);
  transform: scale(1.05);
}

/* ==== FOOTER ==== */
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 900px) {
  .host-layout {
    flex-direction: column;
    align-items: center;
  }

  .listaUsers {
    width: 90%;
  }

  #chat {
    width: 90%;
  }
}
