@import url("https://fonts.googleapis.com/css2?family=Neucha&family=Montserrat:wght@400;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #635bff, #7c4dff);
  --surface-gradient: linear-gradient(to bottom, #ffffff, #f8faff);
  --primary: #635bff;
  --primary-dark: #4c45cc;
  --text-primary: #1a1f36;
  --text-secondary: #4f566b;
  --text-tertiary: #697386;
  --border-color: #e6e8f0;
  --surface: #f7fafc;
  --surface-dark: #edf2f7;
}

body {
  font-family: "Montserrat", serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-gradient);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 1rem;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: rgb(139, 92, 246);
}

header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: calc(100vh - 140px);
  padding-bottom: 0;
}

.chat-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  margin-bottom: calc(3.5rem + 32px);
}

.messages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.message {
  display: flex;
  padding: 1rem;
  max-width: 85%;
  animation: fadeIn 0.3s ease-in;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
}

.message.user {
  margin-left: auto;
  background: var(--primary-gradient);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.message.bot {
  margin-right: auto;
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 0.25rem;
}

.message-content {
  flex: 1;
  line-height: 1.5;
}

.input-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  background-color: white;
  z-index: 100;
}

.text-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f7f7f8;
  border-radius: 0.75rem;
  padding: 0.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.input-icons {
  display: flex;
  gap: 0.5rem;
  padding-left: 0.5rem;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #40414f;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.text-input {
  flex: 1;
  border: none;
  background: none;
  padding: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  color: var(--text-primary);
}

.text-input:focus {
  outline: none;
}

.voice-button {
  padding: 0.5rem;
  margin-right: 0.25rem;
  transition: all 0.2s ease;
  position: relative;
}

.voice-button i {
  font-size: 1.25rem;
  transition: all 0.2s ease;
  color: var(--text-tertiary);
}

.voice-button.recording i {
  color: #dc2626;
}

.voice-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.send-button {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--primary-gradient);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(99, 91, 255, 0.2);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.mic-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 0.75rem;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.mic-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: rgba(99, 91, 255, 0.05);
}

.mic-button.recording {
  background-color: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

.status {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  background-color: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  margin-left: 0.5rem;
}

.play-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: rgba(99, 91, 255, 0.05);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white; /* or any background */
  z-index: 9999;
}

.loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
