/* ===================================================================
   PeopleHub AI Assistant - Modern Dark Glassmorphism Design System
   =================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Color Palette */
  --bg-dark: #080b11;
  --bg-primary: #0d121d;
  --bg-secondary: #131a29;
  --bg-card: rgba(19, 26, 42, 0.65);
  --bg-card-hover: rgba(28, 38, 62, 0.8);
  --bg-input: rgba(14, 20, 33, 0.85);

  --border-light: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(99, 102, 241, 0.35);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0891b2 100%);
  --user-bubble-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);

  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient subtle background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Container Utility */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hidden Utility */
.hidden {
  display: none !important;
}

/* ===================================================================
   1. LOGIN / AUTHENTICATION VIEW
   =================================================================== */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.5s var(--transition-smooth);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid var(--border-accent);
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.auth-logo-badge svg {
  width: 32px;
  height: 32px;
  color: #818cf8;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-label .optional-tag {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 400;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.form-input {
  width: 100%;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(17, 24, 39, 0.95);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.password-toggle-btn:hover {
  color: var(--text-main);
}

.collapsible-settings-trigger {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0;
  transition: opacity var(--transition-fast);
}

.collapsible-settings-trigger:hover {
  opacity: 0.85;
}

.webhook-settings-panel {
  background: rgba(13, 18, 29, 0.75);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.2s ease;
}

.webhook-reset-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.webhook-reset-btn:hover {
  color: var(--text-main);
}

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(20%);
}

.alert-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  margin-bottom: 1.25rem;
  animation: shake 0.35s ease;
}

.alert-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ===================================================================
   2. MAIN CHAT APPLICATION VIEW
   =================================================================== */
.chat-app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Top App Header */
.chat-header {
  height: 64px;
  min-height: 64px;
  background: rgba(13, 18, 29, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  color: var(--accent-emerald);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Session Badge */
.session-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.session-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.header-btn-danger {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.2);
}

.header-btn-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #ffe4e6;
  border-color: rgba(244, 63, 94, 0.4);
}

/* Main Chat Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
  position: relative;
}

/* Message Scroll Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.messages-container::-webkit-scrollbar {
  width: 6px;
}
.messages-container::-webkit-scrollbar-track {
  background: transparent;
}
.messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Welcome Empty State */
.welcome-container {
  margin: auto;
  max-width: 680px;
  text-align: center;
  padding: 2.5rem 1.5rem;
  animation: fadeIn 0.4s ease;
}

.welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.welcome-icon svg {
  width: 34px;
  height: 34px;
  color: #818cf8;
}

.welcome-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 30%, #9ca3af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.suggested-prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  text-align: left;
}

.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.prompt-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.prompt-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.prompt-card-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Message Rows */
.message-row {
  display: flex;
  gap: 0.85rem;
  max-width: 860px;
  width: 100%;
  animation: messageSlideIn 0.3s var(--transition-smooth);
}

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

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

.message-row.bot-message {
  align-self: flex-start;
}

/* Avatars */
.message-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.bot-avatar {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
  border: 1px solid var(--border-accent);
  color: #a5b4fc;
}

.user-avatar {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Bubbles */
.message-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: calc(100% - 50px);
}

.user-message .message-bubble-wrapper {
  align-items: flex-end;
}

.message-bubble {
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  font-size: 0.925rem;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

.user-message .message-bubble {
  background: var(--user-bubble-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  white-space: pre-wrap;
}

.bot-message .message-bubble {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.725rem;
  color: var(--text-muted);
  padding: 0 0.35rem;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.725rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* Markdown Formatting inside Bot Bubble */
.bot-message .message-bubble h1,
.bot-message .message-bubble h2,
.bot-message .message-bubble h3,
.bot-message .message-bubble h4 {
  color: #fff;
  margin-top: 0.8rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
  line-height: 1.3;
}

.bot-message .message-bubble h1:first-child,
.bot-message .message-bubble h2:first-child,
.bot-message .message-bubble h3:first-child {
  margin-top: 0;
}

.bot-message .message-bubble p {
  margin-bottom: 0.75rem;
}

.bot-message .message-bubble p:last-child {
  margin-bottom: 0;
}

.bot-message .message-bubble ul,
.bot-message .message-bubble ol {
  margin: 0.5rem 0 0.75rem 1.4rem;
}

.bot-message .message-bubble li {
  margin-bottom: 0.3rem;
}

.bot-message .message-bubble strong {
  color: #fff;
  font-weight: 600;
}

.bot-message .message-bubble code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  color: #a5b4fc;
}

.bot-message .message-bubble pre {
  margin: 0.75rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #090d16 !important;
}

.bot-message .message-bubble pre code {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  display: block;
  padding: 1rem;
  overflow-x: auto;
}

.bot-message .message-bubble blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 0.85rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.bot-message .message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.bot-message .message-bubble th,
.bot-message .message-bubble td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light);
  text-align: left;
}

.bot-message .message-bubble th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* Typing / Busy Indicator */
.typing-indicator-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  max-width: 860px;
  animation: fadeIn 0.3s ease;
}

.typing-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Quick Action Chips Bar (above input) */
.quick-chips-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 1.5rem;
  scrollbar-width: none;
}

.quick-chips-bar::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.quick-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--border-accent);
  color: #e0e7ff;
  transform: translateY(-1px);
}

/* Chat Input Bar */
.chat-input-area {
  padding: 0.75rem 1.5rem 1.25rem 1.5rem;
  background: rgba(13, 18, 29, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
}

.input-box-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.input-box-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 4px 25px rgba(0, 0, 0, 0.4);
}

.chat-textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.925rem;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 180px;
  outline: none;
  padding: 0.35rem 0.25rem;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.input-footer-hint {
  max-width: 900px;
  margin: 0.45rem auto 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.725rem;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

/* ===================================================================
   3. SETTINGS MODAL
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
  animation: modalScale 0.25s var(--transition-smooth);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: rgba(13, 18, 29, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.info-banner {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: #c7d2fe;
  line-height: 1.5;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.2rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.3s var(--transition-smooth);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chat-header {
    padding: 0 1rem;
  }
  .session-pill {
    display: none;
  }
  .header-btn span {
    display: none;
  }
  .messages-container {
    padding: 1rem 0.75rem;
  }
  .suggested-prompts-grid {
    grid-template-columns: 1fr;
  }
  .chat-input-area {
    padding: 0.5rem 0.75rem 0.85rem 0.75rem;
  }
  .auth-card {
    padding: 1.75rem 1.25rem;
  }
}
