/* Modern Customer Chatbot Widget */
#customer-chat-root {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 10000 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Launcher Button */
#customer-chat-root .customer-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

#customer-chat-root .customer-chat-launcher:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6);
}

#customer-chat-root .customer-chat-launcher .chat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

#customer-chat-root .customer-chat-launcher .chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Chat Container */
#customer-chat-root .customer-chat {
  position: relative;
  max-width: 400px;
  width: 90vw;
  max-height: 600px;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* Chat Header */
#customer-chat-root .customer-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#customer-chat-root .header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

#customer-chat-root .chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

#customer-chat-root .header-text {
  flex: 1;
}

#customer-chat-root .chat-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
}

#customer-chat-root .chat-subtitle {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 400;
}

#customer-chat-root .customer-chat-minimize {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

#customer-chat-root .customer-chat-minimize:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
#customer-chat-root .customer-chat-messages {
  height: 350px;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Message Styles */
#customer-chat-root .message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#customer-chat-root .user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

#customer-chat-root .bot-message {
  align-self: flex-start;
}

#customer-chat-root .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

#customer-chat-root .user-message .message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#customer-chat-root .bot-message .message-avatar {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  color: #8b4513;
}

#customer-chat-root .message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

#customer-chat-root .user-message .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#customer-chat-root .message-text {
  line-height: 1.5;
  margin-bottom: 4px;
}

#customer-chat-root .message-time {
  font-size: 11px;
  opacity: 0.7;
  text-align: right;
}

#customer-chat-root .user-message .message-time {
  text-align: left;
}

/* Typing Indicator */
#customer-chat-root .typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 0;
}

#customer-chat-root .typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  animation: typing 1.4s infinite ease-in-out;
}

#customer-chat-root .typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

#customer-chat-root .typing-indicator span: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;
  }
}

/* Input Container */
#customer-chat-root .customer-chat-input-container {
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 16px;
}

#customer-chat-root .customer-chat-form {
  margin-bottom: 12px;
}

#customer-chat-root .input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

#customer-chat-root .customer-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  background: #f8fafc;
}

#customer-chat-root .customer-chat-input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#customer-chat-root .customer-send-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

#customer-chat-root .customer-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#customer-chat-root .customer-send-btn:active {
  transform: scale(0.95);
}

/* Quick Actions */
#customer-chat-root .quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#customer-chat-root .quick-action-btn {
  padding: 8px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

#customer-chat-root .quick-action-btn:hover {
  background: #e2e8f0;
  color: #334155;
  transform: translateY(-1px);
}

/* Scrollbar Styling */
#customer-chat-root .customer-chat-messages::-webkit-scrollbar {
  width: 6px;
}

#customer-chat-root .customer-chat-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#customer-chat-root .customer-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#customer-chat-root .customer-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #customer-chat-root .customer-chat {
    width: calc(100vw - 24px);
    max-width: none;
    right: 12px;
    bottom: 12px;
    max-height: 80vh;
  }
  
  #customer-chat-root .customer-chat-launcher {
    right: 12px;
    bottom: 12px;
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
  
  #customer-chat-root .customer-chat-messages {
    height: 300px;
    padding: 16px;
  }
  
  #customer-chat-root .message {
    max-width: 90%;
  }
  
  #customer-chat-root .quick-actions {
    gap: 6px;
  }
  
  #customer-chat-root .quick-action-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #customer-chat-root .customer-chat {
    background: #1e293b;
    border-color: #334155;
  }
  
  #customer-chat-root .customer-chat-messages {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  }
  
  #customer-chat-root .message-content {
    background: #334155;
    color: #e2e8f0;
  }
  
  #customer-chat-root .customer-chat-input {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
  }
  
  #customer-chat-root .customer-chat-input:focus {
    background: #475569;
    border-color: #667eea;
  }
  
  #customer-chat-root .customer-chat-input-container {
    background: #1e293b;
    border-color: #334155;
  }
  
  #customer-chat-root .quick-action-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
  }
  
  #customer-chat-root .quick-action-btn:hover {
    background: #475569;
    color: #e2e8f0;
  }
}

/* Photo grid styles */
.customer-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.customer-photo-item {
  cursor: pointer;
  border: 2px solid #007bff;
  border-radius: 8px;
  padding: 4px;
  text-align: center;
  background-color: #f8f9fa;
  transition: transform 0.2s ease;
}

.customer-photo-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.customer-photo-item img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.customer-photo-item div {
  font-size: 10px;
  font-weight: bold;
  margin-top: 2px;
  color: #007bff;
}

/* Photo modal styles */
.customer-photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.customer-photo-modal > div {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  animation: slideInScale 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInScale {
  from { 
    opacity: 0;
    transform: scale(0.8);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}
