/* Mobile-specific chatbot enhancements */

/* Handle safe areas on mobile devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chatbot-window-mobile {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .chatbot-input-container {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }
}

/* Optimize touch targets for mobile */
@media (max-width: 768px) {
  /* Larger touch targets */
  .chatbot-button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Prevent text selection during dragging */
  .dragging * {
    user-select: none;
  }
  
  /* Improve scrolling performance */
  .chatbot-messages {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
  }
  
  /* Better keyboard handling */
  .chatbot-input:focus {
    position: sticky;
    bottom: 0;
    z-index: 10;
  }
  
  /* Optimize animations for battery */
  .chatbot-animation {
    will-change: transform, opacity;
  }
  
  /* Handle device rotation */
  @media (orientation: landscape) {
    .chatbot-window-partial {
      height: 80% !important; /* Override height in landscape */
    }
  }
  
  /* Dark mode optimization */
  @media (prefers-color-scheme: dark) {
    .chatbot-bubble {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
  }
  
  /* Haptic feedback visual cue */
  .haptic-feedback {
    animation: pulse 0.3s ease-out;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.97); }
    100% { transform: scale(1); }
  }
  
  /* Optimize for one-handed use */
  .bottom-controls {
    padding-bottom: 0.25rem;
    max-height: calc(100% - 60px);
  }
  
  /* Swipe to dismiss visual indicator */
  .swipe-indicator {
    height: 4px;
    width: 36px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto;
    margin-top: 8px;
  }
  
  /* Voice input feedback */
  .voice-active {
    animation: voice-pulse 1.5s infinite ease-in-out;
  }
  
  @keyframes voice-pulse {
    0%, 100% { transform: scale(1); background: rgba(220, 38, 38, 0.2); }
    50% { transform: scale(1.1); background: rgba(220, 38, 38, 0.5); }
  }
}

/* Custom scrollbar for mobile */
.thin-scrollbar {
  scrollbar-width: thin;
}

.thin-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.thin-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.thin-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

/* Notification badge */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 0 2px var(--background);
  z-index: 1;
}

.notification-badge.pulse {
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Shadow effect when dragging */
.chatbot-dragging {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
