@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800;900&display=swap');

:root {
  --color-primary: #4338ca;
  --color-hover: #6366f1;
  --color-accent: #e0e7ff;
  --color-bg: #eef2ff;
  --font-main: 'Rubik', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', 'Rubik', system-ui, sans-serif;
  --border-radius: 20px;
  --card-radius: 12px;
  --shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

body, html {
  font-family: var(--font-main) !important;
  color: #1f2937;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading) !important;
}

/* Primary color styling */
[class*="bg-[#2d5a27]"], [class*="bg-[#"], .bg-primary {
  background-color: var(--color-primary) !important;
}

[class*="text-[#2d5a27]"], .text-primary {
  color: var(--color-primary) !important;
}

[class*="border-[#2d5a27]"], .border-primary {
  border-color: var(--color-primary) !important;
}

[class*="hover:bg-[#"]:hover {
  background-color: var(--color-hover) !important;
}

[class*="hover:text-[#"]:hover {
  color: var(--color-hover) !important;
}

.text-emerald-600, .text-green-600, .text-teal-600 {
  color: var(--color-primary) !important;
}

.bg-emerald-600, .bg-green-600, .bg-teal-600 {
  background-color: var(--color-primary) !important;
}

/* Light text on light backgrounds readability */
.bg-white [class*="text-white"], .bg-white [class*="text-gray-2"],
.bg-white [class*="text-gray-3"], .bg-white [class*="text-gray-4"],
.bg-white [class*="text-slate-3"], .bg-white [class*="text-slate-4"],
.bg-gray-50 [class*="text-white"], .bg-gray-50 [class*="text-gray-2"],
.bg-gray-50 [class*="text-gray-3"], .bg-gray-50 [class*="text-gray-4"],
.bg-gray-100 [class*="text-white"], .bg-gray-100 [class*="text-gray-2"],
.bg-gray-100 [class*="text-gray-3"], .bg-gray-100 [class*="text-gray-4"],
.bg-slate-50 [class*="text-white"], .bg-slate-50 [class*="text-gray-3"],
.bg-slate-50 [class*="text-gray-4"], .bg-blue-50 [class*="text-white"],
.bg-blue-50 [class*="text-gray-3"], .bg-sky-50 [class*="text-white"],
.bg-sky-50 [class*="text-gray-3"] {
  color: #374151 !important;
}

/* Dark text on dark backgrounds readability */
[class*="bg-gray-8"] [class*="text-gray-7"], [class*="bg-gray-8"] [class*="text-gray-8"],
[class*="bg-gray-9"] [class*="text-gray-7"], [class*="bg-gray-9"] [class*="text-gray-8"],
[class*="bg-gray-9"] [class*="text-gray-9"], [class*="bg-slate-9"] [class*="text-gray-8"],
[class*="bg-slate-9"] [class*="text-gray-9"], [class*="bg-black"] [class*="text-gray-8"],
[class*="bg-black"] [class*="text-gray-9"] {
  color: #e5e7eb !important;
}

/* Footer typography */
footer:not([class*="bg-"]) {
  background-color: var(--color-bg) !important;
}

footer:not([class*="bg-"]) [class*="text-white"],
footer:not([class*="bg-"]) [class*="text-gray-2"],
footer:not([class*="bg-"]) [class*="text-gray-3"],
footer:not([class*="bg-"]) [class*="text-gray-4"],
footer:not([class*="bg-"]) a {
  color: #374151 !important;
}

footer:not([class*="bg-"]) h1, footer:not([class*="bg-"]) h2,
footer:not([class*="bg-"]) h3, footer:not([class*="bg-"]) h4 {
  color: #111827 !important;
}

footer[class*="bg-gray-8"] h3, footer[class*="bg-gray-8"] h4,
footer[class*="bg-gray-9"] h3, footer[class*="bg-gray-9"] h4,
footer[class*="bg-slate-9"] h3, footer[class*="bg-slate-9"] h4,
footer[class*="bg-black"] h3, footer[class*="bg-black"] h4 {
  color: #ffffff !important;
}

footer[class*="bg-gray-9"] a, footer[class*="bg-slate-9"] a,
footer[class*="bg-black"] a {
  color: #d1d5db;
}

a.rounded-full, button.rounded-full, .btn {
  border-radius: var(--border-radius) !important;
}

.rounded-lg, .rounded-xl, .rounded-2xl {
  border-radius: var(--card-radius) !important;
}

header a[href*="index"] {
  min-width: 0;
}

header a[href*="index"] > span {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

@media (min-width: 1024px) {
  header a[href*="index"] > span {
    max-width: 320px;
  }
}

.bg-white, .bg-gray-50, .bg-gray-100 {
  color: #1f2937;
}
