/* LexIA Ecuador — Custom Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --bg-950: #030712;
  --bg-900: #111827;
  --bg-800: #1f2937;
  --bg-700: #374151;
}

* { box-sizing: border-box; }

body { font-family: 'Inter', sans-serif; background: #030712; }

/* GRADIENT TEXT */
.text-gradient {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* SECTION PAGES */
.section-page { display: none; }
.section-page.active { display: block; }

/* NAV BUTTONS */
.nav-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9ca3af;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-btn:hover { color: #f3f4f6; background: #1f2937; }
.nav-btn.active { 
  color: #f59e0b; 
  background: rgba(245,158,11,0.1); 
  border-color: rgba(245,158,11,0.2);
}

.mobile-nav-btn {
  display: block; width: 100%; text-align: left;
  padding: 0.6rem 0.75rem; border-radius: 0.5rem;
  color: #9ca3af; font-size: 0.9rem;
  transition: all 0.2s;
}
.mobile-nav-btn:hover { background: #1f2937; color: #f3f4f6; }

/* BUTTONS */
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #111827;
  font-weight: 700;
  border-radius: 0.875rem;
  padding: 0.65rem 1.5rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover { 
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(245,158,11,0.35);
  filter: brightness(1.1);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: #f59e0b;
  font-weight: 600;
  border-radius: 0.875rem;
  padding: 0.65rem 1.5rem;
  border: 1.5px solid rgba(245,158,11,0.4);
  transition: all 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-secondary:hover { 
  background: rgba(245,158,11,0.1);
  border-color: #f59e0b;
}

/* STAT CARDS */
.stat-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(245,158,11,0.3); }
.stat-number { font-size: 2rem; font-weight: 800; color: #f59e0b; }
.stat-label { font-size: 0.8rem; color: #6b7280; margin-top: 0.25rem; font-weight: 500; }

/* FEATURE CARDS */
.feature-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 1.25rem;
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.25s;
}
.feature-card:hover { 
  border-color: rgba(245,158,11,0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}
.feature-icon {
  width: 3.5rem; height: 3.5rem;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}

/* CATEGORIA CHIPS */
.cat-chip {
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: #1f2937;
  color: #9ca3af;
}
.cat-chip:hover { background: #374151; color: #f3f4f6; }
.cat-chip.active { 
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.4);
  color: #f59e0b;
}

/* EJEMPLO CHIPS */
.ejemplo-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #374151;
  cursor: pointer;
  transition: all 0.2s;
  color: #9ca3af;
  background: transparent;
}
.ejemplo-chip:hover {
  background: #1f2937;
  color: #f3f4f6;
  border-color: #4b5563;
}

/* TYPE BUTTONS */
.tipo-btn {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid #374151;
  color: #6b7280;
  background: #111827;
  cursor: pointer;
  transition: all 0.2s;
}
.tipo-btn.active {
  border-color: rgba(245,158,11,0.5);
  color: #f59e0b;
  background: rgba(245,158,11,0.08);
}

/* LEY CARDS */
.ley-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.2s;
  cursor: pointer;
}
.ley-card:hover {
  border-color: rgba(245,158,11,0.35);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.ley-categoria {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* FORM */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: #9ca3af; }
.form-input {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.625rem;
  padding: 0.65rem 0.9rem;
  color: #f3f4f6;
  font-size: 0.9rem;
  transition: all 0.2s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
.form-input option { background: #1f2937; }

/* CALC TABS */
.calc-tab {
  padding: 0.6rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid #374151;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.calc-tab.active {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.4);
  color: #4ade80;
}

/* RESULTADO ANÁLISIS */
.resultado-box {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 1.25rem;
  padding: 1.75rem;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.markdown-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f59e0b;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #1f2937;
}
.markdown-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
  margin: 1rem 0 0.4rem;
}
.markdown-content ul, .markdown-content ol {
  padding-left: 1.5rem;
  space-y: 0.25rem;
  color: #d1d5db;
  line-height: 1.7;
}
.markdown-content li { margin-bottom: 0.3rem; }
.markdown-content p { color: #d1d5db; line-height: 1.75; margin-bottom: 0.75rem; }
.markdown-content strong { color: #f3f4f6; font-weight: 600; }
.markdown-content code {
  background: #1f2937;
  border-radius: 0.3rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
  color: #fbbf24;
}

/* DESGLOSE RESULTADO */
.desglose-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #1f2937;
  font-size: 0.88rem;
}
.desglose-item:last-child { border-bottom: none; }
.desglose-label { color: #9ca3af; }
.desglose-valor { color: #f3f4f6; font-weight: 600; }
.desglose-total {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}
.desglose-total-label { color: #f59e0b; font-weight: 700; font-size: 0.95rem; }
.desglose-total-valor { color: #f59e0b; font-weight: 800; font-size: 1.5rem; }

/* CHAT */
.chat-msg { display: flex; gap: 0.75rem; animation: slideIn 0.2s ease; }
.chat-msg.usuario { flex-direction: row-reverse; }
.chat-avatar {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.chat-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
}
.chat-msg.juez .chat-bubble {
  background: #1f2937;
  border: 1px solid #374151;
  border-top-left-radius: 0.25rem;
  color: #e5e7eb;
}
.chat-msg.usuario .chat-bubble {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  border-top-right-radius: 0.25rem;
  color: #fef3c7;
}

/* LOADING SPINNER */
.loading-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  animation: bounce 1.2s infinite;
  margin: 0 2px;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* CUSTOM SCROLLBAR */
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: #111827; }
.custom-scroll::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }

/* COLORES POR CATEGORÍA */
.cat-Fundamental { background: rgba(239,68,68,0.15); color: #f87171; }
.cat-Penal { background: rgba(239,68,68,0.12); color: #fca5a5; }
.cat-Civil { background: rgba(59,130,246,0.15); color: #93c5fd; }
.cat-Laboral { background: rgba(34,197,94,0.15); color: #86efac; }
.cat-Familia { background: rgba(236,72,153,0.15); color: #f9a8d4; }
.cat-Administrativo { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.cat-Tributario { background: rgba(245,158,11,0.15); color: #fcd34d; }
.cat-Seguridad { background: rgba(14,165,233,0.15); color: #7dd3fc; }
.cat-Tránsito { background: rgba(234,179,8,0.15); color: #fde047; }
.cat-Ambiental { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.cat-Salud { background: rgba(239,68,68,0.15); color: #fca5a5; }
.cat-Educación { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.cat-default { background: rgba(107,114,128,0.15); color: #9ca3af; }

/* LEYES RELEVANTES BADGE */
.ley-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 0.5rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  color: #f59e0b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.ley-badge:hover {
  background: rgba(245,158,11,0.2);
}

/* ANIMACIÓN ENTRADA */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }

/* COPY BUTTON */
.copy-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: #1f2937;
  border: 1px solid #374151;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: #374151; color: #f3f4f6; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .calc-tab { font-size: 0.75rem; padding: 0.5rem 0.75rem; }
  .btn-primary, .btn-secondary { font-size: 0.9rem; }
}
