/* ============================================
   CHAT WIDGET STYLES
   ============================================ */

.chat-widget-bubble {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.chat-bubble-button {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.chat-bubble-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.5);
}

.chat-bubble-button svg {
  width: 1.75rem;
  height: 1.75rem;
}

.chat-widget-container {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 22rem;
  max-height: 35rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-widget-container.open {
  display: flex;
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-widget-header {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  gap: 0.5rem;
}

.chat-widget-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.chat-agents-status {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.625rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-agents-status .agents-count {
  font-weight: 700;
  font-size: 0.875rem;
}

.chat-agents-status.unavailable {
  background: rgba(255, 100, 100, 0.3);
}

.chat-close-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}

.chat-close-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-close-button svg {
  width: 1rem;
  height: 1rem;
}

.chat-widget-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  max-height: 25rem;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.chat-form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.chat-form-group input {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.chat-form-group input:focus {
  outline: none;
  border-color: #2563eb;
}

.chat-submit-button {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.chat-submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  max-width: 85%;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chat-message.user {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.chat-message.discord {
  background: #f1f5f9;
  color: #334155;
  align-self: flex-start;
}

.chat-message.system {
  background: #fef3c7;
  color: #92400e;
  text-align: center;
  max-width: 100%;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
}

.chat-message-author {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  opacity: 0.9;
}

.chat-input-area {
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 0.5rem;
}

.chat-input-area input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.chat-input-area input:focus {
  outline: none;
  border-color: #2563eb;
}

.chat-send-button {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: white;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-send-button:hover {
  transform: scale(1.05);
}

.chat-send-button svg {
  width: 1rem;
  height: 1rem;
}

.chat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1rem;
}

.chat-loading-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #2563eb;
  animation: pulse 1.5s ease-in-out infinite;
}

.chat-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.chat-closed {
  text-align: center;
  padding: 2rem 1rem;
}

.chat-closed-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  background: #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
}

.chat-closed-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.chat-closed h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 0.5rem;
}

.chat-closed p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.chat-unavailable {
  text-align: center;
  padding: 2rem 1rem;
}

.chat-unavailable-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
}

.chat-unavailable-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.chat-unavailable h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #ef4444;
  margin: 0 0 0.5rem;
}

.chat-unavailable p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}
