/**
 * Website AI Chat Widget Styles
 * Mobile/desktop responsive styling for AI chatbot
 * Follows Conecta branding guidelines
 */

/* Chat Widget Container - HIDDEN */
.website-ai-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  display: none !important; /* Hide widget on all devices */
  visibility: hidden !important; /* Additional hiding */
}

/* Chat Button */
.website-ai-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #006847 0%, #63A968 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 104, 71, 0.3);
  transition: all 0.3s ease;
  position: relative;
}

.website-ai-chat-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(0, 104, 71, 0.4);
}

.website-ai-chat-button:active {
  transform: scale(0.95);
}

.website-ai-chat-button .chat-icon {
  font-size: 24px;
  color: white;
}

/* Notification Badge */
.website-ai-chat-notification {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #EF003F;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Chat Window */
.website-ai-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 104, 71, 0.1);
}

.website-ai-chat-window.open {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.website-ai-chat-header {
  background: linear-gradient(135deg, #006847 0%, #63A968 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.website-ai-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.website-ai-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.website-ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.website-ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.website-ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.website-ai-chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.website-ai-chat-messages::-webkit-scrollbar-thumb {
  background: #006847;
  border-radius: 3px;
}

.website-ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #004d33;
}

/* Message Bubbles */
.website-ai-message {
  display: flex;
  margin-bottom: 12px;
}

.website-ai-message.user {
  justify-content: flex-end;
}

.website-ai-message.assistant {
  justify-content: flex-start;
}

.website-ai-message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.website-ai-message.user .website-ai-message-bubble {
  background: linear-gradient(135deg, #006847 0%, #63A968 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.website-ai-message.assistant .website-ai-message-bubble {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}

/* Message Timestamp */
.website-ai-message-time {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  text-align: right;
}

.website-ai-message.assistant .website-ai-message-time {
  text-align: left;
}

/* Typing Indicator */
.website-ai-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  max-width: 80px;
  border: 1px solid #e9ecef;
}

.website-ai-typing-dot {
  width: 8px;
  height: 8px;
  background: #006847;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.website-ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.website-ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Chat Input */
.website-ai-chat-input-container {
  padding: 16px 20px;
  border-top: 1px solid #e9ecef;
  background: white;
}

.website-ai-chat-input-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.website-ai-chat-input {
  flex: 1;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  transition: border-color 0.2s;
}

.website-ai-chat-input:focus {
  outline: none;
  border-color: #006847;
}

.website-ai-chat-input::placeholder {
  color: #999;
}

.website-ai-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #006847 0%, #63A968 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.website-ai-chat-send:hover {
  transform: scale(1.05);
}

.website-ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Contact Info Footer */
.website-ai-contact-footer {
  padding: 12px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-size: 12px;
  color: #666;
  text-align: center;
}

.website-ai-contact-footer a {
  color: #006847;
  text-decoration: none;
  font-weight: 500;
}

.website-ai-contact-footer a:hover {
  text-decoration: underline;
}

/* Callback Form */
.website-ai-callback-form {
  padding: 20px;
  background: white;
  border-top: 1px solid #e9ecef;
}

.website-ai-callback-form h4 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.website-ai-form-group {
  margin-bottom: 16px;
}

.website-ai-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.website-ai-form-group input,
.website-ai-form-group select,
.website-ai-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.website-ai-form-group input:focus,
.website-ai-form-group select:focus,
.website-ai-form-group textarea:focus {
  outline: none;
  border-color: #006847;
}

.website-ai-form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.website-ai-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.website-ai-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.website-ai-btn-primary {
  background: linear-gradient(135deg, #006847 0%, #63A968 100%);
  color: white;
}

.website-ai-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 104, 71, 0.3);
}

.website-ai-btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e9ecef;
}

.website-ai-btn-secondary:hover {
  background: #e9ecef;
}

/* Mobile Responsive - WIDGET HIDDEN */
@media (max-width: 768px) {
  .website-ai-chat-widget {
    bottom: 16px;
    right: 16px;
    display: none !important; /* Hide widget on mobile */
    visibility: hidden !important; /* Additional hiding */
  }

  .website-ai-chat-button {
    width: 56px;
    height: 56px;
  }

  .website-ai-chat-button .chat-icon {
    font-size: 22px;
  }

  .website-ai-chat-window {
    bottom: 76px;
    right: 0;
    width: calc(100vw - 32px);
    max-width: 350px;
    height: calc(100vh - 140px);
    max-height: 500px;
  }

  .website-ai-chat-header {
    padding: 14px 16px;
  }

  .website-ai-chat-header h3 {
    font-size: 15px;
  }

  .website-ai-chat-messages {
    padding: 16px;
  }

  .website-ai-message-bubble {
    font-size: 13px;
    padding: 10px 14px;
  }

  .website-ai-chat-input-container {
    padding: 14px 16px;
  }

  .website-ai-chat-input {
    font-size: 13px;
    padding: 10px 14px;
  }

  .website-ai-chat-send {
    width: 36px;
    height: 36px;
  }

  .website-ai-callback-form {
    padding: 16px;
  }

  .website-ai-form-actions {
    flex-direction: column;
  }

  .website-ai-btn {
    width: 100%;
  }
}

/* Small Mobile - WIDGET HIDDEN */
@media (max-width: 480px) {
  .website-ai-chat-widget {
    display: none !important; /* Hide widget on small mobile */
    visibility: hidden !important; /* Additional hiding */
  }
  
  .website-ai-chat-window {
    width: calc(100vw - 16px);
    right: -8px;
    height: calc(100vh - 120px);
  }

  .website-ai-chat-messages {
    padding: 12px;
  }

  .website-ai-message-bubble {
    font-size: 12px;
    padding: 8px 12px;
  }

  .website-ai-chat-input-container {
    padding: 12px;
  }

  .website-ai-chat-input {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Accessibility */
.website-ai-chat-widget:focus-within {
  outline: 2px solid #006847;
  outline-offset: 2px;
}

.website-ai-chat-input:focus,
.website-ai-chat-send:focus,
.website-ai-chat-close:focus {
  outline: 2px solid #006847;
  outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .website-ai-chat-window {
    background: #1a1a1a;
    border-color: #333;
  }

  .website-ai-message.assistant .website-ai-message-bubble {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #333;
  }

  .website-ai-chat-input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #333;
  }

  .website-ai-chat-input::placeholder {
    color: #999;
  }

  .website-ai-contact-footer {
    background: #2a2a2a;
    color: #999;
    border-color: #333;
  }

  .website-ai-callback-form {
    background: #1a1a1a;
  }

  .website-ai-callback-form h4 {
    color: #e0e0e0;
  }

  .website-ai-form-group label {
    color: #e0e0e0;
  }

  .website-ai-form-group input,
  .website-ai-form-group select,
  .website-ai-form-group textarea {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #333;
  }
}
