/* ===================================
   AI Chat Widget Styles
   =================================== */

/* Chat Button */
.chat-widget-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9998;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.4);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0, 242, 254, 0.6);
  }
}

.chat-widget-button:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(0, 242, 254, 0.6);
}

.chat-widget-button.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chat-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 24px;
  height: 24px;
  background: #EF4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  border: 3px solid var(--dark-bg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Chat Window */
.chat-widget-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: var(--dark-bg);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.chat-widget-window.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* Chat Header */
.chat-widget-header {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  flex-shrink: 0;
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.chat-widget-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-widget-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

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

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.5);
}

/* Chat Messages */
.chat-message {
  display: flex;
  animation: slideInMessage 0.3s ease;
}

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

.user-message {
  justify-content: flex-end;
}

.assistant-message {
  justify-content: flex-start;
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  position: relative;
}

.user-message .message-content {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-content p {
  margin: 0;
  line-height: 1.5;
  font-size: 14px;
}

.message-content a {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.user-message .message-content a {
  color: white;
  opacity: 0.9;
}

.message-time {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
}

/* Typing Indicator */
.typing-indicator .message-content {
  padding: 16px;
}

.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Input Container */
.chat-input-container {
  padding: 16px 20px;
  background: var(--dark-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.1);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 20px;
  max-height: 120px;
  line-height: 1.5;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-send-button {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.4);
}

.chat-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-powered-by {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin: 8px 0 0 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-widget-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 16px;
    right: 16px;
  }

  .chat-widget-button {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .message-content {
    max-width: 85%;
  }

  .chat-header-info h3 {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .chat-widget-window {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}
