/* ------------------- */
/* Advanced Medha AI Styling */
/* ------------------- */
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #E5E7EB;
  color: #111827;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
  background: #1F2937;
  color: #F9FAFB;
}

body.dark-mode .main-content {
  background: #1F2937;
}

body.dark-mode .chat-header {
  background: #374151;
  border-bottom-color: #4B5563;
}

body.dark-mode .message-content {
  background: #374151;
  color: #F9FAFB;
}

body.dark-mode .user-content {
  background: #3B82F6;
  color: #FFFFFF;
}

body.dark-mode .input-wrapper {
  background: #374151;
  border-color: #4B5563;
}

body.dark-mode .message-input {
  background: #374151;
  color: #F9FAFB;
}

body.dark-mode .welcome-container {
  background: #1F2937;
}

/* Iframe mode styling */
.iframe-mode body {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.embed-mode body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.app-container {
  display: flex;
  height: 100vh;
}

.container-fluid {
  padding: 0;
}

/* ------------------- */
/* Main Content Area   */
/* ------------------- */
.main-content {
  flex: 1;
  margin-left: 0 !important;
  transition: none;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ------------------- */
/* Header Section      */
/* ------------------- */
.chat-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 70px;
  background: #ffffff;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(142, 123, 191, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 10;
}

.header-logo {
  width: 118px;
  height: 32px;
  border-radius: 11%;
  margin-right: 6px;
}

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

.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #5C3E8E;
  padding: 0 10px;
  border-radius: 10px;
  background-color: rgba(92, 62, 142, 0.05);
}

/* ------------------- */
/* Message Components  */
/* ------------------- */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 80px 0 120px;
  background: #E5E7EB;
  transition: background-color 0.3s ease;
}

body.dark-mode .messages-container {
  background: #1F2937;
}

.message-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.message {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  animation: fadeInUp 0.4s ease both;
  margin-bottom: 10px;
}

.message:last-child {
  margin-bottom: 30px;
}

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

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #8E7BBF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.user-avatar {
  background-color: #6A5ACD;
}

.message-content {
  max-width: 85%;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 10px 15px;
}

.user-content {
  background-color: #8E7BBF;
  border: 1px solid #8E7BBF;
  color: #ffffff;
  border-radius: 1rem;
  padding: 10px 15px;
}

/* ------------------- */
/* Input & Footer      */
/* ------------------- */
.input-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px 20px 8px;
  background: #ffffff;
  backdrop-filter: blur(12px);
  box-shadow: 0 -2px 15px rgba(142, 123, 191, 0.1);
  z-index: 20;
}

