/* AI Assistant Widget - Silicon Valley Style */

:root {
  --ai-primary: #E85D04;
  --ai-bg: rgba(22, 22, 23, 0.95);
  --ai-glass: rgba(255, 255, 255, 0.05);
  --ai-text: #F5F5F7;
  --ai-text-sec: #86868b;
  --ai-radius: 20px;
  --ai-msg-radius: 18px;
}

/* Floating Action Button (FAB) */
.ai-fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: var(--ai-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(232, 93, 4, 0.3);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(232, 93, 4, 0.4);
}

.ai-fab i {
  color: white;
  font-size: 24px;
  transition: transform 0.3s ease;
}

.ai-fab.active i {
  transform: rotate(0deg);
  /* Reset rotation */
}

/* Chat Window */
.ai-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  height: 600px;
  max-width: calc(100vw - 40px);
  max-height: calc(80vh - 120px);
  background: var(--ai-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--ai-radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ai-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.ai-header {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 15px;
}

.ai-avatar {
  width: 40px;
  height: 40px;
  background-image: url('ai-avatar.png');
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(232, 93, 4, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ai-avatar::after {
  content: '';
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #161617;
  /* Match bg card color */
}

/* Hide the icon since we have an image */
.ai-avatar i {
  display: none;
}

.ai-info h4 {
  font-size: 16px;
  color: #fff;
  margin: 0;
}

.ai-info p {
  font-size: 12px;
  color: var(--ai-text-sec);
  margin: 2px 0 0;
}

/* Chat Body */
.ai-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Scrollbar */
.ai-body::-webkit-scrollbar {
  width: 6px;
}

.ai-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Messages */
.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideIn 0.3s ease;
}

.ai-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px var(--ai-msg-radius) var(--ai-msg-radius) var(--ai-msg-radius);
  color: var(--ai-text);
}

.ai-msg.user {
  align-self: flex-end;
  background: var(--ai-primary);
  border-radius: var(--ai-msg-radius) 2px var(--ai-msg-radius) var(--ai-msg-radius);
  color: #fff;
}

/* Options (Chips) */
.ai-options {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-top: 5px;
}

.ai-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ai-text);
  padding: 10px 20px;
  border-radius: 20px 5px 20px 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  max-width: 90%;
}

.ai-chip:hover {
  background: rgba(232, 93, 4, 0.2);
  border-color: var(--ai-primary);
  color: #fff;
}

/* Typing Indicator */
.ai-typing {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 15px;
  border-radius: 20px;
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.ai-dot {
  width: 6px;
  height: 6px;
  background: #888;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.ai-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.ai-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Input Area */
#ai-input-area input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px;
  font-size: 14px;
  outline: none;
}

#ai-input-area button {
  background: var(--ai-primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

#ai-input-area button:hover {
  transform: scale(1.1);
}

/* Mobile */
@media (max-width: 480px) {
  .ai-window {
    width: 100%;
    height: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}