/* ============================================
   RYZORIA AI CHAT - STYLES
   ============================================ */

/* AI Chat Floating Button */
#aiChatBtn {
  position: fixed;
  bottom: 30px;
  right: 100px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.9) 0%, rgba(0, 153, 255, 0.9) 100%);
  border: 2px solid rgba(97, 225, 255, 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(97, 225, 255, 0.4);
  backdrop-filter: blur(10px);
}

#aiChatBtn:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(97, 225, 255, 0.6);
  background: linear-gradient(135deg, rgba(97, 225, 255, 1) 0%, rgba(0, 153, 255, 1) 100%);
}

#aiChatBtn.active {
  transform: scale(1.1);
}

/* Animation for button pulse */
@keyframes pulse {
  0% {
    box-shadow: 0 10px 30px rgba(97, 225, 255, 0.4);
  }
  50% {
    box-shadow: 0 15px 40px rgba(97, 225, 255, 0.6);
  }
  100% {
    box-shadow: 0 10px 30px rgba(97, 225, 255, 0.4);
  }
}

#aiChatBtn {
  animation: pulse 2s ease-in-out infinite;
}

#aiChatBtn:hover {
  animation: none;
}

/* AI Chat Modal/Window */
#aiChatModal {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 420px;
  max-height: 600px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(26, 31, 58, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(97, 225, 255, 0.2);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(97, 225, 255, 0.1);
  display: none;
  flex-direction: column;
  z-index: 1001;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s ease;
  overflow: hidden;
}

#aiChatModal.active {
  display: flex;
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Chat Header */
#aiChatHeader {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(97, 225, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.1) 0%, rgba(0, 153, 255, 0.05) 100%);
}

#aiChatHeader h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #61E1FF;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

#aiChatHeader i {
  font-size: 1.5rem;
}

#aiChatCloseBtn {
  background: none;
  border: none;
  color: #61E1FF;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

#aiChatCloseBtn:hover {
  background: rgba(97, 225, 255, 0.1);
  transform: rotate(90deg);
}

/* Chat Messages Container */
#aiChatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(10, 14, 39, 0.5);
}

/* Scrollbar styling */
#aiChatMessages::-webkit-scrollbar {
  width: 6px;
}

#aiChatMessages::-webkit-scrollbar-track {
  background: rgba(97, 225, 255, 0.05);
  border-radius: 10px;
}

#aiChatMessages::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.3), rgba(0, 153, 255, 0.3));
  border-radius: 10px;
}

#aiChatMessages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.5), rgba(0, 153, 255, 0.5));
}

/* Chat Messages */
.chat-message {
  display: flex;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

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

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

.chat-message.ai {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 0.875rem 1.125rem;
  border-radius: 15px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.message-bubble.user {
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.3) 0%, rgba(0, 153, 255, 0.2) 100%);
  color: #E0E7FF;
  border: 1px solid rgba(97, 225, 255, 0.3);
}

.message-bubble.ai {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(97, 225, 255, 0.1) 100%);
  color: #CDD9F0;
  border: 1px solid rgba(97, 225, 255, 0.2);
}

/* Welcome Message */
.message-bubble.welcome {
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.15) 0%, rgba(0, 153, 255, 0.1) 100%);
  color: #A0BFFF;
  border: 1px solid rgba(97, 225, 255, 0.25);
  text-align: center;
  margin: 1rem 0;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.875rem 1.125rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(97, 225, 255, 0.1) 100%);
  border-radius: 15px;
  border: 1px solid rgba(97, 225, 255, 0.2);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #61E1FF;
  animation: typing 1.4s infinite;
}

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

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

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

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(97, 225, 255, 0.3);
  border-top: 2px solid #61E1FF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Chat Input Area */
#aiChatInputArea {
  padding: 1.25rem;
  border-top: 1px solid rgba(97, 225, 255, 0.15);
  background: linear-gradient(180deg, rgba(97, 225, 255, 0.05) 0%, rgba(10, 14, 39, 0.8) 100%);
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

#aiChatInput {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(97, 225, 255, 0.2);
  border-radius: 12px;
  background: rgba(26, 31, 58, 0.6);
  color: #E0E7FF;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  resize: none;
  max-height: 100px;
  min-height: 40px;
}

#aiChatInput::placeholder {
  color: rgba(160, 174, 192, 0.6);
}

#aiChatInput:focus {
  outline: none;
  border-color: rgba(97, 225, 255, 0.4);
  background: rgba(26, 31, 58, 0.8);
  box-shadow: 0 0 15px rgba(97, 225, 255, 0.1);
}

/* Send Button */
#aiChatSendBtn {
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.3) 0%, rgba(0, 153, 255, 0.2) 100%);
  border: 1px solid rgba(97, 225, 255, 0.4);
  border-radius: 12px;
  color: #61E1FF;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-size: 0.9rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#aiChatSendBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(97, 225, 255, 0.5) 0%, rgba(0, 153, 255, 0.4) 100%);
  box-shadow: 0 5px 15px rgba(97, 225, 255, 0.2);
  transform: translateY(-2px);
}

#aiChatSendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Clear Button */
#aiChatClearBtn {
  padding: 0.875rem 1.25rem;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  color: #FF9090;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

#aiChatClearBtn:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(220, 38, 38, 0.5);
  transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #aiChatModal {
    width: calc(100% - 30px);
    max-height: calc(100vh - 150px);
    bottom: 90px;
    right: 15px;
    left: 15px;
  }

  #aiChatBtn {
    bottom: 30px;
    right: 15px;
  }

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

@media (max-width: 480px) {
  #aiChatModal {
    width: calc(100% - 20px);
    max-height: calc(100vh - 120px);
    bottom: 80px;
    right: 10px;
    left: 10px;
    border-radius: 15px;
  }

  #aiChatBtn {
    width: 55px;
    height: 55px;
    bottom: 25px;
    right: 10px;
    font-size: 1.25rem;
  }

  #aiChatHeader {
    padding: 1.25rem;
  }

  #aiChatHeader h3 {
    font-size: 1rem;
  }

  #aiChatMessages {
    padding: 1rem;
  }

  .message-bubble {
    max-width: 90%;
  }

  #aiChatInputArea {
    flex-direction: column;
    gap: 0.5rem;
  }

  #aiChatSendBtn,
  #aiChatClearBtn {
    width: 100%;
  }
}
