:root {
  --bg-light: #ffffff;
  --text-light: #0d47a1;
  --card-light: #f1f8ff;
  --primary-light: #2196f3;
  --border-light: #bbdefb;

  --bg-dark: #0a1929;
  --text-dark: #4fc3f7;
  --card-dark: #102a43;
  --primary-dark: #00e5ff;
  --border-dark: #00b8d4;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-light);
  transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--primary-light);
  color: white;
}

body.dark-mode .navbar {
  background: var(--primary-dark);
}

.logo {
  font-weight: 600;
  font-size: 1.2rem;
}

.theme-btn, .logout-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 1rem;
}

.logout-btn {
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
}

.dashboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 1rem;
  background: var(--card-light);
}

body.dark-mode .dashboard {
  background: var(--card-dark);
}

.dash-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: opacity 0.2s;
}

body.dark-mode .dash-btn {
  background: var(--primary-dark);
}

.dash-btn:hover {
  opacity: 0.9;
}

.chat-container {
  max-width: 800px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 60vh;
  overflow-y: auto;
}

.welcome {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-light);
}

body.dark-mode .welcome {
  color: var(--text-dark);
}

.message {
  max-width: 80%;
  padding: 0.8rem 1.2rem;
  border-radius: 18px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
  white-space: pre-wrap;
}

.user-message {
  background: var(--primary-light);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-message {
  background: var(--card-light);
  color: var(--text-light);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

body.dark-mode .ai-message {
  background: var(--card-dark);
  color: var(--text-dark);
}

.input-area {
  display: flex;
  padding: 1rem;
  gap: 0.5rem;
  max-width: 800px;
  margin: 0 auto;
}

#user-input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  font-family: 'Poppins', sans-serif;
}

body.dark-mode #user-input {
  background: var(--card-dark);
  color: white;
  border-color: var(--border-dark);
}

#send-btn {
  padding: 0.8rem 1.5rem;
  background: var(--primary-light);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
}

body.dark-mode #send-btn {
  background: var(--primary-dark);
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: auto;
}

body.dark-mode .footer {
  color: var(--text-dark);
}

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

.typing {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  margin-left: 4px;
  animation: typing 1.4s infinite;
}

@keyframes typing {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}