/* ============================================
   MOBILE AI MODE TOGGLE STYLES
   ============================================
   
   Styles for Reader Mode vs Biblia AI Mode
   - Mode indicator positioning and animations
   - Verse interaction states
   - Mobile-only styles
*/

/* ============================================
   HIDE ON DESKTOP - MOBILE ONLY
   ============================================ */

.mobile-mode-indicator {
  display: none;
}

/* Hide purple floating AI button on mobile */
@media (max-width: 1024px) {
  .ai-toggle-btn {
    display: none !important;
  }
  
  /* CRITICAL: Reader mode must override ALL other verse styles */
  body.reader-mode #chapter-content .v,
  body.reader-mode .chapter-content .v,
  body.reader-mode .v {
    pointer-events: none !important;
    cursor: default !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    background: transparent !important;
    background-color: transparent !important;
    color: inherit !important;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
  }
  
  /* CRITICAL: AI mode must override reader mode rules with !important */
  body.ai-mode #chapter-content .v,
  body.ai-mode .chapter-content .v,
  body.ai-mode .v {
    pointer-events: auto !important;
    cursor: pointer !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    transition: all 0.2s ease !important;
  }
  
  /* AI mode hover effects */
  body.ai-mode #chapter-content .v:hover,
  body.ai-mode .chapter-content .v:hover,
  body.ai-mode .v:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    border-radius: 4px !important;
    transform: translateY(-1px) !important;
  }
}

/* Only show mode indicator on mobile devices */
@media (max-width: 768px) {
  .mobile-mode-indicator {
    display: block;
  }
}

/* ============================================
   MODE INDICATOR
   ============================================ */

