@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* Tipografía Oficial Corporación Mawizako: Berlin Sans FB */
@font-face {
  font-family: 'Berlin Sans FB';
  src: url('../fonts/BerlinSansFB-Regular.ttf') format('truetype');
  font-weight: normal;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Berlin Sans FB';
  src: url('../fonts/BerlinSansFB-Bold.ttf') format('truetype');
  font-weight: bold;
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --mawiza-berry: #784352;
  --mawiza-forest: #4E856A;
  --mawiza-cream: #FCF7E3;
  --mawiza-cream-light: #FFFCF2;
  --mawiza-water: #07B7BF;
  --mawiza-sprout: #8EB734;
  --mawiza-dark: #1E293B;
  --mawiza-gray: #475569;
}

body, html, input, button, select, textarea {
  font-family: 'Berlin Sans FB', 'Jost', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--mawiza-cream);
  color: var(--mawiza-dark);
  margin: 0;
  padding: 0;
  line-height: 1.7;
}

/* Párrafos principales: Aumento de tamaño a 1.125rem para legibilidad óptima */
p {
  font-size: 1.125rem;
  line-height: 1.75;
}

/* Párrafos con clase text-base explícita elevados a 1.125rem */
p.text-base,
.text-body {
  font-size: 1.125rem !important;
  line-height: 1.75 !important;
}

/* Accesibilidad visual: Mayor separación entre caracteres en negrita para personas con dificultades visuales */
strong,
b {
  letter-spacing: 0.04em !important;
}

.font-bold,
.font-semibold,
.font-extrabold {
  letter-spacing: 0.03em;
}

p strong,
p b,
p .font-bold,
p .font-semibold,
li strong,
li b {
  letter-spacing: 0.045em !important;
}

h1, h2, h3, h4, h5, h6, .font-brand, .font-sans {
  font-family: 'Berlin Sans FB', 'Jost', sans-serif !important;
}

/* Custom Mawizako color helpers */
.bg-mawiza-cream { background-color: var(--mawiza-cream); }
.bg-mawiza-cream-light { background-color: var(--mawiza-cream-light); }
.bg-mawiza-berry { background-color: var(--mawiza-berry); }
.bg-mawiza-forest { background-color: var(--mawiza-forest); }
.bg-mawiza-water { background-color: var(--mawiza-water); }
.bg-mawiza-sprout { background-color: var(--mawiza-sprout); }

.text-mawiza-berry { color: var(--mawiza-berry); }
.text-mawiza-forest { color: var(--mawiza-forest); }
.text-mawiza-water { color: var(--mawiza-water); }
.text-mawiza-dark { color: var(--mawiza-dark); }
.text-mawiza-cream { color: var(--mawiza-cream); }

.border-mawiza-berry { border-color: var(--mawiza-berry); }
.border-mawiza-forest { border-color: var(--mawiza-forest); }
.border-mawiza-water { border-color: var(--mawiza-water); }
.border-mawiza-cream { border-color: var(--mawiza-cream); }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--mawiza-berry);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  font-weight: 500;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(120, 67, 82, 0.2);
}

.btn-primary:hover {
  background-color: #633642;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(120, 67, 82, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--mawiza-forest);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  font-weight: 500;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(78, 133, 106, 0.2);
}

.btn-secondary:hover {
  background-color: #3e6d56;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(78, 133, 106, 0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--mawiza-berry);
  color: var(--mawiza-berry);
  padding: 0.7rem 1.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
  background: transparent;
}

.btn-outline:hover {
  background-color: var(--mawiza-berry);
  color: #ffffff;
}

/* Card hover animation */
.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(30, 41, 59, 0.12);
}

