/* styles.css - FonoAgent AI Suite Clínica */

/* ==================== VARIABLES DE TEMAS ==================== */
:root, [data-theme="teal"] {
  --brand-50: #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-200: #99f6e4;
  --brand-300: #5eead4;
  --brand-400: #2dd4bf;
  --brand-500: #14b8a6;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --brand-800: #115e59;
  --brand-900: #134e4a;
  --surface-main: #f8fafc;
  --surface-card: #ffffff;
  --surface-border: #e2e8f0;
  --content-main: #0f172a;
  --content-muted: #64748b;
  --theme-icon: "🩺";
  --theme-name: "Verde Clínico";
}

[data-theme="dark"] {
  --brand-50: #042f2e;
  --brand-100: #134e4a;
  --brand-200: #115e59;
  --brand-300: #0f766e;
  --brand-400: #0d9488;
  --brand-500: #14b8a6;
  --brand-600: #2dd4bf;
  --brand-700: #5eead4;
  --brand-800: #99f6e4;
  --brand-900: #ccfbf1;
  --surface-main: #0b1120;
  --surface-card: #1e293b;
  --surface-border: #334155;
  --content-main: #f8fafc;
  --content-muted: #94a3b8;
  --theme-icon: "🌙";
  --theme-name: "Modo Oscuro";
}

[data-theme="pediatric"] {
  --brand-50: #faf5ff;
  --brand-100: #f3e8ff;
  --brand-200: #e9d5ff;
  --brand-300: #d8b4fe;
  --brand-400: #c084fc;
  --brand-500: #a855f7;
  --brand-600: #9333ea;
  --brand-700: #7e22ce;
  --brand-800: #6b21a8;
  --brand-900: #581c87;
  --surface-main: #fdfaff;
  --surface-card: #ffffff;
  --surface-border: #f5d0fe;
  --content-main: #3b0764;
  --content-muted: #7e22ce;
  --theme-icon: "🧸";
  --theme-name: "Pediátrico / Lúdico";
}

[data-theme="blue"] {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;
  --surface-main: #f8fafc;
  --surface-card: #ffffff;
  --surface-border: #dbeafe;
  --content-main: #0f172a;
  --content-muted: #64748b;
  --theme-icon: "🏥";
  --theme-name: "Azul Médico";
}

/* ==================== APLICACIÓN GLOBAL ==================== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--surface-main);
  color: var(--content-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.font-heading {
  font-family: 'Outfit', 'Inter', sans-serif;
}

/* ==================== ESTILOS MODO OSCURO ==================== */
[data-theme="dark"] body {
  background-color: #0b1120 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .bg-white {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] header.bg-white {
  background-color: #111827 !important;
  border-color: #1f2937 !important;
}

[data-theme="dark"] .bg-slate-50,
[data-theme="dark"] .bg-slate-50\/50,
[data-theme="dark"] .bg-slate-50\/60,
[data-theme="dark"] .bg-slate-50\/70,
[data-theme="dark"] .bg-slate-100,
[data-theme="dark"] .bg-slate-100\/90 {
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-slate-200\/60,
[data-theme="dark"] .border-slate-200\/80,
[data-theme="dark"] .border-slate-300 {
  border-color: #334155 !important;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: #2dd4bf !important;
}

[data-theme="dark"] .text-slate-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-700 {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500 {
  color: #94a3b8 !important;
}

[data-theme="dark"] .tab-btn {
  color: #94a3b8;
}

[data-theme="dark"] .tab-btn:hover {
  background-color: #1e293b !important;
  color: #2dd4bf !important;
}

[data-theme="dark"] .tab-btn.active {
  background-color: #042f2e !important;
  color: #2dd4bf !important;
}

[data-theme="dark"] dialog {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}

[data-theme="dark"] #themeDropdownMenu {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
}

[data-theme="dark"] #themeDropdownMenu button {
  color: #e2e8f0 !important;
}

[data-theme="dark"] #themeDropdownMenu button:hover {
  background-color: #334155 !important;
}

[data-theme="dark"] .prose table th {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .prose table td {
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .prose blockquote {
  background-color: #042f2e !important;
  color: #ccfbf1 !important;
}

/* ==================== ESTILOS MODO PEDIÁTRICO ==================== */
[data-theme="pediatric"] {
  font-family: 'Outfit', 'Inter', sans-serif !important;
}

[data-theme="pediatric"] .rounded-2xl {
  border-radius: 1.5rem !important;
}

[data-theme="pediatric"] .tab-btn.active {
  background-color: #faf5ff !important;
  color: #7e22ce !important;
}

/* ==================== ESTILOS MODO AZUL MÉDICO ==================== */
[data-theme="blue"] .tab-btn.active {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}

/* ==================== SCROLLBAR ESTILIZADA ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #475569;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==================== MENÚ DROPDOWN DE TEMAS ==================== */
#themeDropdownMenu {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ==================== BURBUJAS DE MENSAJE ==================== */
.message-bubble {
  animation: fadeInBubble 0.25s ease-out forwards;
}

@keyframes fadeInBubble {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== PROSE / MARKDOWN ==================== */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}
.prose table th,
.prose table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.prose table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #1e293b;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: inherit;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.prose ul {
  list-style-type: disc;
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.prose blockquote {
  border-left: 4px solid var(--brand-600);
  padding-left: 0.75rem;
  color: inherit;
  background-color: var(--brand-50);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  margin: 0.75rem 0;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* ==================== MODALES HTML5 DIALOG ==================== */
dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

dialog[open] {
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==================== GRABACIÓN DE VOZ ==================== */
.recording-active {
  color: #ef4444 !important;
  animation: pulseRecording 1s infinite;
}

@keyframes pulseRecording {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ==================== IMPRESIÓN FORMAL ==================== */
@media print {
  .no-print, header, nav, button, form, aside, #themeDropdownMenu {
    display: none !important;
  }
  
  body, main {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    color: black !important;
  }

  #tab-evaluations {
    display: block !important;
  }

  .lg\\:col-span-7 {
    display: none !important;
  }

  .lg\\:col-span-5 {
    width: 100% !important;
    display: block !important;
  }

  .printable-report {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    color: black !important;
  }

  .printable-report h1 {
    font-size: 18pt !important;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
    margin-bottom: 12px;
  }

  .printable-report h2 {
    font-size: 13pt !important;
    margin-top: 14pt !important;
  }
}
