@import "tailwindcss";

@theme inline {
  --color-background: #f9fafb;
  --color-foreground: #111827;
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
}

body {
  background: #f9fafb;
  color: #111827;
  font-family: Arial, Helvetica, sans-serif;
}

/* ============================================
   DARK MODE - Sistema completo
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Base */
  html, body {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
  }

  /* Main content area */
  main {
    background-color: #0f172a !important;
  }

  /* ALL white backgrounds → slate-800 */
  *[class*="bg-white"] {
    background-color: #1e293b !important;
  }

  /* ALL gray-50 backgrounds → slate-900 */
  *[class*="bg-gray-50"] {
    background-color: #0f172a !important;
  }

  *[class*="bg-gray-100"] {
    background-color: #1e293b !important;
  }

  /* Borders */
  *[class*="border-gray-200"],
  *[class*="border-gray-300"],
  *[class*="border-gray-100"] {
    border-color: #334155 !important;
  }

  /* Text: dark → light */
  *[class*="text-gray-900"],
  *[class*="text-gray-800"] {
    color: #f1f5f9 !important;
  }

  *[class*="text-gray-700"],
  *[class*="text-gray-600"] {
    color: #cbd5e1 !important;
  }

  *[class*="text-gray-500"],
  *[class*="text-gray-400"] {
    color: #94a3b8 !important;
  }

  /* Dividers */
  *[class*="divide-gray"] > * + * {
    border-color: #334155 !important;
  }

  /* Inputs, selects, textareas */
  input, select, textarea {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
  }

  input::placeholder, textarea::placeholder {
    color: #64748b !important;
  }

  /* Tables */
  table {
    background-color: #1e293b !important;
  }

  thead {
    background-color: #1e293b !important;
  }

  tbody tr {
    background-color: #1e293b !important;
  }

  tbody tr:hover {
    background-color: #334155 !important;
  }

  /* Code */
  code {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
  }

  /* Cards and panels - catch all */
  .rounded-xl, .rounded-2xl, .rounded-lg {
    background-color: #1e293b;
  }

  /* Hover states */
  *[class*="hover\:bg-gray"]:hover {
    background-color: #334155 !important;
  }

  /* Shadows for dark mode */
  *[class*="shadow"] {
    --tw-shadow-color: rgba(0, 0, 0, 0.3);
  }
}

/* Light mode inputs (explicit) */
@media (prefers-color-scheme: light) {
  input, select, textarea {
    background-color: #ffffff;
    color: #111827;
    border-color: #d1d5db;
  }

  input::placeholder, textarea::placeholder {
    color: #9ca3af;
  }
}
