/* ═══════════════════════════════════════════
   IngenisLab — Custom Styles
   (Complementa Tailwind con efectos que no
   puede generar puramente via utilidades)
═══════════════════════════════════════════ */

/* ── Scrollbar invisible ── */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Safe area (notch móvil) ── */
.safe-top    { padding-top: env(safe-area-inset-top, 0); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }

/* ── Glass card ── */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 1); /* slate-200 */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ── Guild tab states ── */
.guild-tab {
  color: #64748b; /* slate-500 */
  background: transparent;
  border: 1px solid transparent;
}
.guild-tab:hover {
  color: #334155; /* slate-700 */
  background: rgba(241, 245, 249, 1); /* slate-100 */
}
.guild-tab.active[data-guild="acero"] {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.30);
  color: #475569;
}
.guild-tab.active[data-guild="aluminio"] {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.30);
  color: #2563eb;
}
.guild-tab.active[data-guild="madera"] {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.30);
  color: #b45309;
}

/* ── Mode button states ── */
.mode-btn {
  color: #6b7280;
}
.mode-btn.active {
  background: #6366f1;
  color: white;
  box-shadow: 0 0 12px rgba(99,102,241,0.4);
}

/* ── Viewer min-height (responsive) ── */
.viewer-min-h { min-height: 280px; }
@media (min-width: 640px)  { .viewer-min-h { min-height: 340px; } }
@media (min-width: 1024px) { .viewer-min-h { min-height: 480px; } }

/* ── Form inputs ── */
.ferr-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1; /* slate-300 */
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  color: #0f172a; /* slate-900 */
  font-size: 0.875rem;
  transition: all 0.15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.ferr-input:focus {
  border-color: #2563eb; /* blue-600 */
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ferr-input::placeholder { color: #94a3b8; }
.ferr-input option {
  background: #ffffff;
  color: #0f172a;
}

.ferr-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569; /* slate-600 */
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.ferr-field { display: flex; flex-direction: column; }

/* ── Chat bubbles ── */
.chat-scroll { scroll-behavior: smooth; }

.bubble-bot {
  align-self: flex-start;
  background: #f8fafc; /* slate-50 */
  border: 1px solid #e2e8f0; /* slate-200 */
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  max-width: 82%;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #1e293b; /* slate-800 */
  animation: pop-in 0.25s ease;
}
.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #3b82f6); /* blue-600 to blue-500 */
  border-radius: 16px 4px 16px 16px;
  padding: 10px 14px;
  max-width: 72%;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: white;
  animation: pop-in 0.25s ease;
}
.bubble-typing span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  margin: 0 1px;
  animation: bounce-dot 1.2s infinite ease-in-out;
}
.bubble-typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble-typing span:nth-child(3) { animation-delay: 0.30s; }

.quick-reply-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 100px;
  background: #eff6ff; /* blue-50 */
  border: 1px solid #bfdbfe; /* blue-200 */
  color: #1d4ed8; /* blue-700 */
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.quick-reply-chip:hover,
.quick-reply-chip:active {
  background: #2563eb;
  color: white;
  transform: scale(0.97);
}

/* ── Results table ── */
.results-tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.75rem;
}
.results-tbl thead th {
  background: #f1f5f9; /* slate-100 */
  color: #475569; /* slate-600 */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.results-tbl tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.1s;
}
.results-tbl tbody tr:hover { background: #f8fafc; }
.results-tbl tbody td {
  padding: 9px 12px;
  color: #334155; /* slate-700 */
  vertical-align: top;
}
.results-tbl tbody td:first-child { font-family: 'JetBrains Mono', monospace; color: #2563eb; }
.results-tbl tbody td.qty-cell { color: #0f172a; font-weight: 600; }

/* ── Info / Summary cards ── */
.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .val { font-size: 1.125rem; font-weight: 700; color: #0f172a; }
.stat-card .lbl { font-size: 0.7rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Warning chip ── */
.warn-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fffbeb; /* amber-50 */
  border: 1px solid #fde68a; /* amber-200 */
  color: #b45309; /* amber-700 */
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ── 3D Info cards ── */
.info-card-3d {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
}
.info-card-3d .ict { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 4px; }
.info-card-3d .icv { font-size: 0.875rem; font-weight: 600; color: #0f172a; }

/* ── Animations ── */
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.animate-slide-up { animation: slide-up 0.3s ease; }
.animate-spin { animation: spin 0.8s linear infinite; }

/* ── Toast ── */
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  animation: slide-up 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 320px;
}
.toast.success { background: #ffffff; color: #166534; border-color: #86efac; }
.toast.error   { background: #ffffff; color: #991b1b; border-color: #fca5a5; }
.toast.info    { background: #ffffff; color: #1e40af; border-color: #93c5fd; }

/* ── Gradient text ── */
.grad-text {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Selection override ── */
::selection { background: rgba(99,102,241,0.3); }
