/* ============================================
   COMPONENTS.CSS — Extra UI Components
   ============================================ */

/* ══════════════════════════════════════
   CHAT DEMO COMPONENT
   ══════════════════════════════════════ */
.chat-demo {
  background: var(--bg-card2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto;
  font-size: .85rem;
  box-shadow: var(--shadow-card);
}

.chat-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: ping 1.8s ease infinite;
}

.chat-header-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-sub {
  font-size: .72rem;
  color: var(--text-muted);
}

.chat-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-msg.user { flex-direction: row-reverse; }

.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
}

.chat-avatar.ai {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.chat-avatar.user-av {
  background: rgba(244,114,182,.2);
  color: #f9a8d4;
  border: 1px solid rgba(244,114,182,.25);
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.chat-msg.ai .chat-bubble {
  background: rgba(108,99,255,.12);
  border: 1px solid rgba(108,99,255,.18);
  border-bottom-left-radius: 4px;
  color: var(--text-secondary);
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-footer {
  border-top: 1px solid var(--border-light);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input-fake {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: .82rem;
}

.chat-send-btn {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover { opacity: .85; transform: scale(.96); }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
}

.typing-dot {
  width: 7px; height: 7px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: typing-anim 1.2s ease infinite;
  opacity: .6;
}

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

@keyframes typing-anim {
  0%,100% { transform: translateY(0); opacity: .6; }
  50%      { transform: translateY(-5px); opacity: 1; }
}


/* ══════════════════════════════════════
   STAT COUNTER CARDS
   ══════════════════════════════════════ */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(108,99,255,.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.stat-card-icon {
  font-size: 1.5rem;
  color: var(--primary-light);
  margin-bottom: 10px;
  opacity: .8;
}

.stat-card-num {
  font-family: var(--font-alt);
  font-size: 1.85rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label {
  font-size: .8rem;
  color: var(--text-muted);
}


/* ══════════════════════════════════════
   HIGHLIGHT RIBBON
   ══════════════════════════════════════ */
.highlight-ribbon {
  background: linear-gradient(90deg, rgba(108,99,255,.12) 0%, rgba(6,182,212,.12) 100%);
  border-top: 1px solid rgba(108,99,255,.18);
  border-bottom: 1px solid rgba(108,99,255,.18);
  padding: 16px 0;
  overflow: hidden;
}

.ribbon-track {
  display: flex;
  gap: 48px;
  animation: scroll-brands 18s linear infinite;
  width: max-content;
}

.ribbon-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ribbon-item i { color: var(--primary-light); }
.ribbon-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: .5;
}


/* ══════════════════════════════════════
   TOOLTIP
   ══════════════════════════════════════ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.9);
  background: var(--bg-card2);
  color: var(--text-primary);
  font-size: .75rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all .2s ease;
  z-index: 10;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}


/* ══════════════════════════════════════
   NOTIFICATION TOAST (Demo)
   ══════════════════════════════════════ */
.toast-demo {
  position: relative;
  width: 280px;
  background: var(--bg-card2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.toast-icon {
  width: 34px; height: 34px;
  background: rgba(16,185,129,.15);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  font-size: .9rem;
  flex-shrink: 0;
}

.toast-content p { font-size: .82rem; color: var(--text-primary); font-weight: 500; }
.toast-content span { font-size: .75rem; color: var(--text-muted); }


/* ══════════════════════════════════════
   FLOATING CARD ANIMATIONS
   ══════════════════════════════════════ */
.float-slow {
  animation: float-slow 6s ease-in-out infinite;
}
.float-medium {
  animation: float-slow 4.5s ease-in-out infinite .8s;
}

@keyframes float-slow {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}


/* ══════════════════════════════════════
   RESPONSIVE — COMPONENTS
   ══════════════════════════════════════ */
@media (max-width: 900px) {
  .stat-cards-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stat-cards-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .chat-demo { font-size: .8rem; }
}

@media (max-width: 280px) {
  .stat-cards-row { grid-template-columns: 1fr; }
  .toast-demo { width: 100%; }
}
