/* ============================================================
   PRAXIA CHATBOT - Estilos Globales
   ============================================================ */

:root {
  /* Paleta Vichy (grises + teal) */
  --primary: #05ad98;
  --primary-dark: #048a79;
  --primary-light: rgba(5, 173, 152, 0.16);
  --primary-rgb: 5, 173, 152;

  --secondary: #bbbfbf;
  --secondary-dark: #878787;
  --secondary-light: rgba(187, 191, 191, 0.16);
  --secondary-rgb: 187, 191, 191;

  --accent: #878787;
  --accent-rgb: 135, 135, 135;
  /* Neutrales (dark-only) */
  color-scheme: dark;
  --bg: #0b0f10;
  --bg-white: #0f1416;
  --surface: #0f1416;
  --surface-2: #121a1c;
  --surface-glass: rgba(18, 26, 28, 0.72);
  --sidebar-bg: #0b1514;
  --sidebar-text: rgba(229,231,235,0.78);
  --sidebar-active: rgba(var(--secondary-rgb), 0.20);
  --text-primary: #e5e7eb;
  --text-secondary: #b6c0cf;
  --text-muted: #8b95a6;
  --border: rgba(255,255,255,0.10);
  --border-light: rgba(255,255,255,0.06);
  /* Minimal */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 22px rgba(0,0,0,0.42);
  --shadow-lg: 0 14px 44px rgba(0,0,0,0.48);
  --shadow-xl: 0 22px 70px rgba(0,0,0,0.55);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --font: "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --dur-1: 140ms;
  --dur-2: 220ms;
  --dur-3: 360ms;
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --ring: 0 0 0 4px rgba(var(--primary-rgb), 0.28);
  --page-header-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  letter-spacing: -0.01em;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

body {
  font-family: var(--font);
  background:
    radial-gradient(900px 520px at 80% 0%, rgba(var(--primary-rgb), 0.10) 0%, rgba(var(--primary-rgb), 0) 55%),
    var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Focus accesible (teclado) ---- */
a:focus-visible,
button:focus-visible,
textarea:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ---- Utilidades ---- */
.hidden {
  display: none !important;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0px) scale(0.99);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.28);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border-light);
}

.btn-success {
  background: var(--primary);
  color: white;
}
.btn-success:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}
.btn-success:active:not(:disabled) {
  transform: translateY(0px) scale(0.99);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.28);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--secondary-light); color: var(--secondary); }

/* ---- Spinner ---- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success { border-color: var(--secondary); }
.toast.error { border-color: var(--accent); }
.toast-icon { font-size: 1.1rem; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.97); }
}

/* ---- Typing dots ---- */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  html { font-size: 14px; }
}
