/* ============================================
   Scorise AI - Button Color Override
   Zamienia zielone przyciski na niebieski #006CB7
   ============================================ */

/* Nadpisanie głównej zmiennej CSS dla przycisku Submit */
:root {
  --surface-submit: 0 108 183 !important; /* RGB dla #006CB7 */
  --rgb-surface-submit: 0 108 183 !important;
  --surface-submit-hover: 0 96 163 !important; /* Ciemniejszy odcień dla hover */
}

.dark {
  --surface-submit: 0 108 183 !important;
  --rgb-surface-submit: 0 108 183 !important;
  --surface-submit-hover: 0 96 163 !important;
}

/* Przyciski używające bg-surface-submit - upewnij się, że mają biały tekst */
.bg-surface-submit,
[class*="bg-surface-submit"] {
  background-color: rgb(0 108 183) !important;
  color: white !important;
}

.bg-surface-submit:hover,
.hover\:bg-surface-submit-hover:hover {
  background-color: rgb(0 96 163) !important;
}

/* Nadpisanie inline style dla RGB */
[style*="background-color: rgb(34, 197, 94)"],
[style*="background-color: rgb(22, 163, 74)"],
[style*="background-color: rgb(16, 185, 129)"] {
  background-color: rgb(0, 108, 183) !important;
}

/* Nadpisanie wszystkich wariantów zielonych przycisków Tailwind */
/* WAŻNE: Tylko przyciski, linki i elementy interaktywne - NIE kontenery layoutu */
button.bg-green-500,
button.bg-green-600,
button.bg-green-700,
button.bg-green-800,
a.bg-green-500,
a.bg-green-600,
a.bg-green-700,
span.bg-green-500,
span.bg-green-600,
span.bg-green-700 {
  background-color: rgb(0 108 183) !important;
  border-color: rgb(0 108 183) !important;
}

/* Stany hover dla zielonych przycisków */
.hover\:bg-green-600:hover,
.hover\:bg-green-700:hover,
.hover\:bg-green-800:hover,
button.bg-green-500:hover,
button.bg-green-600:hover,
button.bg-green-700:hover {
  background-color: rgb(0 96 163) !important; /* Ciemniejszy odcień dla hover */
  border-color: rgb(0 96 163) !important;
}

/* Stany active/pressed */
.bg-green-500:active,
.bg-green-600:active,
.bg-green-700:active {
  background-color: rgb(0 86 143) !important;
}

/* Teksty zielone zamienione na niebieskie */
.text-green-500,
.text-green-600,
.text-green-700 {
  color: rgb(0 108 183) !important;
}

/* WYJĄTEK: Biały tekst dla badge'y z bg-green (np. "0% used") */
/* Jeśli element ma bg-green I text-green, to tekst powinien być biały dla kontrastu */
[class*="bg-green-"][class*="text-green-"],
.dark [class*="bg-green-"][class*="text-green-"] {
  color: white !important;
}

/* Specyficznie dla elementów z role="status" (usage badges) */
[role="status"][class*="bg-green-"],
[role="status"][class*="bg-green-"] * {
  color: white !important;
}

/* Obramowania zielone zamienione na niebieskie */
.border-green-500,
.border-green-600,
.border-green-700 {
  border-color: rgb(0 108 183) !important;
}

/* Ring/outline dla focus states */
.ring-green-500,
.focus\:ring-green-500:focus {
  --tw-ring-color: rgb(0 108 183) !important;
}

/* Uniwersalny selektor dla wszystkich przycisków z "green" w klasie */
button[class*="green"],
a[class*="green"],
div[class*="green"][role="button"],
[role="checkbox"][class*="green"] {
  background-color: rgb(0 108 183 / 0.1) !important;
  border-color: rgb(0 108 183 / 0.4) !important;
}

button[class*="green"]:hover,
a[class*="green"]:hover,
div[class*="green"][role="button"]:hover,
[role="checkbox"][class*="green"]:hover {
  background-color: rgb(0 96 163 / 0.1) !important;
}

/* USUNIĘTE: Przywrócenie normalnego koloru tekstu dla przycisków z transparentnym tłem */
/* Przyciski z /10, /20 itp. mają transparentne tło, więc potrzebują ciemnego tekstu */

/* Specyficzne dla LibreChat - przycisk submit w chat */
button[type="submit"],
button[aria-label*="Send"],
form button[type="submit"] {
  background-color: rgb(0 108 183) !important;
  color: white !important;
}

button[type="submit"]:hover,
button[aria-label*="Send"]:hover {
  background-color: rgb(0 96 163) !important;
}

/* Przyciski btn btn-primary - jednakowa wysokość i style */
.btn.btn-primary {
  background-color: rgb(0 108 183) !important;
  color: white !important;
  height: 2.25rem !important; /* h-9 w Tailwind */
  min-height: 2.25rem !important;
}

.btn.btn-primary:hover {
  background-color: rgb(0 96 163) !important;
}

.btn.btn-primary:focus {
  border-color: rgb(0 108 183) !important;
}

/* Biały tekst TYLKO dla przycisków z PEŁNYM (nie transparentnym) niebieskim tłem */
/* Nie dla /10, /20 itp. które są transparentne */
.bg-green-500:not([class*="/10"]):not([class*="/20"]) *,
.bg-green-600:not([class*="/10"]):not([class*="/20"]) *,
.bg-green-700:not([class*="/10"]):not([class*="/20"]) * {
  color: white !important;
  fill: white !important;
}