@media (max-width: 768px) {
  .mobile-mode-indicator {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: rgba(59, 130, 246, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  
  .mobile-mode-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  .mobile-mode-indicator.reader-mode {
    background: rgba(16, 185, 129, 0.95);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  }
  
  .mobile-mode-indicator.ai-mode {
    background: rgba(139, 92, 246, 0.95);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  }
  
  /* Dark mode support */
  [data-theme="dark"] .mobile-mode-indicator {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
  }
  
  [data-theme="dark"] .mobile-mode-indicator.reader-mode {
    background: rgba(16, 185, 129, 0.9);
  }
  
  [data-theme="dark"] .mobile-mode-indicator.ai-mode {
    background: rgba(139, 92, 246, 0.9);
  }
  
  /* ============================================
     READER MODE STYLES - COMPLETE BLOCKING
     ============================================ */
  
  /* Completely disable ALL verse interactions in reader mode */
  .reader-mode #chapter-content .v,
  .reader-mode .chapter-content .v,
  .reader-mode .v,
  .reader-mode [class*="verse"],
  .reader-mode .verse {
    cursor: default !important;
    pointer-events: none !important;
    transition: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    background: transparent !important;
    color: inherit !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    text-shadow: none !important;
  }
  
  /* Remove ALL possible hover, active, focus, and selection states */
  .reader-mode #chapter-content .v:hover,
  .reader-mode .chapter-content .v:hover,
  .reader-mode .v:hover,
  .reader-mode #chapter-content .v:active,
  .reader-mode .chapter-content .v:active,
  .reader-mode .v:active,
  .reader-mode #chapter-content .v:focus,
  .reader-mode .chapter-content .v:focus,
  .reader-mode .v:focus,
  .reader-mode #chapter-content .v.selected,
  .reader-mode .chapter-content .v.selected,
  .reader-mode .v.selected,
  .reader-mode #chapter-content .v.highlighted,
  .reader-mode .chapter-content .v.highlighted,
  .reader-mode .v.highlighted,
  .reader-mode #chapter-content .v.hover,
  .reader-mode .chapter-content .v.hover,
  .reader-mode .v.hover {
    background: transparent !important;
    background-color: transparent !important;
    color: inherit !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    opacity: inherit !important;
    filter: none !important;
  }
  
  /* Block all possible selection pseudo-elements */
  .reader-mode *::selection,
  .reader-mode *::-moz-selection {
    background: transparent !important;
    color: inherit !important;
  }
  
  /* Disable verse number interactions completely */
  .reader-mode .verse-number,
  .reader-mode [class*="verse-number"],
  .reader-mode .v-num {
    cursor: default !important;
    pointer-events: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    background: transparent !important;
    color: inherit !important;
  }
  
  .reader-mode .verse-number:hover,
  .reader-mode [class*="verse-number"]:hover,
  .reader-mode .v-num:hover {
    background: transparent !important;
    color: inherit !important;
  }
  
  /* Hide ALL AI prompts and interactions in reader mode */
  .reader-mode .ai-prompts,
  .reader-mode .verse-prompts,
  .reader-mode #study-prompts-section,
  .reader-mode #ai-chat-panel,
  .reader-mode [class*="ai-"],
  .reader-mode [id*="ai-"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  /* Ensure no text selection highlighting in reader mode */
  .reader-mode-content,
  .reader-mode #chapter-content,
  .reader-mode .chapter-content {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  
  /* Clear any existing selections in reader mode with maximum specificity */
  .reader-mode .v.selected,
  .reader-mode .v.highlighted,
  .reader-mode #chapter-content .v.selected,
  .reader-mode .chapter-content .v.selected,
  .reader-mode #chapter-content .v.highlighted,
  .reader-mode .chapter-content .v.highlighted {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit !important;
  }
  
  /* ============================================
     AI MODE STYLES
     ============================================ */
  
  /* Smooth AI panel slide-up animation */
  .ai-mode #ai-chat-panel {
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  }
  
  /* When AI panel is shown */
  .ai-mode #ai-chat-panel.show {
    transform: translateY(0);
    opacity: 1;
  }
  
  /* When AI panel is hidden */
  .ai-mode #ai-chat-panel.hidden {
    transform: translateY(100%);
    opacity: 0;
  }
  
  /* ============================================
     AI TOGGLE BUTTON ENHANCEMENTS
     ============================================ */
  
  /* Enhanced AI toggle button for mobile */
  .ai-toggle-btn {
    transition: all 0.3s ease;
  }
  
  /* Reader mode button styling */
  .reader-mode .ai-toggle-btn {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
  }
  
  .reader-mode .ai-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
  }
  
  /* AI mode button styling */
  .ai-mode .ai-toggle-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.3);
  }
  
  .ai-mode .ai-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: scale(1.05);
  }
  
  /* ============================================
     READING ENHANCEMENTS
     ============================================ */
  
  /* Better reading experience in reader mode */
  .reader-mode .chapter-content {
    line-height: 1.7;
    font-size: 16px;
    letter-spacing: 0.3px;
  }
  
  .reader-mode .chapter-content p {
    margin-bottom: 1.2em;
  }
  
  /* Enhanced selection highlighting in AI mode ONLY */
  .ai-mode .chapter-content .v.selected {
    background: rgba(139, 92, 246, 0.2) !important;
    border-left: 3px solid #8b5cf6;
    padding-left: 8px;
    margin-left: -8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
  }
  
  /* ============================================
     RESPONSIVE ADJUSTMENTS
     ============================================ */
  
  /* Very small screens */
  @media (max-width: 360px) {
    .mobile-mode-indicator {
      top: 60px;
      font-size: 12px;
      padding: 6px 12px;
    }
  }
  
  /* Landscape orientation */
  @media (max-width: 768px) and (orientation: landscape) {
    .mobile-mode-indicator {
      top: 50px;
      font-size: 12px;
      padding: 6px 12px;
    }
  }
  
  /* ============================================
     ACCESSIBILITY IMPROVEMENTS
     ============================================ */
  
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .mobile-mode-indicator {
      border: 2px solid currentColor;
      font-weight: 600;
    }
    
    .ai-mode .chapter-content .v.selected {
      border-left-width: 4px;
      background: rgba(139, 92, 246, 0.3) !important;
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    .mobile-mode-indicator,
    .ai-toggle-btn,
    .chapter-content .v {
      transition: none !important;
      animation: none !important;
    }
    
    .ai-mode .chapter-content .v:hover {
      transform: none !important;
    }
  }
  
  /* Focus states for keyboard navigation */
  .ai-toggle-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }
  
  .ai-mode .chapter-content .v:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    border-radius: 4px;
  }
}
