/* PBX Guru Chatbot Widget - Enhanced Styling */

/* CSS Variables for easy customization */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  
  --background-color: #ffffff;
  --text-color: #333333;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  
  --border-radius: 12px;
  --border-radius-sm: 6px;
  --border-radius-lg: 16px;
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size: 14px;
  --font-size-sm: 12px;
  --font-size-lg: 16px;
  
  --spacing: 16px;
  --spacing-sm: 8px;
  --spacing-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.2);
  
  /* Scrollbar specific variables */
  --scrollbar-width: 16px;
  --scrollbar-color: #6c757d;
  --scrollbar-track-color: rgba(0, 0, 0, 0.2);
  --scrollbar-thumb-color: #6c757d;
  --scrollbar-thumb-hover-color: #007bff;
}

/* Main Widget Container */
.pbx-chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Container */
.chatbot-container {
  width: 380px;
  max-height: 600px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2), 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* Header Styling */
.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 20px 20px 0 0;
  position: relative;
  overflow: hidden;
}

.chatbot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.header-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  text-align: center;
  flex: 1;
}

/* Customer Logo Styling */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.customer-logo {
  max-width: 60px;
  max-height: 40px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.customer-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Message Timestamps */
.message-timestamp {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  display: block;
  font-style: italic;
}

/* Message Logo Styling */
.message-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px;
}

/* Simple typing indicator - just italic text, no background */
.typing-indicator-simple {
  padding: 8px 0;
  margin: 5px 0;
  text-align: left;
}

.typing-text-simple {
  font-style: italic;
  color: #6c757d;
  font-size: 13px;
  opacity: 0.7;
  animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#chatbot-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

#chatbot-name i {
  font-size: 16px;
  color: #fbbf24;
}

.header-subtitle {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
  font-weight: 400;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.close-btn i {
  font-size: 14px;
}

/* Messages Container */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 80px; /* Increased padding to prevent overlap with sticky actions */
  max-height: 350px; /* Reduced height to make room for actions */
  background: #f8f9fa;
  border-radius: 8px;
  margin: 15px 0;
  position: relative;
  
  /* Force scrollbar to always be visible */
  scrollbar-width: thin;
  scrollbar-color: #007bff #e9ecef;
  -ms-overflow-style: scrollbar;
  
  /* WebKit scrollbar styling */
  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  &::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
    border: 1px solid #e9ecef;
  }
  
  &::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
  }
  
  &::-webkit-scrollbar-corner {
    background: #e9ecef;
  }
}

/* Ensure scrollbar is visible on all browsers */
.chatbot-messages {
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: #007bff #e9ecef;
  
  /* IE/Edge */
  -ms-overflow-style: scrollbar;
  
  /* Force scrollbar visibility */
  overflow-y: scroll !important;
  
  /* Ensure content doesn't hide scrollbar */
  padding-right: 15px;
  box-sizing: border-box;
}

/* Ensure last message has bottom margin */
.chatbot-messages > *:last-child {
  margin-bottom: 50px;
}

/* Contact Info Form Styles */
/* Contact Form Styling - Enhanced */
#contact-info-form {
  margin: var(--spacing-lg) 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  border: 1px solid rgba(0, 123, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#contact-info-form .message-text {
  padding: 0;
}

#contact-info-form .message-text > p {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: var(--font-size-lg);
  color: var(--text-color);
  font-weight: 500;
  line-height: 1.6;
}

#contact-info-form form {
  margin-top: var(--spacing);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

#contact-info-form .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

#contact-info-form label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: var(--font-size);
  color: var(--text-color);
  position: relative;
}

#contact-info-form label:not(:has(+ textarea))::after {
  content: '*';
  color: #dc3545;
  font-weight: bold;
  margin-left: 4px;
}

#contact-info-form input[type="text"],
#contact-info-form input[type="email"],
#contact-info-form textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size);
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s ease;
  background: #ffffff;
  color: var(--text-color);
}

#contact-info-form input[type="text"]:hover,
#contact-info-form input[type="email"]:hover,
#contact-info-form textarea:hover {
  border-color: #b0b0b0;
}

#contact-info-form input[type="text"]:focus,
#contact-info-form input[type="email"]:focus,
#contact-info-form textarea:focus {
  outline: none;
  border-color: var(--primary-color, #007bff);
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
  background: #ffffff;
}

#contact-info-form textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.5;
}

#contact-info-form .submit-contact-btn {
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  margin-top: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#contact-info-form .submit-contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#contact-info-form .submit-contact-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

#contact-info-form .submit-contact-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#contact-info-form .submit-contact-btn i {
  font-size: 18px;
}

/* Message Styling */
.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.message-avatar.user {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-content {
  flex: 1;
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  line-height: 1.5;
  font-size: 14px;
  color: #374151;
}

.message.bot .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.message.user .message-content {
  background: white;
  color: #374151;
  margin-left: auto;
  border-radius: 18px 18px 4px 18px;
}

/* Actions Area - Now includes input box and buttons */
.chatbot-actions {
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-top: 2px solid #dee2e6;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  bottom: 0;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 0 0 20px 20px;
  min-height: 120px; /* Ensure minimum height for buttons */
}

/* Visual separator between input and buttons */
.chatbot-actions::after {
  content: '';
  position: absolute;
  top: 60px; /* Position below input area */
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(to right, transparent, #dee2e6, transparent);
  pointer-events: none;
  z-index: 1000;
}

/* Input Area - Now part of actions area */
.chatbot-input {
  padding: 0;
  background: transparent;
  border: none;
  position: absolute;
  width: 100%;
  bottom: 110px;
  margin: auto;
  z-index: 1003; /* Higher than separator and buttons */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.input-container {
  display: flex;
  gap: 12px;
  align-items: center;
  background: white;
  padding: 12px 16px;
  border-radius: 25px;
  border: 2px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1002; /* Higher than buttons */
  margin-bottom: 8px; /* Add space between input and buttons */
position: absolute;
width: 100%;
bottom: 30px;
}

#chatbot-input {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  background: transparent;
  color: #374151;
  min-height: 20px;
}

#chatbot-input::placeholder {
  color: #9ca3af;
  opacity: 0.8;
}

#chatbot-input:focus {
  background: transparent;
  box-shadow: none;
}

