/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1f2937;
}

/* ===== Login Page ===== */
.login-body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #eef2f7, #e6ebf2);
}

.login-box {
  background: #ffffff;
  padding: 45px 35px;
  width: 360px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: 0.3s ease;
}

.login-box h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 30px;
  letter-spacing: 0.5px;
}

.login-box input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  transition: 0.2s ease;
}

.login-box input:focus {
  border-color: #111827;
  outline: none;
}

.login-box button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #111827;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.login-box button:hover {
  background: #000000;
}

#error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
}

/* ===== Chat Layout ===== */
.chat-container {
  max-width: 850px;
  height: 95vh;
  margin: 20px auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

/* Header */
header {
  background: #111827;
  color: #ffffff;
  padding: 18px 24px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
}

/* Messages Area */
#messages {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  background: #f9fafb;
  scroll-behavior: smooth;
}

/* Scrollbar */
#messages::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 6px;
}

/* Message Bubble */
.message {
  max-width: 65%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #e5e7eb;
  position: relative;
  animation: fadeIn 0.2s ease-in-out;
}

.message strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  opacity: 0.7;
}

.message p {
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

/* My Message */
.my-message {
  margin-left: auto;
  background: #111827;
  color: white;
}

.my-message strong {
  opacity: 0.8;
}

/* Input Area */
.input-area {
  display: flex;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.input-area input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  transition: 0.2s ease;
}

.input-area input:focus {
  border-color: #111827;
  outline: none;
}

.input-area button {
  margin-left: 10px;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  background: #111827;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
}

.input-area button:hover {
  background: #000000;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .chat-container {
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .message {
    max-width: 80%;
  }
}