/* Water wave & nature patterns */
.topo-pattern {
  background-color: #FCF7E3;
  background-image: radial-gradient(#4e856a 0.65px, transparent 0.65px), radial-gradient(#784352 0.65px, #FCF7E3 0.65px);
  background-size: 26px 26px;
  background-position: 0 0, 13px 13px;
  background-opacity: 0.08;
}

/* Status badge */
.badge-pilot {
  background-color: #E6F4EA;
  color: #137333;
  border: 1px solid #CEEAD6;
}

.badge-active {
  background-color: #E8F0FE;
  color: #1A73E8;
  border: 1px solid #D2E3FC;
}

.badge-strategy {
  background-color: #FEF7E0;
  color: #B06000;
  border: 1px solid #FEEFC3;
}

/* ==========================================================
   MODO OSCURO / MODO NOCTURNO (Auto noche + Sistema + Botón)
   ========================================================== */
html.dark {
  --mawiza-berry: #c5768b;
  --mawiza-forest: #5fa583;
  --mawiza-cream: #0c121d;
  --mawiza-cream-light: #151f2e;
  --mawiza-water: #1bd5df;
  --mawiza-sprout: #a3d43b;
  --mawiza-dark: #f8fafc;
  --mawiza-gray: #94a3b8;
  color-scheme: dark;
}

html.dark body {
  background-color: #0c121d !important;
  color: #f1f5f9 !important;
}

/* Cabecera y Navegación */
html.dark header {
  background-color: rgba(12, 18, 29, 0.95) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark #mobile-menu {
  background-color: #151f2e !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* Fondos temáticos */
html.dark .bg-mawiza-cream {
  background-color: #0c121d !important;
}

html.dark .bg-mawiza-cream-light {
  background-color: #151f2e !important;
}

html.dark .bg-white,
html.dark [class*="bg-white/"],
html.dark [class*="bg-white"] {
  background-color: #162030 !important;
}

html.dark [class*="FCF7E3"],
html.dark [class*="FFFCF2"],
html.dark [class*="F3E7D2"] {
  background-color: #141f2d !important;
}

html.dark [class*="from-[#FCF7E3]"] {
  --tw-gradient-from: #0c121d var(--tw-gradient-from-position) !important;
  --tw-gradient-to: #141f2d var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), #0c121d var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

html.dark [class*="from-white"] {
  --tw-gradient-from: #111927 var(--tw-gradient-from-position) !important;
}

html.dark [class*="to-white"] {
  --tw-gradient-to: #111927 var(--tw-gradient-to-position) !important;
}

html.dark .bg-gray-50,
html.dark .bg-slate-50 {
  background-color: #101824 !important;
}

html.dark .bg-gray-100 {
  background-color: #1b2636 !important;
}

html.dark .bg-amber-50 {
  background-color: #241d13 !important;
}

/* Bordes y separadores */
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 {
  border-color: #27364b !important;
}

html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #27364b !important;
}

/* Textos legibles y contrastados */
html.dark .text-mawiza-dark {
  color: #f1f5f9 !important;
}

html.dark .text-gray-900,
html.dark .text-gray-800 {
  color: #f8fafc !important;
}

html.dark .text-gray-700 {
  color: #cbd5e1 !important;
}

html.dark .text-gray-600 {
  color: #94a3b8 !important;
}

html.dark .text-gray-500 {
  color: #94a3b8 !important;
}

/* Inputs, Selects y Textareas en Formularios y Filtros */
html.dark input,
html.dark select,
html.dark textarea {
  background-color: #111a26 !important;
  border-color: #2d3e56 !important;
  color: #f1f5f9 !important;
}

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

html.dark select option {
  background-color: #151f2e !important;
  color: #f1f5f9 !important;
}

/* Sombras en modo oscuro */
html.dark .shadow-sm,
html.dark .shadow-md,
html.dark .shadow-lg,
html.dark .shadow-xl {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45) !important;
}

html.dark .card-hover:hover {
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.6) !important;
}

/* Patrón topográfico sutil nocturno */
html.dark .topo-pattern {
  background-color: #0c121d !important;
  background-image: radial-gradient(#5fa583 0.65px, transparent 0.65px), radial-gradient(#c5768b 0.65px, #0c121d 0.65px) !important;
}

/* Insignias de Estado */
html.dark .badge-pilot {
  background-color: #0e3321 !important;
  color: #6ee7b7 !important;
  border-color: #166534 !important;
}

html.dark .badge-active {
  background-color: #0e2a44 !important;
  color: #93c5fd !important;
  border-color: #1d4ed8 !important;
}

html.dark .badge-strategy {
  background-color: #3b280a !important;
  color: #fcd34d !important;
  border-color: #92400e !important;
}

html.dark .badge-good {
  background-color: #0e3321 !important;
  color: #86efac !important;
  border-color: #166534 !important;
}

html.dark .badge-warning {
  background-color: #3b280a !important;
  color: #fde047 !important;
  border-color: #a16207 !important;
}

html.dark .badge-alert {
  background-color: #451010 !important;
  color: #fca5a5 !important;
  border-color: #991b1b !important;
}

/* Tablas en calidad de agua */
html.dark th {
  background-color: #151f2e !important;
  color: #cbd5e1 !important;
}

html.dark tr.hover\:bg-gray-50:hover,
html.dark tr:hover {
  background-color: #1a2738 !important;
}

/* Botones inactivos de filtros y estaciones */
html.dark .filter-btn:not(.active):not(.bg-mawiza-berry),
html.dark .time-btn:not(.active),
html.dark .param-btn:not(.active),
html.dark .station-toggle:not(.active) {
  background-color: #162030 !important;
  color: #cbd5e1 !important;
  border-color: #27364b !important;
}

html.dark .filter-btn:not(.active):hover,
html.dark .time-btn:not(.active):hover,
html.dark .param-btn:not(.active):hover,
html.dark .station-toggle:not(.active):hover {
  background-color: #1e2b3e !important;
}

/* Pie de página */
html.dark footer {
  background-color: #070b12 !important;
  border-top-color: #1e2b3e !important;
}

