/**
 * Accessibility Fixes for WCAG 2.1 Level AA Compliance
 * Focus: Color Contrast
 * Date: October 22, 2025
 */

/* ==========================================================================
   SKIP LINK
   ========================================================================== */
.sr-only:focus,
.sr-only.focus\:not-sr-only:focus {
    background-color: #0369a1 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   APP SWITCHER
   ========================================================================== */
.app-switcher-item.active {
    background-color: #eff6ff !important;
    color: #075985 !important;
}

.app-switcher-item.active .app-name {
    color: #075985 !important;
}

.app-switcher-item.active .app-check {
    color: #075985 !important;
}

/* ==========================================================================
   NAVIGATION ACTIVE STATE
   ========================================================================== */
:root {
    --sidebar-nav-item-active-color: #3b82f6;
    --sidebar-nav-item-active-bg: #eff6ff;
}

.nav-item-mintlify.active {
    color: #3b82f6 !important;
    background: #eff6ff !important;
    font-weight: 500;
}

.nav-link.active {
    color: #3b82f6 !important;
    background: #eff6ff !important;
}

/* ==========================================================================
   MAIN CONTENT LINKS - Lighthouse fixes
   ========================================================================== */
main.flex-1.max-w-4xl.px-6.pt-8.pb-8 .prose a:not(.toc-link):not(.content-footer-link),
main.flex-1.max-w-4xl.px-6.pt-8.pb-8 article a:not(.toc-link):not(.content-footer-link),
main.flex-1.max-w-4xl .prose a:not(.toc-link):not(.content-footer-link),
main.flex-1.max-w-4xl article a:not(.toc-link):not(.content-footer-link),
.prose.prose-lg a:not(.toc-link):not(.content-footer-link) {
    color: #0369a1 !important; /* 5.93:1 contrast */
    font-weight: 600 !important; /* Distinguishable by more than color */
}

/* ==========================================================================
   CODE BLOCKS
   ========================================================================== */
pre {
    background: #0f172a !important;
}

code {
    color: #e5e7eb;
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */
html[data-theme="dark"] {
    --sidebar-nav-item-active-color: #7dd3fc;
    --sidebar-nav-item-active-bg: #1e3a8a;
}

html[data-theme="dark"] .app-switcher-item.active,
body.dark-theme .app-switcher-item.active {
    background-color: #1e3a8a !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .app-switcher-item.active .app-name,
body.dark-theme .app-switcher-item.active .app-name {
    color: #7dd3fc !important;
}

html[data-theme="dark"] .nav-item-mintlify.active,
body.dark-theme .nav-item-mintlify.active {
    color: #7dd3fc !important;
    background: #1e3a8a !important;
}

html[data-theme="dark"] main.flex-1.max-w-4xl.px-6.pt-8.pb-8 .prose a:not(.toc-link):not(.content-footer-link),
html[data-theme="dark"] main.flex-1.max-w-4xl.px-6.pt-8.pb-8 article a:not(.toc-link):not(.content-footer-link),
html[data-theme="dark"] main.flex-1.max-w-4xl .prose a:not(.toc-link):not(.content-footer-link),
html[data-theme="dark"] main.flex-1.max-w-4xl article a:not(.toc-link):not(.content-footer-link),
html[data-theme="dark"] .prose.prose-lg a:not(.toc-link):not(.content-footer-link),
body.dark-theme main.flex-1.max-w-4xl.px-6.pt-8.pb-8 .prose a:not(.toc-link):not(.content-footer-link),
body.dark-theme main.flex-1.max-w-4xl.px-6.pt-8.pb-8 article a:not(.toc-link):not(.content-footer-link),
body.dark-theme main.flex-1.max-w-4xl .prose a:not(.toc-link):not(.content-footer-link),
body.dark-theme main.flex-1.max-w-4xl article a:not(.toc-link):not(.content-footer-link),
body.dark-theme .prose.prose-lg a:not(.toc-link):not(.content-footer-link) {
    color: #60a5fa !important; /* 7.04:1 contrast */
    font-weight: 600 !important;
}

/* ==========================================================================
   RESOURCE CARDS
   ========================================================================== */
.resource-card p {
    color: #4b5563 !important;
}

.resource-card h3 {
    color: #111827 !important;
}

.resource-link {
    color: #075985 !important;
}

.resource-link:hover {
    color: #0369a1 !important;
}

[data-theme="dark"] .resource-card p,
body.dark-theme .resource-card p {
    color: #9ca3af !important;
}

/* Resource card dark mode backgrounds */
[data-theme="dark"] .resource-card,
body.dark-theme .resource-card,
html[data-theme="dark"] .resource-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

[data-theme="dark"] .resource-card-header,
body.dark-theme .resource-card-header,
html[data-theme="dark"] .resource-card-header {
    background: transparent !important;
}

/* Resource card dark mode h3 - light text on dark background */
[data-theme="dark"] .resource-card h3,
body.dark-theme .resource-card h3,
html[data-theme="dark"] .resource-card h3,
[data-theme="dark"] .resource-card-header h3,
body.dark-theme .resource-card-header h3,
html[data-theme="dark"] .resource-card-header h3 {
    color: #ffffff !important;
}

[data-theme="dark"] .resource-link,
body.dark-theme .resource-link {
    color: #7dd3fc !important;
}

[data-theme="dark"] .resource-link:hover,
body.dark-theme .resource-link:hover {
    color: #38bdf8 !important;
}

/* ==========================================================================
   NOTICE/TIP BOXES - Dark mode visibility
   ========================================================================== */
/* Dark background for notice boxes */
[data-theme="dark"] .notice,
body.dark-theme .notice,
html[data-theme="dark"] .notice {
    background: #1e293b !important;
    border-color: rgba(var(--notice-rgb), 0.4) !important;
}

[data-theme="dark"] .notice-header,
body.dark-theme .notice-header,
html[data-theme="dark"] .notice-header {
    background: rgba(var(--notice-rgb), 0.25) !important;
    border-bottom-color: rgba(var(--notice-rgb), 0.4) !important;
}

[data-theme="dark"] .notice-body,
body.dark-theme .notice-body,
html[data-theme="dark"] .notice-body {
    background: rgba(var(--notice-rgb), 0.1) !important;
}

/* Light text for dark background */
[data-theme="dark"] .notice-title,
body.dark-theme .notice-title,
html[data-theme="dark"] .notice-title {
    color: #ffffff !important;
}

[data-theme="dark"] .notice-text,
body.dark-theme .notice-text,
html[data-theme="dark"] .notice-text,
[data-theme="dark"] .notice-text p,
body.dark-theme .notice-text p,
html[data-theme="dark"] .notice-text p,
[data-theme="dark"] .notice-text li,
body.dark-theme .notice-text li,
html[data-theme="dark"] .notice-text li {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .notice-text code,
body.dark-theme .notice-text code,
html[data-theme="dark"] .notice-text code {
    color: #fca5a5 !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .notice-text a,
body.dark-theme .notice-text a,
html[data-theme="dark"] .notice-text a {
    color: #93c5fd !important;
}

[data-theme="dark"] .notice-badge,
body.dark-theme .notice-badge,
html[data-theme="dark"] .notice-badge {
    color: #ffffff !important;
}
