/* ===== Chatbot Component Styles ===== */
/* Reusable chatbot styling for any page */

/* Chat Card Container (inline - used in CEO Cockpit) */
.chat-card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
  max-height: 600px;
}

/* Chat Container (floating popup - used in Sales Sandra) */
.chat-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 450px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: 600px;
}

.chat-container.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Adjust header margin for floating container */
.chat-container .chat-header {
  margin: 0 0 16px 0;
  border-radius: 12px 12px 0 0;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(16, 185, 129, 0.3));
  border: 2px solid #3b82f6;
  border-radius: 12px 12px 0 0;
  padding: 16px 20px;
  margin: -24px -24px 16px -24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-icon {
  font-size: 24px;
  color: white;
}

.chat-header-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin: 0;
}

.chat-header-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-left: auto;
}

/* Chat Thread */
.chat-thread {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  max-height: 400px;
  min-height: 300px;
}

/* Message Bubbles */
.message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  clear: both;
}

.message.assistant {
  align-items: flex-start;
}

.message.user {
  align-items: flex-end;
}

.message.assistant .bubble {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  max-width: 80%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.5;
}

.message.user .bubble {
  background: linear-gradient(135deg, rgba(211, 47, 47, 0.15), rgba(211, 47, 47, 0.1)) !important;
  border: 1px solid rgba(211, 47, 47, 0.3) !important;
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  max-width: 80%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.5;
}

/* Suggestion Bubbles */
.suggestion-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  padding: 0 16px;
  flex-shrink: 0;
  max-height: 80px;
  overflow-y: auto;
}

.suggestion-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--info);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.suggestion-bubble:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.suggestion-bubble .icon {
  font-size: 12px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px 16px 16px 4px;
  max-width: 60px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--info);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input Area */
.chat-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input:focus {
  outline: none;
  border-color: var(--info);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-send {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand-primary), #c62828);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.btn-send:hover {
  background: linear-gradient(135deg, var(--brand-hover), var(--brand-primary));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

.btn-send:active {
  transform: translateY(0);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Scrollbar Styling for Chat Thread */
.chat-thread::-webkit-scrollbar {
  width: 6px;
}

.chat-thread::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.chat-thread::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}

.chat-thread::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Sandra Metrics */
.sandra-metric {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.sandra-metric:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.sandra-metric .fa-info-circle {
  opacity: 0.6;
  transition: all 0.2s;
}

.sandra-metric:hover .fa-info-circle {
  opacity: 1;
  color: var(--info);
}

/* Feature Cards */
.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.feature-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-learn-more {
  font-size: 0.875rem;
  color: var(--info);
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.feature-card:hover .feature-learn-more {
  opacity: 1;
}

/* Static Metrics Panel (Sidebar) */
.sandra-metrics-panel-static {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 100px;
  height: fit-content;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.sandra-metrics-panel-static h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Floating Metrics Panel (for chat popup - deprecated) */
.sandra-metrics-panel {
  position: fixed;
  bottom: 120px;
  right: 500px;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  transform: translateX(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}

.sandra-metrics-panel.active {
  transform: translateX(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.sandra-metrics-panel h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sandra-metric-item {
  margin-bottom: 1rem;
}

.sandra-metric-item:last-child {
  margin-bottom: 0;
}

.sandra-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sandra-metric-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sandra-metric-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Progress Bar */
.sandra-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.sandra-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), rgba(59, 130, 246, 0.8));
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Visitor Status Badge */
.visitor-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.visitor-status-badge.new {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.visitor-status-badge.returning {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.visitor-status-badge.vip {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}
