/* ============================================
   LispMind Web — Dark Modern Chatbot Theme
   ============================================ */

:root {
  --primary-color: #00d4ff;
  --secondary-color: #6366f1;
  --background-dark: #0f0f1e;
  --background-card: #1a1a2e;
  --background-light: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #b0b0c0;
  --border-color: #2a2a3e;
  --ai-bubble: #16213e;
  --user-bubble: #6366f1;
  --ai-text: #ffffff;
  --user-text: #ffffff;
  --hover-color: #00a8cc;
  --shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Global Styles
   ============================================ */

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

html,
body {
  width: 100%;
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue",
    sans-serif;
  background: linear-gradient(135deg, #0f0f1e 0%, #16213e 100%);
  color: var(--text-primary);
  overflow: hidden;
}

body {
  background-attachment: fixed;
}

/* ============================================
   App Container
   ============================================ */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--background-dark);
  position: relative;
}

/* ============================================
   Header
   ============================================ */

.chatbot-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
}

.title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #00d4ff, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.title-icon {
  margin-right: 0.5rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ============================================
   Chat Area
   ============================================ */

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #0f0f1e 0%, #1a1a2e 100%);
  scroll-behavior: smooth;
}

.chat-area::-webkit-scrollbar {
  width: 8px;
}

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

.chat-area::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
  opacity: 0.6;
}

.chat-area::-webkit-scrollbar-thumb:hover {
  opacity: 1;
}

.messages-container {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================
   Message Styles
   ============================================ */

.message {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.5rem;
  animation: slideIn 0.3s ease-out;
}

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

/* AI Messages */
.ai-message {
  align-items: flex-start;
}

.ai-message .message-bubble {
  background: var(--ai-bubble);
  color: var(--ai-text);
  border: 1px solid var(--border-color);
  max-width: 85%;
  margin-left: 0;
}

.ai-message .message-timestamp {
  margin-left: 0.5rem;
  margin-top: 0.3rem;
}

/* User Messages */
.user-message {
  align-items: flex-end;
}

.user-message .message-bubble {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: var(--user-text);
  max-width: 85%;
  margin-left: auto;
  margin-right: 0;
}

.user-message .message-timestamp {
  margin-right: 0.5rem;
  margin-top: 0.3rem;
}

/* Message Bubble */
.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: 18px;
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.ai-message .message-bubble:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.15);
}

.user-message .message-bubble:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

/* Message Timestamp */
.message-timestamp {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 0.3rem;
}

/* ============================================
   Input Area
   ============================================ */

.input-area {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  flex-shrink: 0;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.input-container {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: var(--background-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.chat-input::placeholder {
  color: var(--text-secondary);
}

.chat-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: var(--background-card);
}

.chat-input:hover {
  border-color: var(--secondary-color);
}

/* Send Button */
.send-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff, #6366f1);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
  flex-shrink: 0;
}

.send-button:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.send-button:active {
  transform: scale(0.96);
}

.send-icon {
  display: block;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Input Hint */
.input-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  opacity: 0.6;
}

kbd {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.75rem;
  color: var(--primary-color);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .title {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  .chatbot-header {
    padding: 1rem 1.5rem;
  }

  .chat-area {
    padding: 1rem 0.75rem;
  }

  .message-bubble {
    max-width: 95%;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .input-container {
    gap: 0.5rem;
  }

  .send-button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .input-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.25rem;
  }

  .message-bubble {
    max-width: 100%;
  }

  .chat-area {
    padding: 0.75rem 0.5rem;
  }

  .input-area {
    padding: 0.75rem 0.5rem;
  }

  .input-container {
    gap: 0.4rem;
  }

  .send-button {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --background-dark: #f5f5f7;
    --background-card: #ffffff;
    --background-light: #f9f9fb;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --ai-bubble: #f0f0f0;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.success {
  color: #10b981;
}

.error {
  color: #ef4444;
}
