/* ======================
   Modern Chat Interface Styles
====================== */

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Chat Header */
.chat-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px 0;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
}

.welcome-icon {
  flex-shrink: 0;
}

.ai-avatar {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  animation: pulse 2s infinite;
  padding: 4px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
}

.ai-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.kognos-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.welcome-text h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #2d3748;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.welcome-text p {
  margin: 6px 0 0 0;
  font-size: 16px;
  color: #4a5568;
  font-weight: 400;
  line-height: 1.5;
}

.status-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(74, 222, 128, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-indicator span {
  font-size: 14px;
  font-weight: 500;
  color: #059669;
}

/* Chat Container */
.chat-container {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.chat-messages {
  height: 500px;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.9));
}

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

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Message Styles */
.message {
  display: flex;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease-out;
}

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

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

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  margin: 0 12px;
}

.bot-message .message-avatar {
  background: rgba(255, 255, 255, 0.95);
  color: white;
  padding: 2px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.bot-message .message-avatar.kognos-logo {
  background: rgba(255, 255, 255, 0.98);
  padding: 3px;
}

.kognos-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: white;
}

.message-content {
  flex: 1;
  max-width: 70%;
}

.message-bubble {
  background: white;
  padding: 16px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

.user-message .message-bubble {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-bottom-right-radius: 6px;
}

.bot-message .message-bubble {
  background: white;
  color: #2d3748;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-bubble p {
  margin: 0;
  line-height: 1.5;
  font-size: 15px;
}

.message-time {
  font-size: 12px;
  color: #a0aec0;
  margin-top: 6px;
  text-align: right;
}

.user-message .message-time {
  text-align: left;
}

/* Welcome Message */
.welcome-message .message-bubble {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border: 2px solid rgba(102, 126, 234, 0.2);
}

/* Quick Actions */
.quick-actions {
  padding: 20px 24px;
  background: rgba(248, 250, 252, 0.8);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

.quick-btn {
  background: white;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 25px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-btn:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Clear Chat Button */
.clear-btn {
  background: #f8f9fa;
  border: 2px solid rgba(220, 53, 69, 0.2);
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #dc3545;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.clear-btn:hover {
  background: #dc3545;
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(15deg);
}

/* Error Banner */
.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 12px 20px;
  background: #dc3545;
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.error-banner.show {
  transform: translateY(0);
}

.error-banner.warning {
  background: #ffc107;
  color: #212529;
}

.error-banner.info {
  background: #17a2b8;
  color: white;
}

.error-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 12px;
}

.error-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.error-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.error-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.error-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Message Reactions */
.message-reactions {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.message-bot-message:hover .message-reactions {
  opacity: 1;
  transform: translateY(0);
}

.reaction-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.reaction-btn {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 40px;
  justify-content: center;
}

.reaction-btn:hover {
  background: #f8f9fa;
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.reaction-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.rating-section {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 12px;
}

.star-rating {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  justify-content: center;
}

.star {
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e2e8f0;
  user-select: none;
}

.star:hover,
.star.highlight {
  color: #fbbf24;
  transform: scale(1.1);
}

.star.active {
  color: #f59e0b;
  transform: scale(1.1);
}

.feedback-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.feedback-btn {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
}

.feedback-btn:hover {
  background: #f8f9fa;
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

.feedback-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
  transform: translateY(-1px);
}

.feedback-btn.helpful.active {
  background: #10b981;
  border-color: #10b981;
}

.feedback-btn.not-helpful.active {
  background: #ef4444;
  border-color: #ef4444;
}

.feedback-btn.suggest.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

/* Feedback animations */
.reaction-feedback,
.rating-feedback {
  position: absolute;
  background: #667eea;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  z-index: 10;
  animation: feedbackPop 0.3s ease;
  pointer-events: none;
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dark Mode CSS Variables and Styles */
:root {
  /* Light theme colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: rgba(248, 250, 252, 0.8);
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.05);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

/* Dark theme colors */
.dark-theme {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: rgba(30, 41, 59, 0.8);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --accent-primary: #818cf8;
  --accent-secondary: #a78bfa;
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;
}

/* Apply CSS variables to existing elements */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.chat-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.welcome-text h1 {
  color: var(--text-primary);
}

.welcome-text p {
  color: var(--text-secondary);
}

.status-indicator {
  color: var(--text-secondary);
}

.chat-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px var(--shadow-light);
}

.chat-messages {
  background: var(--bg-primary);
}

.message-bubble {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.user-message .message-bubble {
  background: var(--accent-primary);
  color: white;
}

.bot-message .message-bubble {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.message-time {
  color: var(--text-muted);
}

.message-reactions {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
}

.reaction-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.reaction-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.reaction-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.star {
  color: var(--text-muted);
}

.star:hover,
.star.highlight {
  color: var(--warning);
}

.star.active {
  color: var(--warning);
}

.feedback-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
}

.feedback-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.feedback-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.feedback-btn.helpful.active {
  background: var(--success);
  border-color: var(--success);
}

.feedback-btn.not-helpful.active {
  background: var(--error);
  border-color: var(--error);
}

.feedback-btn.suggest.active {
  background: var(--info);
  border-color: var(--info);
}

.chat-input-area {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.user-input {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.user-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
  background: var(--accent-primary);
  color: white;
}

.send-btn:hover {
  background: var(--accent-secondary);
}

.quick-actions {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-light);
}

.quick-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.quick-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.clear-btn {
  background: var(--bg-secondary);
  border: 2px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.clear-btn:hover {
  background: var(--error);
  color: white;
  border-color: transparent;
}

/* Dark theme specific adjustments */
.dark-theme .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.dark-theme .status-indicator {
  color: var(--text-secondary);
}

.dark-theme .error-banner {
  background: var(--error);
  color: white;
}

.dark-theme .error-banner.warning {
  background: var(--warning);
  color: var(--text-primary);
}

.dark-theme .error-banner.info {
  background: var(--info);
  color: white;
}

/* Input Area */
.chat-input-area {
  padding: 24px;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.input-container {
  margin-bottom: 16px;
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #f7fafc;
  border-radius: 25px;
  padding: 4px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  transition: border-color 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#user-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 16px 20px;
  font-size: 15px;
  outline: none;
  color: #2d3748;
}

#user-input::placeholder {
  color: #a0aec0;
}

.send-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

/* Mode Toggle */
.mode-toggle {
  display: flex;
  justify-content: center;
}

.toggle-container {
  background: #f7fafc;
  border-radius: 25px;
  padding: 4px;
  border: 2px solid rgba(0, 0, 0, 0.05);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 48px;
  height: 24px;
  background: #e2e8f0;
  border-radius: 12px;
  position: relative;
  transition: background 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(24px);
}

/* Typing Indicator */
.typing-message .message-bubble {
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.typing-text {
  font-style: italic;
  color: #718096;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    padding: 0 16px;
  }
  
  /* Error banner mobile adjustments */
  .error-banner {
    padding: 10px 16px;
  }
  
  .error-content {
    gap: 8px;
  }
  
  .error-message {
    font-size: 13px;
  }
  
  .error-icon {
    font-size: 16px;
  }
  
  .status-indicator {
    margin-left: 0;
    margin-top: 8px;
  }
  
  .chat-container {
    margin: 0 12px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  }
  
  .chat-messages {
    height: 450px;
    padding: 20px 16px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  .quick-actions {
    padding: 20px 16px;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .quick-btn {
    padding: 12px 16px;
    font-size: 13px;
    min-width: fit-content;
    min-height: 44px; /* Better touch target */
    border-radius: 22px;
    touch-action: manipulation; /* Prevent double-tap zoom */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
  }
  
  .clear-btn {
    margin-left: 0;
    margin-top: 12px;
    width: 100%;
    justify-content: center;
    min-height: 44px;
    border-radius: 22px;
  }
  
  .chat-input-area {
    padding: 20px 16px;
  }
  
  .input-wrapper {
    border-radius: 25px;
    padding: 8px 12px;
  }
  
  .user-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px 16px;
    border-radius: 20px;
  }
  
  .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    font-size: 18px;
  }
  
  .message-content {
    max-width: 90%;
  }
  
  .message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
  }
  
  .message-time {
    font-size: 12px;
    margin-top: 4px;
  }
  
  /* Touch feedback for buttons */
  .quick-btn:active,
  .send-btn:active,
  .clear-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* Mobile-specific improvements */
  .mobile-device .user-input {
    font-size: 16px !important; /* Prevent zoom on iOS */
  }
  
  .mobile-device .chat-messages {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  
  .mobile-device .quick-btn,
  .mobile-device .send-btn,
  .mobile-device .clear-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  /* Better focus states for mobile */
  .mobile-device .user-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  }
  
  /* Mobile dark mode adjustments */
  .header-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .theme-toggle {
    width: 40px;
    height: 40px;
  }
  
  .theme-icon {
    font-size: 18px;
  }
  
  /* Mobile reaction adjustments */
  .message-reactions {
    opacity: 1; /* Always show on mobile */
    transform: translateY(0);
    padding: 10px 12px;
  }
  
  .reaction-buttons {
    gap: 6px;
    justify-content: center;
  }
  
  .reaction-btn {
    padding: 8px 10px;
    font-size: 18px;
    min-width: 44px; /* Better touch target */
    min-height: 44px;
  }
  
  .star {
    font-size: 24px;
    padding: 4px;
  }
  
  .feedback-actions {
    gap: 6px;
  }
  
  .feedback-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }
}

@media (max-width: 480px) {
  .chat-container {
    margin: 0 8px;
    border-radius: 16px;
  }
  
  .welcome-text h1 {
    font-size: 22px;
    margin-bottom: 8px;
  }
  
  .welcome-text p {
    font-size: 14px;
  }
  
  .ai-avatar {
    width: 45px;
    height: 45px;
    font-size: 22px;
  }
  
  .chat-messages {
    height: 400px;
    padding: 16px 12px;
  }
  
  .quick-actions {
    flex-direction: column;
    padding: 16px 12px;
    gap: 8px;
  }
  
  .quick-btn {
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
    min-height: 48px;
    width: 100%;
  }
  
  .clear-btn {
    margin-top: 8px;
    padding: 14px 20px;
    font-size: 14px;
  }
  
  /* Small screen reaction adjustments */
  .reaction-buttons {
    gap: 4px;
  }
  
  .reaction-btn {
    padding: 6px 8px;
    font-size: 16px;
    min-width: 40px;
    min-height: 40px;
  }
  
  .star {
    font-size: 20px;
  }
  
  .feedback-actions {
    flex-direction: column;
    gap: 4px;
  }
  
  .feedback-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    font-size: 12px;
  }
  
  .chat-input-area {
    padding: 16px 12px;
  }
  
  .user-input {
    font-size: 16px;
    padding: 14px 18px;
  }
  
  .send-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .message-bubble {
    padding: 14px 18px;
    font-size: 14px;
  }
  
  .message-content {
    max-width: 95%;
  }
  
  /* Landscape orientation adjustments */
  @media (max-height: 500px) and (orientation: landscape) {
    .chat-messages {
      height: 300px;
    }
    
    .quick-actions {
      padding: 12px;
      gap: 6px;
    }
    
    .quick-btn {
      padding: 10px 16px;
      font-size: 12px;
      min-height: 40px;
    }
  }
}