* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
  }
  
  .chat-container {
    width: 400px;
    height: 600px;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
  }
  
  .chat-header {
    background: #6a5acd;
    color: #fff;
    padding: 1rem;
    text-align: center;
  }
  
  .chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .message {
    padding: 0.7rem;
    border-radius: 10px;
    max-width: 70%;
    word-wrap: break-word;
  }
  
  .message.sent {
    background: #6a5acd;
    color: white;
    align-self: flex-end;
  }
  
  .message.received {
    background: #f1f1f1;
    align-self: flex-start;
  }
  
  .chat-footer {
    display: flex;
    gap: 10px;
    padding: 1rem;
    border-top: 1px solid #ddd;
  }
  
  .chat-footer input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 5px;
  }
  
  .chat-footer button {
    padding: 0.7rem 1rem;
    background: #6a5acd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
  }
  
  .chat-footer button:hover {
    background: #4b3ba5;
  }