.input-box {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

 .message-input {
   width: 100%;
   resize: none;
   background-color: #ffffff;
   border: 2px solid #8E7BBF;
   border-radius: 25px;
   padding: 12px 15px;
   color: #111827;
   font-family: inherit;
   font-size: 15px;
   outline: none;
   overflow-y: hidden;
   box-sizing: border-box;
   line-height: 1.4;
 }
 
 .message-input:focus {
   border-color: #5C3E8E;
   box-shadow: 0 0 0 3px rgba(92, 62, 142, 0.1);
 }

.send-button {
  background: #8E7BBF;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(142, 123, 191, 0.3);
  transition: all 0.2s ease;
}

.send-button:hover {
  background: #5C3E8E;
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.disclaimer {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 10px;
}

/* ------------------- */
/* Welcome UI          */
/* ------------------- */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #E5E7EB;
  transition: background-color 0.3s ease;
}

body.dark-mode .welcome-container {
  background: #1F2937;
}

.welcome-header {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-icon {
  width: 60px;
  height: 60px;
  background: #8B5CF6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 28px;
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #111827;
}

body.dark-mode .welcome-title {
  color: #F9FAFB;
}

.welcome-subtitle {
  font-size: 0.875rem;
  color: #6B7280;
  margin-bottom: 0;
  font-weight: 400;
}

body.dark-mode .welcome-subtitle {
  color: #9CA3AF;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 600px;
  width: 100%;
}

.action-card {
  background: white;
  border: 1px solid #8E7BBF;
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #5C3E8E;
  font-weight: 500;
}

.action-card:hover {
  background: rgba(142, 123, 191, 0.05);
  box-shadow: 0 2px 12px rgba(142, 123, 191, 0.2);
}

/* ------------------- */
/* UI Animations       */
/* ------------------- */
.typing-loader {
  font-style: italic;
  color: #6b7280;
}

.typing-loader .dot {
  animation: blink 1.4s infinite;
  animation-delay: calc(0.2s * var(--i));
}

.typing-loader .dot:nth-child(1) { --i: 1; }
.typing-loader .dot:nth-child(2) { --i: 2; }
.typing-loader .dot:nth-child(3) { --i: 3; }

@keyframes blink {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.mic-active {
  animation: blink 1s infinite;
}

.transcribed-text {
  font-size: 16px;
  color: #333;
  margin-top: 10px;
  font-weight: bold;
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.dropdown-container {
  display: flex;
  align-items: center;
}

.dropdown-select {
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  color: #333;
  margin-right: 92px;
  outline: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width="10" height="5" xmlns="http://www.w3.org/2000/svg"><path d="M0 0l5 5 5-5z" fill="%23333"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 5px;
}

/* Responsive Enhancements */

@media (max-width: 768px) {
  .chat-header {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 10px;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-logo {
    width: 100px;
    height: auto;
    margin-bottom: 5px;
  }

  .header-title {
    font-size: 1.2rem;
  }

  .welcome-container {
    padding: 0 15px;
    text-align: center;
  }

  .actions-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .input-box {
    padding: 0 10px;
  }

  .message-content,
  .user-content {
    max-width: 100%;
    font-size: 15px;
  }

  .message {
    gap: 12px;
    padding: 12px 0;
  }

  .send-button {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .actions-grid {
    grid-template-columns: 1fr 1fr;
  }
}


.chat-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  max-width: 800px;
  margin: auto;
}

.chat-bubble {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 15px;
  font-family: 'Segoe UI', sans-serif;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: fadeIn 0.3s ease-in-out;
}

.bot-bubble {
  align-self: flex-start;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e3a8a;
  border-top-left-radius: 0;
}

.user-bubble {
  align-self: flex-end;
  background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
  color: #064e3b;
  border-top-right-radius: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.edit-area {
  width: 100%;
  resize: vertical;
}

.editable-text:hover {
  text-decoration: underline;
  color: #007bff;
}


form .form-floating > .form-control {
  padding: 1rem 0.75rem;
  height: 55px;
}
form .form-floating > label {
  left: 0.75rem;
}


.action-card:active {
  opacity: 0.6;
  transform: scale(0.98);
}

/* ------------------- */
/* Advanced UI Components */
/* ------------------- */

/* Removed feature cards and action cards - using simplified design */

/* Input Enhancements */
 .input-wrapper {
   position: relative;
   display: flex;
   align-items: flex-end;
   background: #ffffff;
   border-radius: 20px;
   padding: 6px 8px;
   box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
   border: 2px solid #e5e7eb;
 }

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

 .action-btn {
   background: #ffffff;
   border: 1px solid #e5e7eb;
   color: #374151;
   padding: 6px;
   border-radius: 8px;
   cursor: pointer;
   transition: all 0.2s ease;
   display: flex;
   align-items: center;
   justify-content: center;
   width: 32px;
   height: 32px;
   font-size: 14px;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 }
 
 .action-btn:hover {
   background: #f9fafb;
   color: #111827;
   border-color: #d1d5db;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 }

.action-btn.active {
  background: #667eea;
  color: white;
}

.action-btn.recording {
  background: #ef4444;
  color: white;
  animation: pulse 1s infinite;
}

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

/* Input Footer */
.input-footer {
  margin-top: 5px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  min-height: 20px;
}

.disclaimer {
  flex: 1;
  text-align: left;
}

.session-info {
  font-family: 'Monaco', 'Menlo', monospace;
  text-align: right;
  margin-left: 15px;
}

/* Status Badge */
#status-badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 12px;
}

/* Enhanced Message Styling */
.message-content {
  line-height: 1.6;
  word-wrap: break-word;
}

.message-content strong {
  color: #1f2937;
  font-weight: 600;
}

.message-content em {
  color: #6b7280;
  font-style: italic;
}

/* Welcome Screen Enhancements */
.welcome-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.welcome-subtitle {
  color: #6b7280;
  font-size: 1.1rem;
  margin-bottom: 60px;
}

/* Welcome Input Container */
.welcome-input-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.welcome-input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: #ffffff;
  border: 2px solid #8E7BBF;
  border-radius: 25px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(142, 123, 191, 0.1);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.welcome-input-wrapper:hover {
  background: #ffffff;
  border-color: #5C3E8E;
  box-shadow: 0 12px 40px rgba(142, 123, 191, 0.15);
}

.welcome-input-wrapper:focus-within {
  background: #ffffff;
  border-color: #5C3E8E;
  box-shadow: 0 12px 40px rgba(142, 123, 191, 0.2);
}

.welcome-message-input {
  width: 100%;
  resize: none;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 15px;
  color: #111827;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  overflow-y: hidden;
  box-sizing: border-box;
  line-height: 1.5;
}

.welcome-message-input::placeholder {
  color: #8E7BBF;
  font-weight: 400;
}

.welcome-send-button {
  background: #8E7BBF;
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(142, 123, 191, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.welcome-send-button:hover {
  background: #5C3E8E;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(142, 123, 191, 0.5);
}

.welcome-send-button:active {
  transform: translateY(0);
}

/* Modal Enhancements */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid #e5e7eb;
  border-radius: 16px 16px 0 0;
}

.modal-footer {
  border-top: 1px solid #e5e7eb;
  border-radius: 0 0 16px 16px;
}

/* Progress Bar */
.progress {
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
}

.progress-bar {
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Button Enhancements */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
  border-color: #d1d5db;
  color: #6b7280;
}

.btn-outline-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

/* Header Enhancements */
.chat-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-title {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .feature-card {
    padding: 15px;
  }
  
  .input-actions {
    gap: 4px;
  }
  
  .action-btn {
    width: 28px;
    height: 28px;
    padding: 4px;
    font-size: 12px;
  }
  
  .send-button {
    width: 28px;
    height: 28px;
  }
  
  .welcome-content {
    padding: 0 15px;
  }
  
  .welcome-title {
    font-size: 1.8rem;
  }
  
  .welcome-subtitle {
    font-size: 1rem;
    margin-bottom: 40px;
  }
  
  .welcome-input-container {
    max-width: 100%;
  }
  
  .welcome-input-wrapper {
    padding: 10px 14px;
  }
  
  .welcome-message-input {
    font-size: 15px;
    padding: 6px 12px;
  }
  
  .welcome-send-button {
    width: 40px;
    height: 40px;
  }
  
  .messages-container {
    padding: 80px 0 100px;
  }
  
  .input-container {
    padding: 12px 15px 5px;
  }
  
  .input-footer {
    font-size: 0.7rem;
    margin-top: 3px;
  }
  
  .disclaimer {
    display: none; /* Hide disclaimer on mobile to save space */
  }
  
  .message:last-child {
    margin-bottom: 20px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .iframe-mode body {
    background: #1a202c;
    color: #e2e8f0;
  }
  
  .feature-card {
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
  }
  
  .action-card {
    background: rgba(45, 55, 72, 0.95);
    color: #e2e8f0;
  }
  
  .input-wrapper {
    background: rgba(45, 55, 72, 0.95);
  }
}

/* Visual Process Indicators - Removed as requested */

.process-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  font-size: 0.8em;
}

.process-step.active {
  background: #3b82f6;
  color: white;
}

.process-step.completed {
  background: #10b981;
  color: white;
}

/* Image Support in Messages */
.message-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.message-content img:hover {
  transform: scale(1.02);
}

/* Step-by-step Process Display */
.process-steps {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}

.process-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.process-step-item:last-child {
  border-bottom: none;
}

.step-number {
  background: #3b82f6;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.step-description {
  color: #64748b;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Visual Status Indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

.status-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Enhanced Message Bubbles */
.message {
  animation: fadeIn 0.4s ease-out;
}

.message.user-message {
  animation: slideInRight 0.4s ease-out;
}

.message:not(.user-message) {
  animation: slideInLeft 0.4s ease-out;
}

/* Loading Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-radius: 20px;
  max-width: 80px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #64748b;
  border-radius: 50%;
  animation: typingPulse 1.4s infinite ease-in-out;
}

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

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

@keyframes typingPulse {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* ==================== */
/* MOBILE RESPONSIVENESS */
/* ==================== */

/* Mobile First Approach */
@media (max-width: 768px) {
  /* Body and Container Adjustments */
  body {
    font-size: 14px;
    overflow-x: hidden;
  }
  
  .app-container {
    flex-direction: column;
    height: 100vh;
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* Header Mobile */
  .chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 16px;
    height: auto;
    min-height: 60px;
  }
  
  .chat-header h1 {
    font-size: 18px;
    margin: 0;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .header-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Messages Container Mobile */
  .messages-container {
    padding: 80px 12px 80px 12px;
    margin: 0;
  }
  
  .message {
    margin-bottom: 12px;
    max-width: 85%;
  }
  
  .message.user-message {
    margin-left: auto;
    margin-right: 0;
  }
  
  .message:not(.user-message) {
    margin-left: 0;
    margin-right: auto;
  }
  
  .message-content {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
  }
  
  .message-content.user-content {
    background: #8E7BBF;
    color: white;
  }
  
  /* Avatar Mobile */
  .avatar {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }
  
  .avatar img {
    width: 20px;
    height: 20px;
  }
  
  /* Input Container Mobile */
  .input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .input-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .input-group .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }
  
  /* Text Input Mobile */
 .form-control {
   font-size: 16px; /* Prevents zoom on iOS */
   padding: 12px 16px;
   border-radius: 25px;
   border: 2px solid #e5e7eb;
   background-color: #ffffff;
   color: #111827;
 }
 
 .form-control:focus {
   border-color: #5C3E8E;
   box-shadow: 0 0 0 3px rgba(92, 62, 142, 0.1);
   background-color: #ffffff;
   color: #111827;
 }
  
  /* Modal Mobile */
  .modal-dialog {
    margin: 16px;
    max-width: calc(100% - 32px);
  }
  
  .modal-content {
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 16px;
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  /* Upload Modal Mobile */
  .upload-area {
    padding: 24px 16px;
    min-height: 120px;
  }
  
  .upload-area h5 {
    font-size: 16px;
  }
  
  .upload-area p {
    font-size: 14px;
  }
  
  /* Progress Bar Mobile */
  .progress {
    height: 6px;
    margin: 12px 0;
  }
  
  /* Welcome Screen Mobile */
  .welcome-screen {
    padding: 20px 16px;
    text-align: center;
  }
  
  .welcome-screen h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .welcome-screen p {
    font-size: 14px;
    margin-bottom: 16px;
  }
  
  /* Button Groups Mobile */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    border-radius: 8px !important;
    margin-bottom: 8px;
  }
  
  /* Typing Indicator Mobile */
  .typing-indicator {
    padding: 8px 12px;
    max-width: 60px;
  }
  
  .typing-dot {
    width: 6px;
    height: 6px;
  }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .messages-container {
    padding: 100px 20px 100px 20px;
  }
  
  .message {
    max-width: 70%;
  }
  
  .input-container {
    padding: 16px 20px;
  }
  
  .chat-header {
    padding: 16px 20px;
  }
}

/* Large Mobile (iPhone Plus, etc.) */
@media (max-width: 414px) {
  .message {
    max-width: 90%;
  }
  
  .message-content {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .input-container {
    padding: 8px;
  }
  
   .form-control {
     font-size: 16px;
     padding: 10px 14px;
     background-color: #ffffff;
     color: #111827;
     border: 2px solid #e5e7eb;
   }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
  .messages-container {
    padding: 60px 12px 60px 12px;
  }
  
  .input-container {
    padding: 8px 12px;
  }
  
  .chat-header {
    padding: 8px 16px;
    min-height: 50px;
  }
  
  .chat-header h1 {
    font-size: 16px;
  }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px; /* Apple's recommended touch target size */
    min-width: 44px;
  }
  
  .form-control {
    min-height: 44px;
  }
  
  .message-content {
    padding: 14px 18px;
  }
  
  /* Larger touch targets for mobile */
  .header-actions .btn {
    padding: 10px 16px;
  }
}

/* Dark Mode Mobile Support */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
  .input-container {
    background: #1f2937;
    border-top-color: #374151;
  }
  
  .form-control {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .form-control:focus {
    background: #374151;
    border-color: #3b82f6;
    color: #f9fafb;
  }
  
  .modal-content {
    background: #1f2937;
    color: #f9fafb;
  }
}
