/* ==========================================================================
   MIDAP — Reusable Components
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-base);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px) scale(1.02); }
.btn:active { transform: translateY(0) scale(0.99); }

.btn-primary {
  background: var(--color-primary);
  color: #06210F;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-dark); color: #06210F; box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-outline:hover { background: var(--color-primary-light); border-color: var(--color-primary); color: var(--color-text); }

/* white-outline variant for dark sections */
.btn-outline--invert {
  background: transparent;
  color: var(--color-text-invert);
  border-color: var(--color-border-dark);
}
.btn-outline--invert:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); color: var(--color-text-invert); }

.btn-sm { padding: 10px 20px; font-size: var(--fs-small); }
.btn-block { width: 100%; }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

/* ---------- Badge / pill ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-primary-darker);
}
.badge--dark { background: rgba(37,211,102,0.15); color: var(--color-primary); }

/* ---------- Card ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary-darker);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.card-icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: var(--space-2); }
.card p { margin-bottom: 0; font-size: 0.95rem; }

/* ---------- Grids ---------- */
.grid {
  display: grid;
  gap: var(--space-6);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 991px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Stat block ---------- */
.stat { text-align: center; }
.stat .stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text);
  display: block;
}
.stat .stat-label { font-size: var(--fs-small); color: var(--color-text-faint); font-weight: 500; }
.section--dark .stat .stat-num { color: var(--color-text-invert); }
.section--dark .stat .stat-label { color: rgba(255,255,255,0.6); }

/* ---------- Logo strip ---------- */
.logo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-7);
  opacity: 0.7;
}
.logo-strip img { height: 28px; width: auto; filter: grayscale(100%); transition: filter var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease); }
.logo-strip img:hover { filter: grayscale(0%); opacity: 1; }

@media (max-width: 768px) {
  .logo-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .logo-strip::-webkit-scrollbar { display: none; }
}

/* ---------- Chat mockup (hero / feature visuals) ---------- */
.chat-mock {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  max-width: 380px;
}
.chat-mock__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.chat-mock__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  color: #06210F; font-weight: 700; font-size: 0.85rem;
}
.chat-mock__name { font-weight: 600; font-size: 0.9rem; }
.chat-mock__status { font-size: 0.75rem; color: var(--color-primary-darker); }

.chat-bubble {
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  margin-bottom: var(--space-3);
  max-width: 85%;
  opacity: 0;
  transform: translateY(8px);
  animation: bubbleIn 0.5s var(--ease) forwards;
}
.chat-bubble--out {
  background: var(--color-primary-light);
  margin-left: auto;
}
.chat-bubble--tick { color: var(--color-primary-darker); font-weight: 600; font-size: 0.75rem; margin-top: var(--space-2); }

@keyframes bubbleIn {
  to { opacity: 1; transform: translateY(0); }
}

.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-text-faint);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
