/* ==========================================================================
   SHREEYAM AI INTELLIGENT CHATBOT COMPONENT STYLES
   Corporate Branded, Glassmorphic, 3D Elevation & Mobile Optimized
   ========================================================================== */

/* 1. Floating AI Launcher Button */
.shreeyam-ai-launcher {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.shreeyam-ai-launcher:hover {
  transform: translateY(-3px) scale(1.03);
}

.ai-launcher-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #071739 0%, #003a6a 50%, #b50f01 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 10px 30px rgba(7, 23, 57, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.2);
  position: relative;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.ai-launcher-btn::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b50f01, #f59e0b, #15803d, #0284c7);
  z-index: -1;
  opacity: 0.8;
  animation: aiPulseBorder 3s infinite linear;
}
@keyframes aiPulseBorder {
  0% { transform: rotate(0deg); filter: blur(3px); }
  100% { transform: rotate(360deg); filter: blur(3px); }
}

.ai-online-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px #22c55e;
  animation: aiDotPulse 2s infinite;
}
@keyframes aiDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.ai-launcher-badge {
  background: #ffffff;
  color: #0f172a;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 58, 106, 0.12);
  white-space: nowrap;
  pointer-events: none;
  animation: aiBadgeFloat 3s infinite ease-in-out;
}
.ai-launcher-badge i {
  color: #f59e0b;
}
@keyframes aiBadgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 2. Chatbot Window */
.shreeyam-ai-window {
  position: fixed;
  bottom: 100px;
  right: 25px;
  width: 385px;
  max-width: calc(100vw - 30px);
  height: 580px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 20, 50, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(25px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.shreeyam-ai-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.ai-chat-header {
  background: linear-gradient(135deg, #071739 0%, #003a6a 60%, #032b5f 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2.5px solid #15803d;
  position: relative;
  flex-shrink: 0;
}
.ai-chat-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #b50f01, #f59e0b, #15803d, #38bdf8);
}
.ai-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b50f01, #dc2626);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(181, 15, 1, 0.4);
  position: relative;
}
.ai-avatar::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid #003a6a;
}
.ai-header-info h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-header-info p {
  margin: 0;
  font-size: 0.76rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.ai-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}
.ai-header-btn.btn-close:hover {
  background: #ef4444;
}

/* Chat Body */
.ai-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Welcome Card */
.ai-welcome-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}
.ai-welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(21, 128, 61, 0.1);
  color: #15803d;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Message Feed */
.ai-message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ai-message-row.user {
  flex-direction: row-reverse;
}
.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #003a6a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.ai-bubble {
  max-width: 82%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.ai-message-row.bot .ai-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}
.ai-message-row.user .ai-bubble {
  background: linear-gradient(135deg, #071739 0%, #003a6a 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(7, 23, 57, 0.25);
}
.ai-msg-time {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
  text-align: right;
}
.ai-message-row.bot .ai-msg-time {
  text-align: left;
}

/* Quick Suggestion Chips */
.ai-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ai-chip-btn {
  background: #ffffff;
  color: #003a6a;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.ai-chip-btn:hover {
  background: #f0fdf4;
  border-color: #15803d;
  color: #15803d;
  transform: translateY(-1px);
}

/* Typing Indicator */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: #ffffff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
  width: fit-content;
}
.ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: aiTypingBounce 1.4s infinite ease-in-out;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiTypingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Chat Footer Input Area */
.ai-chat-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.ai-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.ai-input-field {
  flex: 1;
  height: 42px;
  padding: 8px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 25px;
  font-size: 0.88rem;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}
.ai-input-field:focus {
  border-color: #15803d;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}
.ai-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b50f01 0%, #dc2626 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(181, 15, 1, 0.35);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.ai-send-btn:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
  transform: scale(1.05);
}
.ai-footer-note {
  font-size: 0.68rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Mobile Responsiveness for AI Chat Window */
@media (max-width: 640px) {
  .shreeyam-ai-launcher {
    bottom: 20px;
    right: 20px;
  }
  .ai-launcher-btn {
    width: 54px;
    height: 54px;
    font-size: 1.35rem;
  }
  .ai-launcher-badge {
    display: none !important;
  }
  .shreeyam-ai-window {
    width: 100% !important;
    max-width: 100% !important;
    height: 90vh !important;
    height: 90dvh !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 20px 20px 0 0 !important;
  }
}
