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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #111b21;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Screens */
.screen {
  display: none;
  height: 100vh;
  height: 100dvh;
}
.screen.active {
  display: flex;
}

/* ==================== AUTH SCREEN ==================== */
.auth-container {
  margin: auto;
  text-align: center;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
}

.auth-icon {
  margin-bottom: 1.5rem;
}

.auth-container h1 {
  color: #e9edef;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.auth-container p {
  color: #8696a0;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#auth-form input {
  background: #2a3942;
  border: 1px solid #3b4a54;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #e9edef;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#auth-form input:focus {
  border-color: #00a884;
}

#auth-form button {
  background: #00a884;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

#auth-form button:hover {
  background: #06cf9c;
}

.error {
  color: #ef4444 !important;
  font-size: 0.8rem !important;
  margin-top: 0.5rem !important;
}

.hidden {
  display: none !important;
}

/* ==================== CHAT SCREEN ==================== */
#chat-screen {
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  background: #0b141a;
}

/* Header */
.chat-header {
  background: #202c33;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #313d45;
  flex-shrink: 0;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #00a884;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.header-info {
  flex: 1;
}

.header-name {
  color: #e9edef;
  font-size: 1rem;
  font-weight: 500;
}

.header-status {
  color: #8696a0;
  font-size: 0.75rem;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  background: #0b141a;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='p' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='20' cy='20' r='1' fill='%23ffffff' opacity='0.03'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='200' height='200' fill='url(%23p)'/%3E%3C/svg%3E");
}

.date-divider {
  text-align: center;
  margin: 0.75rem 0;
}

.date-divider span {
  background: #182229;
  color: #8696a0;
  font-size: 0.7rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Message Bubbles */
.message {
  display: flex;
  margin-bottom: 0.375rem;
  animation: fadeIn 0.25s ease;
}

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

.message.bot {
  justify-content: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 85%;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  position: relative;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 0.9rem;
}

.message.bot .bubble {
  background: #202c33;
  color: #e9edef;
  border-top-left-radius: 0;
}

.message.user .bubble {
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 0;
}

.bubble .timestamp {
  font-size: 0.65rem;
  color: #8696a0;
  float: right;
  margin-left: 0.75rem;
  margin-top: 0.25rem;
}

.message.user .bubble .timestamp {
  color: rgba(255, 255, 255, 0.5);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  align-items: center;
}

.typing-indicator .dot {
  width: 7px;
  height: 7px;
  background: #8696a0;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Choice Buttons */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.choice-btn {
  background: transparent;
  border: 1px solid #00a884;
  color: #00a884;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.choice-btn:hover {
  background: #00a884;
  color: white;
}

.choice-btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ==================== INPUT AREA ==================== */
.chat-input-area {
  background: #202c33;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-top: 1px solid #313d45;
  flex-shrink: 0;
  min-height: 60px;
}

.mic-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #00a884;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mic-btn:hover {
  background: #06cf9c;
  transform: scale(1.05);
}

.mic-btn:active {
  transform: scale(0.95);
}

.mic-btn.disabled {
  background: #3b4a54;
  cursor: not-allowed;
  pointer-events: none;
}

/* Recording indicator */
.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e9edef;
  font-size: 0.9rem;
  width: 100%;
  padding: 0.25rem 0;
}

.recording-dot {
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.recording-indicator span {
  flex: 1;
}

.stop-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.stop-btn:hover {
  background: #dc2626;
}

/* Waveform */
.waveform-container {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
}

#waveform-canvas {
  width: 100%;
  height: 48px;
}

/* ==================== UTILITIES ==================== */
.reveal-text .word {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.reveal-text .word.visible {
  opacity: 1;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #374248;
  border-radius: 3px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  #chat-screen {
    max-width: 100%;
  }

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