.input-container:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  flex-shrink: 0;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn i {
  font-size: 14px;
}

/* Button row for voice call and test speaker */
.actions-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  z-index: 1001; /* Lower than input */
  position: relative;
}

.voice-call-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 12px 20px; /* Slightly reduced padding */
  border-radius: 25px;
  cursor: pointer;
  font-size: 13px; /* Slightly smaller font */
  font-weight: 700;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  flex: 1;
  min-width: 120px; /* Reduced min-width */
  text-transform: uppercase;
  letter-spacing: 0.5px; /* Reduced letter spacing */
  position: relative;
  overflow: hidden;
}

.voice-call-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

.voice-call-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.voice-call-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.voice-call-btn:hover::before {
  left: 100%;
}

.voice-call-btn.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.voice-call-btn.active:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.voice-call-btn i {
  font-size: 13px; /* Match button text size */
}

/* Test Speaker Button */
.test-sound-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 12px 20px; /* Slightly reduced padding */
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px; /* Slightly smaller font */
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  min-width: 120px; /* Reduced min-width */
  text-transform: uppercase;
  letter-spacing: 0.5px; /* Reduced letter spacing */
  position: relative;
  overflow: hidden;
}

.test-sound-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
}

.test-sound-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.test-sound-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.test-sound-btn:hover::before {
  left: 100%;
}

/* Suggestions */
.chatbot-suggestions {
  padding: 20px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.suggestion-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

/* Notifications */
.chatbot-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  animation: slideInRight 0.3s ease-out;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chatbot-notification.info {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.chatbot-notification.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.chatbot-notification.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.chatbot-notification.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Scroll Buttons */
.scroll-to-bottom-btn,
.scroll-to-top-btn {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 10001;
}

.scroll-to-bottom-btn:hover,
.scroll-to-top-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.scroll-to-bottom-btn i,
.scroll-to-top-btn i {
  font-size: 16px;
}

/* Floating Button */
.gurubot-float-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 9999;
  font-size: 12px;
  font-weight: 500;
}

.gurubot-float-btn:hover {
  background: #0056b3;
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.gurubot-float-btn i {
  font-size: 20px;
}

.gurubot-float-btn span {
  font-size: 10px;
  line-height: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-container {
    width: calc(100vw - 40px);
    height: calc(100vh - 120px);
    max-width: none;
    max-height: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    bottom: 0;
    right: 20px;
    left: 20px;
  }
  
  .gurubot-float-btn {
    width: 56px;
    height: 56px;
    font-size: 11px;
  }
  
  .gurubot-float-btn i {
    font-size: 18px;
  }
  
  .gurubot-float-btn span {
    font-size: 9px;
  }
  
  /* Ensure scrollbar is visible on mobile */
  .chatbot-messages {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    width: 340px;
    right: 10px;
    bottom: 10px;
  }
  
  .chatbot-messages {
    max-height: 300px;
  }
  
  .chatbot-actions {
    flex-direction: column;
  }
  
  .actions-buttons {
    flex-direction: column;
  }
  
  .voice-call-btn,
  .test-sound-btn {
    width: 100%;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #404040;
    --light-color: #2d2d2d;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }
  
  .chatbot-messages {
    background: #2d2d2d;
  }
  
  .message-content {
    background: #404040;
    color: white;
  }
  
  .chatbot-input {
    background: #2d2d2d;
    color: white;
  }
  
  .chatbot-actions,
  .chatbot-suggestions {
    background: #2d2d2d;
  }
  
  .suggestion-btn {
    background: #404040;
    color: white;
    border-color: #555;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles for Keyboard Navigation */
.chatbot-container *:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .chatbot-container {
    border: 2px solid var(--text-color);
  }
  
  .message-content {
    border: 1px solid var(--text-color);
  }
  
  .chatbot-input {
    border: 2px solid var(--text-color);
  }
}

/* Toggle Button for Standalone Customers */
.chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  font-size: 24px;
  z-index: 9999;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.chatbot-toggle .toggle-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chatbot-toggle .toggle-content span {
  font-size: 10px;
  margin-top: 2px;
  font-weight: 500;
  line-height: 1;
}

/* Minimized Widget */
.pbx-chatbot-minimized {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  font-size: 24px;
  z-index: 9999;
  opacity: 0;
  transform: scale(0.8);
}

.pbx-chatbot-minimized.show {
  opacity: 1;
  transform: scale(1);
}

.pbx-chatbot-minimized:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.pbx-chatbot-minimized .minimized-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pbx-chatbot-minimized .minimized-content span {
  font-size: 10px;
  margin-top: 2px;
  font-weight: 500;
  line-height: 1;
}

/* Inactivity Warning */
.inactivity-warning {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #fff;
  padding: 12px 16px;
  margin: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
  animation: slideInDown 0.3s ease-out;
}

.inactivity-warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.inactivity-warning-content i {
  font-size: 16px;
  flex-shrink: 0;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Powered By Footer */
.chatbot-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(248, 249, 250, 0.8);
  font-size: 11px;
  color: #6c757d;
}

.powered-by-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.powered-by-text {
  color: #6c757d;
  font-weight: 500;
}

.powered-by-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.powered-by-link:hover {
  opacity: 0.8;
}

.powered-by-logo {
  height: 20px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
}
