@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
  --primary-color: #5f3dc4;
  --primary-light: #7e57c2;
  --background: #E3F2FD;
  --text-primary: #000;
  --text-secondary: #495057;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: var(--background);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-container {
  max-width: 460px;
  max-height: 620px;
  margin: 0 auto;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.chat-header {
  padding: 16px 0;
  position: relative;
  text-align: center;
  color: #fff;
  background: #724ae8;
  border-radius: 15px 15px 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header h2 {
  font-size: 1.4rem;
  padding: 6px 0;
}

.model-selector {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.model-selector select {
  background-color: #5f3dc4;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
}

.model-selector select:focus {
  outline: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.8rem 1rem;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  height: 510px;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.message-content {
  max-width: 70%;
  padding: 1rem;
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message.user .message-content p {
  padding: 12px 16px;
  border-radius: 10px 10px 0 10px;
  color: white;
  font-size: 0.95rem;
  background: var(--primary-color);
}

.message.ai .message-content {
  border-radius: 10px 10px 10px 0;
  background: #f2f2f2;
}

.message.ai .message-content p {
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border-radius: 0 0 15px 15px;
  border-top: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ccc;
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.preview:hover .delete-btn {
  opacity: 1;
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.input-row input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
  height: 44px;
}

.input-row input[type="text"]:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(95, 61, 196, 0.1);
}

.file-input input {
  display: none;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 1;
  font-size: 28px;
  vertical-align: middle;
  color: var(--primary-color);
  background-color: #fff;
}

.file-input label {
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  transition: all 0.2s;
}


button {
  padding: 0 1rem;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  height: 44px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-row {
  gap: 0.5rem;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}