/* ============================================
   MOBILE AI CLEAN THEME
   ============================================
   
   Clean, elegant design matching modern chat interfaces
   with professional light and dark modes
*/

/* ============================================
   CLEAN THEME VARIABLES
   ============================================ */

:root {
  /* Clean Light Theme - Similar to your screenshots */
  --clean-bg: #FFFFFF;
  --clean-surface: #F7F8FA;
  --clean-surface-hover: #F1F3F5;
  --clean-primary: #007AFF;
  --clean-primary-hover: #0056CC;
  --clean-secondary: #5856D6;
  --clean-accent: #FF9500;
  --clean-border: #E5E5E7;
  --clean-border-light: #F2F2F7;
  --clean-text-primary: #1D1D1F;
  --clean-text-secondary: #6D6D70;
  --clean-text-muted: #8E8E93;
  --clean-shadow: rgba(0, 0, 0, 0.1);
  --clean-shadow-light: rgba(0, 0, 0, 0.05);
  
  /* Clean Dark Theme - Similar to your dark screenshot */
  --dark-bg: #1C1C1E;
  --dark-surface: #2C2C2E;
  --dark-surface-hover: #3A3A3C;
  --dark-primary: #0A84FF;
  --dark-primary-hover: #0969DA;
  --dark-secondary: #5E5CE6;
  --dark-accent: #FF9F0A;
  --dark-border: #38383A;
  --dark-border-light: #48484A;
  --dark-text-primary: #FFFFFF;
  --dark-text-secondary: #EBEBF5;
  --dark-text-muted: #8E8E93;
  --dark-shadow: rgba(0, 0, 0, 0.3);
  --dark-shadow-light: rgba(0, 0, 0, 0.2);
}

/* ============================================
   THEME SWITCHING SYSTEM
   ============================================ */

/* Light theme (default) */
:root,
[data-theme="light"] {
  --theme-bg: var(--clean-bg);
  --theme-surface: var(--clean-surface);
  --theme-surface-hover: var(--clean-surface-hover);
  --theme-primary: var(--clean-primary);
  --theme-primary-hover: var(--clean-primary-hover);
  --theme-secondary: var(--clean-secondary);
  --theme-accent: var(--clean-accent);
  --theme-border: var(--clean-border);
  --theme-border-light: var(--clean-border-light);
  --theme-text-primary: var(--clean-text-primary);
  --theme-text-secondary: var(--clean-text-secondary);
  --theme-text-muted: var(--clean-text-muted);
  --theme-shadow: var(--clean-shadow);
  --theme-shadow-light: var(--clean-shadow-light);
}

/* Dark theme */
[data-theme="dark"] {
  --theme-bg: var(--dark-bg);
  --theme-surface: var(--dark-surface);
  --theme-surface-hover: var(--dark-surface-hover);
  --theme-primary: var(--dark-primary);
  --theme-primary-hover: var(--dark-primary-hover);
  --theme-secondary: var(--dark-secondary);
  --theme-accent: var(--dark-accent);
  --theme-border: var(--dark-border);
  --theme-border-light: var(--dark-border-light);
  --theme-text-primary: var(--dark-text-primary);
  --theme-text-secondary: var(--dark-text-secondary);
  --theme-text-muted: var(--dark-text-muted);
  --theme-shadow: var(--dark-shadow);
  --theme-shadow-light: var(--dark-shadow-light);
}

/* ============================================
   CLEAN LIGHT THEME (DEFAULT)
   ============================================ */

