body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: #010C12;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Chat Container */
.chat {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  position: relative;
}

/* Header for room info */
.chat-header {
  background: #1F2D36;
  margin: -20px -20px 0 -20px;
  padding: 16px 20px;
  border-bottom: 1px solid #2A3B47;
  position: sticky;
  top: 0;
  z-index: 100;
}

.room-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #ccc;
  gap: 16px;
}

.room-name {
  font-weight: bold;
}

.user-name {
  color: #3DAE43;
}

/* Messages Container */
.messages-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Messages */
.message {
  position: relative;
  padding: 16px 18px;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 16px;
  animation: fadeIn 0.3s ease-in;
  line-height: 1.4;
}

.message.user-message {
  align-self: flex-end;
  background-color: #3DAE43;
  color: white;
  text-align: left;
  border-top-right-radius: 4px;
  margin-left: 20%;
}

.message.bot-message {
  align-self: flex-start;
  background-color: #1F2D36;
  color: #ddd;
  text-align: left;
  border-top-left-radius: 4px;
  border: 1px solid #2A3B47;
  margin-right: 20%;
}

.message .user {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  color: #ccc;
  text-align: left;
}

.message.user-message .user {
  color: rgba(255, 255, 255, 0.9);
}

.message .text {
  text-align: left;
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
  margin: 0;
}

/* Message time stamp */
.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 8px;
  text-align: right;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: #666;
  padding: 60px 20px;
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
}

/* Input Form */
.input-form {
  background: #010C12;
  border-top: 1px solid #2A3B47;
  padding: 20px;
  position: sticky;
  bottom: 0;
  margin: 16px -20px -20px -20px;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.my-input-text {
  flex: 1;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #555;
  background-color: #1F2D36;
  color: #fff;
  font-size: 16px;
  box-sizing: border-box;
  min-height: 54px;
  transition: all 0.2s ease;
}

.my-input-text::placeholder {
  color: #aaa;
}

.my-input-text:focus {
  outline: none;
  border-color: #3DAE43;
  background-color: #273640;
  box-shadow: 0 0 0 2px rgba(61, 174, 67, 0.1);
}

/* Send Button */
.send-message {
  background-color: #3DAE43;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  min-width: 54px;
  min-height: 54px;
  flex-shrink: 0;
}

.send-message:hover {
  background-color: #369636;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.send-message:active {
  background-color: #2C7E2D;
  transform: translateY(0);
}

.send-message:disabled {
  background-color: #666;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .chat {
    padding: 16px;
    gap: 12px;
  }
  
  .chat-header {
    margin: -16px -16px 0 -16px;
    padding: 14px 16px;
  }
  
  .input-form {
    padding: 16px;
    margin: 12px -16px -16px -16px;
  }
  
  .messages-container {
    gap: 12px;
  }
  
  .message {
    max-width: 85%;
    padding: 14px 16px;
    margin-left: 15% !important;
    margin-right: 15% !important;
  }
  
  .my-input-text {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 50px;
    border-radius: 10px;
  }
  
  .send-message {
    padding: 14px 16px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 10px;
  }
  
  .room-info {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .chat {
    padding: 12px;
    gap: 10px;
  }
  
  .chat-header {
    margin: -12px -12px 0 -12px;
    padding: 12px;
  }
  
  .input-form {
    padding: 12px;
    margin: 10px -12px -12px -12px;
  }
  
  .messages-container {
    gap: 10px;
  }
  
  .message {
    max-width: 90%;
    padding: 12px 14px;
    margin-left: 10% !important;
    margin-right: 10% !important;
  }
  
  .my-input-text {
    padding: 12px 14px;
    min-height: 48px;
    font-size: 16px;
  }
  
  .send-message {
    padding: 12px 14px;
    min-width: 48px;
    min-height: 48px;
    font-size: 16px;
  }
  
  .room-info {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    font-size: 13px;
  }
  
  .empty-state {
    padding: 40px 16px;
    font-size: 15px;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .send-message:hover {
    transform: none;
    background-color: #3DAE43;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .send-message:active {
    background-color: #2C7E2D;
    transform: scale(0.98);
  }
  
  .my-input-text {
    font-size: 16px;
  }
}

/* Scrollbar styling */
.chat::-webkit-scrollbar {
  width: 8px;
}

.chat::-webkit-scrollbar-track {
  background: #1F2D36;
  border-radius: 4px;
}

.chat::-webkit-scrollbar-thumb {
  background: #3DAE43;
  border-radius: 4px;
}

.chat::-webkit-scrollbar-thumb:hover {
  background: #369636;
}

/* Focus styles for accessibility */
.send-message:focus-visible {
  outline: 2px solid #3DAE43;
  outline-offset: 2px;
}

.my-input-text:focus-visible {
  outline: 2px solid #3DAE43;
  outline-offset: 0;
}

/* Ensure proper spacing between elements */
.chat > *:not(:last-child) {
  margin-bottom: 8px;
}

/* Add some breathing room around the content */
.chat::before {
  content: '';
  display: block;
  height: 8px;
}

.chat::after {
  content: '';
  display: block;
  height: 8px;
}
