/* Base styles and reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: #333;
  background-color: #f9f9fb;
  height: 100vh;
  overflow: hidden;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul {
  list-style: none;
}

/* App container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* Sidebar styles */
.sidebar {
  width: 280px;
  background-color: #fff;
  border-right: 1px solid #e6e6e6;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.logo-accent {
  color: #ff6b6b;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ff6b6b;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  width: 100%;
  justify-content: center;
  transition: background-color 0.2s;
}

.new-chat-btn:hover {
  background-color: #ff5252;
}

.recent-chats {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
}

.recent-chats h2 {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-item:hover {
  background-color: #f5f5f5;
}

.chat-item.active {
  background-color: #f0f0f0;
}

.chat-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.chat-title {
  font-size: 14px;
  font-weight: 500;
}

.chat-time {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
}

.settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  padding: 8px 12px;
  border-radius: 6px;
  width: 100%;
  transition: background-color 0.2s;
}

.settings-btn:hover {
  background-color: #f5f5f5;
}

/* Main container styles */
.main-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f9f9fb;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
}

.chat-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.header-btn {
  color: #666;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.header-btn:hover {
  background-color: #f5f5f5;
}

.chat-messages {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.message.user .message-content {
  background-color: #ff6b6b;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-content {
  background-color: white;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-time {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  text-align: right;
}

.chat-input-container {
  padding: 16px 24px 24px;
  background-color: #fff;
  border-top: 1px solid #e6e6e6;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 12px;
  padding: 8px 16px;
}

#user-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.send-btn {
  color: #ff6b6b;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.send-btn:hover {
  background-color: #f0f0f0;
}

.input-footer {
  margin-top: 8px;
  text-align: right;
}

.input-info {
  font-size: 12px;
  color: #888;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background-color: white;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: #ccc;
  border-radius: 50%;
  animation: typing-animation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-animation {
  0%,
  60%,
  100% {
    transform: translateY(0);
    background-color: #ccc;
  }
  30% {
    transform: translateY(-4px);
    background-color: #999;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: -280px;
    transition: left 0.3s ease;
    z-index: 10;
    height: 100%;
  }

  .sidebar.open {
    left: 0;
  }

  .main-container {
    width: 100%;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .chat-header h2 {
    font-size: 16px;
  }

  .message {
    max-width: 90%;
  }
}
