/*
 * contrast.css - Cores legíveis no modo claro (WCAG AA), carregado depois dos outros estilos
 *
 * @version    1.0.0
 * @date       2026-11-03
 * @site       dashboard.pt
 *
 * CHANGELOG:
 * =========
 *
 * v1.0.0 (2026-11-03) - Versão inicial
 *   [NOVO] Texto cinzento, verde-água e de estado com pelo menos 4,5:1 sobre fundos claros.
 *          O modo escuro e as zonas de fundo escuro ficam com as cores de origem
 *   [NOVO] :where() mantém a especificidade de uma classe, para os hover:text-* continuarem a ganhar
 */

/* Cinzentos: #5b6472 tem 4,83:1 sobre o fundo mais escuro em uso (#e5e7eb) */
:where(html:not(.dark)) :is(.text-gray-300, .text-gray-400, .text-gray-500):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black, .bg-primary, .bg-primary-dark) *)) {
    color: #5b6472;
}

/* Verde-água. A paleta de styles.css aplica --teal-600 com !important */
html:not(.dark) {
    --teal-600: #0f766e;
}
:where(html:not(.dark)) :is(.text-primary, .text-teal-300, .text-teal-400, .text-teal-500, .text-teal-600):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black, .bg-primary, .bg-primary-dark) *)) {
    color: #0f766e;
}
:where(html:not(.dark)) :is(.hover\:text-primary, .hover\:text-teal-500):hover {
    color: #0f766e;
}
:where(html:not(.dark)) .hover\:text-primary-dark:hover {
    color: #115e59;
}
:where(html:not(.dark)) :is(.bg-primary-light, .bg-primary-light .text-primary, .bg-primary-light .text-primary-dark) {
    color: #134e4a;
}

:where(html:not(.dark)) .sidebar-active {
    color: #134e4a;
}

/* Estados */
:where(html:not(.dark)) :is(.text-green-400, .text-green-500, .text-green-600):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black) *)) {
    color: #047857;
}
:where(html:not(.dark)) :is(.text-yellow-300, .text-yellow-400, .text-yellow-500, .text-yellow-600, .text-amber-400, .text-amber-500):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black) *)) {
    color: #b45309;
}
:where(html:not(.dark)) :is(.text-orange-400, .text-orange-500):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black) *)) {
    color: #c2410c;
}
:where(html:not(.dark)) :is(.text-red-400, .text-red-500):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black) *)) {
    color: #b91c1c;
}
:where(html:not(.dark)) :is(.text-blue-400, .text-blue-500):where(:not(:is(.bg-gray-700, .bg-gray-800, .bg-gray-900, .bg-black) *)) {
    color: #1d4ed8;
}

/* Fundos de cor com texto branco, nos dois modos */
.bg-red-500.text-white {
    background-color: #dc2626;
}
.bg-green-500.text-white {
    background-color: #047857;
}
.bg-teal-600 {
    background-color: #0f766e !important;
}
.bg-teal-500 {
    background-color: #0f766e !important;
}
:is(.hover\:bg-teal-600, .hover\:bg-teal-700):hover {
    background-color: #115e59 !important;
}
.toggle-button.active {
    background-color: #047857 !important;
}
.copy-button.copied {
    background-color: #047857;
}
.btn-action:hover, .btn-action.active {
    background-color: var(--primary-dark);
}

/* Componentes com a cor primária em CSS próprio */
.footer-icon {
    color: var(--primary-color);
}
:where(html:not(.dark)) .footer-icon {
    color: var(--primary-dark);
}
:where(html:not(.dark)) .btn-outline {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}
.btn-outline:hover {
    background-color: var(--primary-dark);
    color: #ffffff;
}
:where(html:not(.dark)) :is(.footer-link:hover, .graph-title i, .widget-actions button:hover, .widget-actions a:hover) {
    color: var(--primary-dark);
}
