body {
  font-family: Arial, sans-serif;
  background: black;
  color: white;
  margin: 0; padding: 0;
}

.box, .chat-list, .chat-box {
  background: rgba(0,0,0,0.3);
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  max-width: 400px;
}

input, select, button {
  margin: 5px 0;
  padding: 10px;
  border-radius: 10px;
  border: none;
  width: 90%;
}

button {
  background: #5d3fd3;
  color: white;
  font-weight: bold;
  cursor: pointer;
}
button:hover { background: #764af1; }

#messages {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(255,255,255,0.1);
  padding: 10px;
  border-radius: 10px;
}

/* Chat style Instagram-like */
.chat-box {
    display: flex;
    flex-direction: column;
    height: 70vh;
    padding: 10px;
    overflow-y: auto;
    background: #101010;
    border-radius: 12px;
    border: 1px solid #262626;
}

.message {
    max-width: 70%;
    margin: 6px 0;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.3;
    display: inline-block;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: #7b2cbf;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: #374146;
    color: #ffffff;
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    margin-top: 10px;

    
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
}

.chat-input button {
    background: #7b2cbf;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    margin-left: 10px;
    font-size: 18px;
    cursor: pointer;
}

/* Chat list style Instagram-like */
.chat-list {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    background: #101010;
    margin-bottom: 8px;
    text-decoration: none;
    color: #ffffff;
    border: 1px solid #262626;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f0f0f0;
}

.chat-avatar {
    font-size: 32px;
    margin-right: 12px;
}

.chat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-username {
    font-weight: bold;
    font-size: 16px;
}

.chat-last-message {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-timestamp {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

#message-input {
  background-color: #101010; /* sfondo scuro */
  color: #ffffff; /* testo bianco puro */
  border: 1px solid #333; /* bordo discreto */
}

#message-input::placeholder {
  color: #aaaaaa; /* colore placeholder più tenue */
}

#message-input:focus {
  outline: none;
  border-color: #7b2cbf; /* bordo viola quando attivo */
}