@media (max-width: 1024px) {
  /* Mobile verse AI panel - Clean theme */
  .mobile-verse-ai {
    background: var(--clean-bg);
    border: 1px solid var(--clean-border);
    box-shadow: 
      0 -4px 20px var(--clean-shadow-light),
      0 -1px 3px var(--clean-shadow-light);
  }
  
  .mobile-verse-ai::before {
    background: var(--clean-text-muted);
  }
  
  /* Action buttons */
  .mobile-verse-action-btn {
    background: var(--clean-surface);
    border: 1px solid var(--clean-border);
    color: var(--clean-text-secondary);
    font-weight: 500;
  }
  
  .mobile-verse-action-btn:hover {
    background: var(--clean-surface-hover);
    border-color: var(--clean-primary);
    transform: translateY(-1px);
  }
  
  .mobile-verse-action-btn.generate {
    background: var(--clean-primary);
    color: white;
    border-color: var(--clean-primary);
  }
  
  .mobile-verse-action-btn.generate:hover {
    background: var(--clean-primary-hover);
    border-color: var(--clean-primary-hover);
  }
  
  .mobile-verse-action-btn.clear {
    background: #FFF5F5;
    color: #E53E3E;
    border-color: #FED7D7;
  }
  
  .mobile-verse-action-btn.clear:hover {
    background: #FED7D7;
    border-color: #FBB6CE;
  }
  
  /* Input styling */
  .mobile-verse-input {
    background: var(--clean-bg);
    border: 2px solid var(--clean-border);
    color: var(--clean-text-primary);
    border-radius: 16px;
  }
  
  .mobile-verse-input:focus {
    border-color: var(--clean-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
  }
  
  .mobile-verse-input::placeholder {
    color: var(--clean-text-muted);
  }
  
  /* Send button */
  .mobile-verse-send {
    background: var(--clean-primary);
    color: white;
    border-radius: 16px;
  }
  
  .mobile-verse-send:hover {
    background: var(--clean-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
  }
  
  /* Full-screen chat container */
  .mobile-ai-chat-expanded,
  [data-theme="light"] .mobile-ai-chat-expanded,
  :root .mobile-ai-chat-expanded {
    background: var(--theme-surface) !important;
    color: var(--theme-text-primary) !important;
  }
  
  /* Header */
   .mobile-ai-header {
    border-bottom: 1px solid var(--theme-border);
    box-shadow: 0 1px 3px var(--theme-shadow-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
  }
  
  .mobile-ai-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  
  .mobile-ai-back,
  .mobile-ai-generate-more,
  .mobile-ai-theme-toggle {
    color: var(--theme-text-primary);
    border-radius: 8px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-ai-back:hover,
  .mobile-ai-generate-more:hover,
  .mobile-ai-theme-toggle:hover {
    background: var(--theme-surface);
  }
  
  /* Refresh icon for generate more button */
  .mobile-ai-generate-more {
    font-size: 0; /* Hide text */
  }
  
  .mobile-ai-generate-more::before {
    content: '↻';
    font-size: 18px;
    font-weight: bold;
    color: var(--theme-text-primary);
  }
  
  .mobile-ai-generate-more.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--theme-border);
    border-top: 2px solid var(--theme-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  
  .mobile-ai-title {
    color: var(--theme-text-primary);
    font-weight: 500;
    font-size: 26px;
  }
  
  /* Verse context */
  .mobile-ai-verse-context {
    background: var(--theme-bg);
    border-bottom: 1px solid var(--theme-border);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 16px;
    min-height: 24px;
  }
  
  .mobile-ai-verse-context,
  [data-theme="light"] .mobile-ai-verse-context,
  :root .mobile-ai-verse-context {
    background: var(--theme-bg) !important;
    border-bottom: 1px solid var(--theme-border) !important;
    padding: 2px 16px !important;
    min-height: 24px !important;
  }
  
  .mobile-ai-verse-context:hover {
    background: var(--theme-surface);
  }
  
  /* Clickable state when verses are selected */
  .mobile-ai-verse-context.has-verses .mobile-ai-verse-title,
  .mobile-ai-verse-context.has-verses .mobile-ai-verse-reference {
    position: relative;
  }
  
  .mobile-ai-verse-title {
    color: var(--theme-text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.1;
    padding: 0;
    margin: 0;
  }
  
  .mobile-ai-verse-title,
  [data-theme="light"] .mobile-ai-verse-title,
  :root .mobile-ai-verse-title {
    color: var(--theme-text-primary) !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .mobile-ai-verse-reference {
    color: var(--theme-text-secondary);
  }
  
  /* Prompts section */
  .mobile-ai-prompts-section,
  [data-theme="light"] .mobile-ai-prompts-section,
  :root .mobile-ai-prompts-section {
    background: var(--theme-bg) !important;
    border-bottom: 1px solid var(--theme-border) !important;
    position: relative;
  }
  
  /* Prompts header */
  .mobile-ai-prompts-header,
  [data-theme="light"] .mobile-ai-prompts-header,
  :root .mobile-ai-prompts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 12px 40px 12px 16px; /* Extra right padding for X button */
    background: transparent !important; /* Remove white background */
    color: var(--theme-text-primary) !important;
  }
  
  .mobile-ai-prompts-title,
  [data-theme="light"] .mobile-ai-prompts-title,
  :root .mobile-ai-prompts-title {
    color: var(--theme-text-primary) !important;
    font-weight: 600;
    margin: 0;
  }
  
  /* Small X button to hide prompts */
  .mobile-ai-prompts-close,
  [data-theme="light"] .mobile-ai-prompts-close,
  :root .mobile-ai-prompts-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: var(--theme-surface-hover) !important;
    color: var(--theme-text-secondary) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
  }
  
  .mobile-ai-prompts-close:hover,
  [data-theme="light"] .mobile-ai-prompts-close:hover,
  :root .mobile-ai-prompts-close:hover {
    background: var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
    transform: scale(1.1);
  }
  
  .mobile-ai-prompts-close:active {
    transform: scale(0.95);
  }
  
  /* Prompt cards - Colorful design like the image */
  .mobile-ai-prompt-card {
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  /* Individual prompt card colors - Light theme */
  .mobile-ai-prompt-card:nth-child(1) {
    background: linear-gradient(135deg, #e45cf6, #7C3AED); /* Purple */
  }
  
  .mobile-ai-prompt-card:nth-child(2) {
    background: linear-gradient(45deg, #e45cf6, #7C3AED); /* Purple */
  }
  
  .mobile-ai-prompt-card:nth-child(3) {
    background: linear-gradient(75Deg, #e45cf6, #7C3AED); /* Purple */
  }
  
  .mobile-ai-prompt-card:nth-child(4) {
    background: linear-gradient(25deg, #e45cf6, #7C3AED); /* Purple */
  }
  
  .mobile-ai-prompt-card:nth-child(5) {
    background: linear-gradient(175deg, #e45cf6, #7C3AED); /* Purple */
  }
  
  .mobile-ai-prompt-card:nth-child(6) {
    background: linear-gradient(155deg, #e45cf6, #7C3AED); /* Purple */
  }

  .mobile-ai-prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  }

  /* Dark theme prompt card colors */
  [data-theme="dark"] .mobile-ai-prompt-card:nth-child(1) {
    background: linear-gradient(155deg, #171a29, #16161648); 
  }
  
  [data-theme="dark"] .mobile-ai-prompt-card:nth-child(2) {
    background: linear-gradient(175deg, #171a29, #16161648); 
  }
  
  [data-theme="dark"] .mobile-ai-prompt-card:nth-child(3) {
    background: linear-gradient(25deg, #171a29, #16161648); 
  }
  
  [data-theme="dark"] .mobile-ai-prompt-card:nth-child(4) {
    background: linear-gradient(75deg, #171a29, #16161648); /* Darker Amber for dark */
  }
  
  [data-theme="dark"] .mobile-ai-prompt-card:nth-child(5) {
    background: linear-gradient(45deg, #171a29, #16161648); /* Darker Red for dark */
  }
  
  [data-theme="dark"] .mobile-ai-prompt-card:nth-child(6) {
    background: linear-gradient(135deg, #171a29, #16161648); /* Brighter Purple for dark (repeat) */
  }

  [data-theme="dark"] .mobile-ai-prompt-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  }
  
  /* Voice input button - Manual dark theme */
  [data-theme="dark"] .voice-input-btn {
    background: var(--dark-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  [data-theme="dark"] .voice-input-btn:hover {
    background: var(--dark-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  
  [data-theme="dark"] .voice-input-btn.listening {
    background: #ff6666;
  }
  
  .mobile-ai-prompt-card:active {
    transform: translateY(0) scale(0.98);
  }
  
  /* Chat messages */
  .mobile-ai-chat-messages,
  [data-theme="light"] .mobile-ai-chat-messages,
  :root .mobile-ai-chat-messages {
    background: linear-gradient(135deg, #d1d1d152 0%, #FAFAFA 50%, #dfdfdf28  140%);
    padding: 16px;
  }
  
  .mobile-ai-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease-out;
  }
  
  @keyframes messageSlideIn {
    0% {
      opacity: 0;
      transform: translateY(8px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .mobile-ai-message.user {
    display: flex;
    justify-content: flex-end;
  }
  
  .mobile-ai-message.user .message-content {
    background: linear-gradient(135deg, #e45cf6, #7C3AED); /* Purple */
    color: rgb(255, 255, 255);
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(203, 100, 212, 0.329);
  }
  
  .mobile-ai-message.assistant {
    display: flex;
    justify-content: flex-start;
  }
  
  .mobile-ai-message.assistant .message-content,
  [data-theme="light"] .mobile-ai-message.assistant .message-content,
  :root .mobile-ai-message.assistant .message-content {
    background: var(--theme-bg) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
    box-shadow: 0 1px 3px var(--theme-shadow-light);
  }
  
  /* Fast typing indicator */
  .mobile-ai-typing-indicator {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
  }
  
  .mobile-ai-typing-content {
    background: var(--theme-bg);
    border: 1px solid var(--theme-border);
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px var(--theme-shadow-light);
  }
  
  .typing-dots {
    display: flex;
    gap: 3px;
  }
  
  .typing-dot {
    width: 6px;
    height: 6px;
    background: var(--theme-primary);
    border-radius: 50%;
    animation: typingPulse 0.6s ease-in-out infinite;
  }
  
  .typing-dot:nth-child(2) {
    animation-delay: 0.1s;
  }
  
  .typing-dot:nth-child(3) {
    animation-delay: 0.2s;
  }
  
  @keyframes typingPulse {
    0%, 60%, 100% {
      opacity: 0.3;
      transform: scale(0.8);
    }
    30% {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  .typing-text {
    font-size: 14px;
    color: var(--theme-text-secondary);
    font-style: italic;
  }
  
  /* Loading states for buttons */
  .mobile-ai-generate-more.loading {
    pointer-events: none;
    opacity: 0.7;
  }
  
  .mobile-ai-generate-more.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--theme-border);
    border-top: 2px solid var(--theme-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Prompt generation loading overlay */
  .mobile-ai-prompts-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--theme-bg);
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
  }
  
  .mobile-ai-prompts-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--theme-border-light);
    border-top: 3px solid var(--theme-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  .loading-text {
    font-size: 14px;
    color: var(--theme-text-secondary);
    font-weight: 500;
  }
  
  .loading-text {
    font-size: 14px;
    color: var(--clean-text-secondary);
    font-weight: 500;
  }
  
  /* Input area */
  .mobile-ai-input-area,
  [data-theme="light"] .mobile-ai-input-area,
  :root .mobile-ai-input-area {
    background: var(--theme-bg) !important;
    border-top: 1px solid var(--theme-border) !important;
  }
  
  .mobile-ai-input-field,
  .mobile-ai-input-expanded,
  [data-theme="light"] .mobile-ai-input-field,
  [data-theme="light"] .mobile-ai-input-expanded,
  :root .mobile-ai-input-field,
  :root .mobile-ai-input-expanded {
    background: var(--theme-surface) !important;
    border: 2px solid var(--theme-border) !important;
    color: var(--theme-text-primary) !important;
    border-radius: 20px;
  }
  
  .mobile-ai-input-field:focus,
  .mobile-ai-input-expanded:focus,
  [data-theme="light"] .mobile-ai-input-field:focus,
  [data-theme="light"] .mobile-ai-input-expanded:focus,
  :root .mobile-ai-input-field:focus,
  :root .mobile-ai-input-expanded:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
  }
  
  .mobile-ai-send-button {
    background: var(--theme-primary);
    color: white;
    border-radius: 20px;
  }
  
  .mobile-ai-send-button:hover {
    background: var(--theme-primary-hover);
  }
  
  /* Voice input button styling */
  .voice-input-btn {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    border: none;
    background: var(--theme-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .voice-input-btn:hover {
    background: var(--theme-primary-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  .voice-input-btn.listening {
    background: #ff4444;
    animation: pulse 1.5s infinite;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }
}

/* ============================================
   CLEAN DARK THEME
   ============================================ */

@media (max-width: 1024px) and (prefers-color-scheme: dark) {
  /* Mobile verse AI panel - Dark theme */
  .mobile-verse-ai {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    box-shadow: 
      0 -4px 20px var(--dark-shadow-light),
      0 -1px 3px var(--dark-shadow-light);
  }
  
  .mobile-verse-ai::before {
    background: var(--dark-text-muted);
  }
  
  /* Action buttons */
  .mobile-verse-action-btn {
    background: var(--dark-bg);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-secondary);
    font-weight: 500;
  }
  
  .mobile-verse-action-btn:hover {
    background: var(--dark-surface-hover);
    border-color: var(--dark-primary);
    transform: translateY(-1px);
  }
  }
  .mobile-verse-action-btn.generate {
    background: var(--dark-primary);
    color: white;
    border-color: var(--dark-primary);
  }
  .mobile-verse-action-btn.generate:hover {
    background: var(--dark-primary-hover);
    border-color: var(--dark-primary-hover);
  }
  
  .mobile-verse-action-btn.clear {
    background: #2D1B1F;
    color: #F56565;
    border-color: #553C47;
  }
  
  .mobile-verse-action-btn.clear:hover {
    background: #3D2B2F;
    border-color: #653C57;
  }
  
  /* Input styling */
  .mobile-verse-input {
    background: var(--dark-bg);
    border: 2px solid var(--dark-border);
    color: var(--dark-text-primary);
    border-radius: 16px;
  }
  
  .mobile-verse-input:focus {
    border-color: var(--dark-primary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
  }
  
  .mobile-verse-input::placeholder {
    color: var(--dark-text-muted);
  }
  
  /* Send button */
  .mobile-verse-send {
    background: var(--dark-primary);
    color: white;
    border-radius: 16px;
  }
  
  .mobile-verse-send:hover {
    background: var(--dark-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
  }
  
  /* Full-screen chat container */
  .mobile-ai-chat-expanded {
    background: var(--dark-bg);
  }
  
  /* Header */
  [data-theme = "dark"] .mobile-ai-header {
    background: linear-gradient(155deg, #171a29, #16161648);
    border-bottom: 1px solid var(--dark-border);
    box-shadow: 0 1px 3px var(--dark-shadow-light);
  }
  
  [data-theme = "dark"] .mobile-ai-back,
  .mobile-ai-generate-more {
    color: var(--dark-text-primary);
    border-radius: 8px;
  }
  
  .mobile-ai-back:hover,
  .mobile-ai-generate-more:hover {
    background: var(--dark-surface-hover);
  }
  
  /* Refresh icon for generate more button - Dark mode */
  [data-theme = "dark"] .mobile-ai-generate-more::before {
    color: var(--dark-text-primary);
    background: #1D1D1F;
  }

  .mobile-ai-generate-more::before {
    color: #1D1D1F;
  }
  
  .mobile-ai-generate-more.loading::before {
    border: 2px solid var(--dark-border);
    border-top: 2px solid var(--dark-primary);
  }
  
  [data-theme = 'dark'].mobile-ai-title {
    color: var(--dark-text-primary);
    font-weight: 600;
    font-size: 26px;
  }
  
  /* Verse context */
  .mobile-ai-verse-context {
    background: var(--dark-surface);
    border-bottom: 1px solid var(--dark-border);
    padding: 2px 16px;
    min-height: 24px;
  }
  
  .mobile-ai-verse-context,
  [data-theme="dark"] .mobile-ai-verse-context {
    background: linear-gradient(155deg, #171a29, #16161648);
    border-bottom: 1px solid var(--dark-border) !important;
    padding: 2px 16px !important;
    min-height: 24px !important;
  }
  
  .mobile-ai-verse-title {
    color: var(--dark-text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.1;
    padding: 0;
    margin: 0;
  }
  
  .mobile-ai-verse-title,
  [data-theme="dark"] .mobile-ai-verse-title {
    color: var(--dark-text-primary) !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  [data-theme="dark"] .mobile-ai-verse-reference {
    color: var(--dark-text-secondary);
  }
  
  /* Dark theme verse viewer */
  [data-theme="dark"] .mobile-ai-verse-viewer {
    background: var(--dark-surface) !important;
    border: 1px solid var(--dark-border) !important;
  }
  
  [data-theme="dark"] .verse-viewer-content {
    background: var(--dark-surface) !important;
  }
  
  [data-theme="dark"] .verse-nav-btn {
    background: var(--dark-surface-hover);
    border: 1px solid var(--dark-border);
    color: var(--dark-primary);
  }
  
  [data-theme="dark"] .verse-nav-btn:hover:not(:disabled) {
    background: var(--dark-primary);
    color: var(--dark-bg);
  }
  
  [data-theme="dark"] .verse-counter {
    color: var(--dark-text-secondary);
    background: var(--dark-surface-hover);
    border: 1px solid var(--dark-border-light);
  }
  
  [data-theme="dark"] .verse-viewer-text {
    color: var(--dark-text-primary) !important;
    background: var(--dark-bg) !important;
    border: 1px solid var(--dark-border-light) !important;
  }
  
  [data-theme="dark"] .verse-viewer-text .verse-number {
    color: var(--dark-primary) !important;
  }
  
  /* Prompts section */
  .mobile-ai-prompts-section {
    background: var(--dark-surface);
    border-bottom: 1px solid var(--dark-border);
    position: relative;
  }
  
  .mobile-ai-prompts-title {
    color: var(--dark-text-primary);
    font-weight: 600;
  }
  
  /* Small X button to hide prompts - Dark mode */
  .mobile-ai-prompts-close {
    background: var(--dark-surface-hover);
    color: var(--dark-text-secondary);
  }
  
  .mobile-ai-prompts-close:hover {
    background: var(--dark-border);
    color: var(--dark-text-primary);
  }
  
  /* Prompt cards - Clean dark design with consistent colors */
  .mobile-ai-prompt-card {
    background: var(--dark-bg);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
  }
  
  .mobile-ai-prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--dark-shadow);
    border-color: var(--dark-primary);
    background: var(--dark-surface);
  }
  
  .mobile-ai-prompt-card:active {
    transform: translateY(0) scale(0.98);
  }
  
  /* Chat messages */
  [data-theme = 'dark'] .mobile-ai-chat-messages {
    background: var(--dark-bg);
    padding: 16px;
  }
  
  .mobile-ai-message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease-out;
  }
  
  .mobile-ai-message.user {
    display: flex;
    justify-content: flex-end;
  }
  
  [data-theme = 'dark'] .mobile-ai-message.user .message-content {
    background: #2c2c2e;
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(65, 65, 65, 0.137);
  }
  
  .mobile-ai-message.assistant {
    display: flex;
    justify-content: flex-start;
  }
  
  .mobile-ai-message.assistant .message-content {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
    box-shadow: 0 1px 3px var(--dark-shadow-light);
  }
  
  /* Fast typing indicator - Dark mode */
  .mobile-ai-typing-indicator {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
  }
  
  .mobile-ai-typing-content {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px var(--dark-shadow-light);
  }
  
  .typing-dot {
    background: var(--dark-primary);
  }
  
  .typing-text {
    color: var(--dark-text-secondary);
  }
  
  /* Loading states for buttons - Dark mode */
  .mobile-ai-generate-more.loading::before {
    border: 2px solid var(--dark-border);
    border-top: 2px solid var(--dark-primary);
  }
  
  /* Prompt generation loading overlay - Dark mode */
  .mobile-ai-prompts-loading {
    background: rgba(28, 28, 30, 0.9);
  }
  
  .loading-spinner {
    border: 3px solid var(--dark-border);
    border-top: 3px solid var(--dark-primary);
  }
  
  .loading-text {
    color: var(--dark-text-secondary);
  }
  
  /* Input area */
  .mobile-ai-input-area {
    background: var(--dark-surface);
    border-top: 1px solid var(--dark-border);
  }
  
  .mobile-ai-input-field {
    background: var(--dark-bg);
    border: 2px solid var(--dark-border);
    color: var(--dark-text-primary);
    border-radius: 20px;
  }
  
  .mobile-ai-input-field:focus {
    border-color: var(--dark-primary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
  }
  
  .mobile-ai-send-button {
    background: var(--dark-primary);
    color: white;
    border-radius: 20px;
  }
  
  .mobile-ai-send-button:hover {
    background: var(--dark-primary-hover);
  }
  
  /* Voice input button styling - Dark theme */
  .voice-input-btn {
    background: var(--dark-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .voice-input-btn:hover {
    background: var(--dark-primary-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  
  .voice-input-btn.listening {
    background: #ff6666;
  }

/* ============================================
   ENHANCED MOBILE UI ELEMENTS
   ============================================ */

@media (max-width: 1024px) {
  /* Smooth transitions for theme switching */
  .mobile-verse-ai,
  .mobile-ai-chat-expanded,
  .mobile-ai-header,
  .mobile-verse-action-btn,
  .mobile-verse-input,
  .mobile-verse-send,
  .mobile-ai-prompt-card {
    transition: all 0.3s ease;
  }
  
  /* Professional shadows and hover effects */
  .mobile-verse-action-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.2);
  }
  
  .mobile-ai-prompt-card:active {
    transform: translateY(0) scale(0.98);
  }
  
  /* Enhanced focus states */
  .mobile-verse-input:focus,
  .mobile-ai-input-field:focus {
    outline: none;
    transform: translateY(-1px);
  }
  
  /* Loading states */
  .mobile-ai-typing-indicator {
    background: var(--lavender-soft-white);
    border: 1px solid var(--lavender-border);
  }
  
  @media (prefers-color-scheme: dark) {
    .mobile-ai-typing-indicator {
      background: var(--dark-indigo-surface);
      border: 1px solid var(--dark-indigo-border);
    }
  }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

@media (max-width: 1024px) {
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .mobile-verse-ai,
    .mobile-ai-chat-expanded {
      border-width: 2px;
    }
    
    .mobile-verse-action-btn,
    .mobile-ai-prompt-card {
      border-width: 2px;
    }
  }
  
  /* ============================================
     VERSE VIEWER STYLES
     ============================================ */
  
  .mobile-ai-verse-viewer,
  [data-theme="light"] .mobile-ai-verse-viewer,
  :root .mobile-ai-verse-viewer {
    margin-top: 8px;
    border-radius: 8px;
    background: var(--theme-surface) !important;
    border: 1px solid var(--theme-border) !important;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
  }
  
  .verse-viewer-content,
  [data-theme="light"] .verse-viewer-content,
  :root .verse-viewer-content {
    padding: 12px;
    background: var(--theme-surface) !important;
  }
  
  .verse-viewer-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 4px 0;
  }
  
  .verse-nav-btn {
    background: var(--theme-surface-hover);
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .verse-nav-btn:hover:not(:disabled) {
    background: var(--theme-primary);
    color: var(--theme-bg);
    transform: scale(1.05);
  }
  
  .verse-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .verse-counter {
    font-size: 13px;
    color: var(--theme-text-secondary);
    font-weight: 500;
    background: var(--theme-surface-hover);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--theme-border-light);
  }
  
  .verse-viewer-text,
  [data-theme="light"] .verse-viewer-text,
  :root .verse-viewer-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--theme-text-primary) !important;
    background: var(--theme-bg) !important;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--theme-border-light) !important;
    min-height: 60px;
    display: flex;
    align-items: center;
  }
  
  .verse-viewer-text .verse-number,
  [data-theme="light"] .verse-viewer-text .verse-number,
  :root .verse-viewer-text .verse-number {
    display: inline;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--theme-primary) !important;
    vertical-align: super;
    margin-right: 4px;
    line-height: 1;
  }
  
  /* Responsive adjustments */
  @media (max-width: 480px) {
    .verse-viewer-navigation {
      margin-bottom: 6px;
    }
    
    .verse-nav-btn {
      width: 24px;
      height: 24px;
      font-size: 14px;
    }
    
    .verse-counter {
      font-size: 12px;
      padding: 3px 6px;
    }
    
    .verse-viewer-text {
      font-size: 13px;
      padding: 8px;
      min-height: 50px;
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    .mobile-verse-ai,
    .mobile-ai-chat-expanded,
    .mobile-verse-action-btn,
    .mobile-ai-prompt-card,
    .verse-nav-btn {
      transition: none;
    }
    
    .mobile-ai-prompt-card:hover,
    .verse-nav-btn:hover {
      transform: none;
    }
  }
}
