:root,
html[data-theme="light"] {
    color-scheme: light;
    --page-bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #f3f4f6;
    --text: #111827;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --nav-link: #4b5563;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --accent-border: #bfdbfe;
    --navbar-shadow: rgba(0, 0, 0, 0.05);
    --accent-glow: rgba(37, 99, 235, 0.2);
    --accent-glow-strong: rgba(37, 99, 235, 0.3);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #101113;
    --surface: #17181a;
    --surface-2: #1f2023;
    --border: #2a2b2f;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --muted-2: #6b7280;
    --nav-link: #d1d5db;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: #1c2a44;
    --accent-border: #24406f;
    --navbar-shadow: rgba(0, 0, 0, 0.5);
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-glow-strong: rgba(59, 130, 246, 0.35);
}

html[data-theme="mono"] {
    color-scheme: light;
    --page-bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f5f5f5;
    --border: #e5e5e5;
    --text: #111111;
    --muted: #555555;
    --muted-2: #808080;
    --nav-link: #333333;
    --accent: #111111;
    --accent-hover: #000000;
    --accent-soft: #f0f0f0;
    --accent-border: #d4d4d4;
    --navbar-shadow: rgba(0, 0, 0, 0.08);
    --accent-glow: rgba(17, 17, 17, 0.15);
    --accent-glow-strong: rgba(17, 17, 17, 0.25);
}

html[data-theme] body {
    background-color: var(--page-bg) !important;
}

html[data-theme="dark"] body {
    color: #e5e7eb;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.theme-switch button {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.theme-switch button:hover {
    color: var(--text);
}

.theme-switch button.active {
    background: var(--accent);
    color: #ffffff;
}

html[data-theme="dark"] .text-gray-900 { color: #ffffff !important; }
html[data-theme="dark"] .text-gray-800 { color: #f3f4f6 !important; }
html[data-theme="dark"] .text-gray-700 { color: #e5e7eb !important; }
html[data-theme="dark"] .text-gray-600 { color: #d1d5db !important; }
html[data-theme="dark"] .text-gray-500 { color: #a1a1aa !important; }
html[data-theme="dark"] .text-gray-400 { color: #9ca3af !important; }
html[data-theme="dark"] .text-gray-300 { color: #71717a !important; }
html[data-theme="dark"] .text-gray-200 { color: #52525b !important; }

html[data-theme="dark"] .text-black {
    color: #ffffff !important;
}

html[data-theme="dark"] [class*="shadow-"] {
    --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3) !important;
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}

/* Fix specific shadows in dark mode to avoid "glow" effect */
html[data-theme="dark"] [class*="shadow-blue-"],
html[data-theme="dark"] [class*="shadow-gray-"],
html[data-theme="dark"] [class*="shadow-orange-"],
html[data-theme="dark"] [class*="shadow-red-"] {
    --tw-shadow-color: rgba(0, 0, 0, 0.5) !important;
    --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -2px var(--tw-shadow-color) !important;
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;
}

html[data-theme="dark"] .shadow-none {
    box-shadow: none !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #1f2023 !important;
    color: #ffffff !important;
    border-color: #33353a !important;
}

html[data-theme="dark"] .bg-white {
    background-color: var(--surface) !important;
}

html[data-theme="dark"] .bg-gray-50 {
    background-color: var(--surface-2) !important;
}

html[data-theme="dark"] .bg-gray-100 {
    background-color: #1a1b1e !important;
}

html[data-theme="dark"] .platform-btn.active {
    border-color: #3b82f6 !important;
    background-color: #1c2a44 !important;
}
html[data-theme="dark"] .platform-btn.active span {
    color: #60a5fa !important;
}
html[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
}

html[data-theme="dark"] .bg-blue-50\/50,
html[data-theme="dark"] .bg-gray-50\/50,
html[data-theme="dark"] .hover\:bg-gray-50\/50:hover,
html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-indigo-50,
html[data-theme="dark"] .bg-purple-50,
html[data-theme="dark"] .bg-pink-50,
html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-rose-50,
html[data-theme="dark"] .bg-orange-50,
html[data-theme="dark"] .bg-amber-50,
html[data-theme="dark"] .bg-yellow-50,
html[data-theme="dark"] .bg-green-50,
html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-white\/10 {
    background-color: #1f2023 !important;
}

html[data-theme="dark"] .divide-gray-50 > :not([hidden]) ~ :not([hidden]) {
    border-color: #2a2b2f !important;
}

html[data-theme="dark"] select option {
    background-color: #17181a;
    color: #f3f4f6;
}

/* Modal and Detail Views */
html[data-theme="dark"] .bg-gray-900 {
    background-color: #101113 !important;
}

html[data-theme="dark"] .border-gray-800 {
    border-color: #2a2b2f !important;
}

html[data-theme="dark"] .text-black {
    color: #f3f4f6;
}

html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-500 {
    color: #60a5fa;
}

html[data-theme="dark"] .text-indigo-500 {
    color: #818cf8;
}

html[data-theme="dark"] .text-purple-600 {
    color: #c084fc;
}

html[data-theme="dark"] .text-pink-600 {
    color: #f472b6;
}

html[data-theme="dark"] .text-red-600 {
    color: #f87171;
}

html[data-theme="dark"] .text-rose-500 {
    color: #fb7185;
}

html[data-theme="dark"] .text-orange-600 {
    color: #fb923c;
}

html[data-theme="dark"] .text-amber-600 {
    color: #fbbf24;
}

html[data-theme="dark"] .text-yellow-600 {
    color: #facc15;
}

html[data-theme="dark"] .text-green-600 {
    color: #4ade80;
}

html[data-theme="dark"] .text-emerald-600 {
    color: #34d399;
}

html[data-theme="dark"] .border-gray-50 {
    border-color: #232427;
}

html[data-theme="dark"] .border-gray-100 {
    border-color: #2a2b2f;
}

html[data-theme="dark"] .border-gray-200 {
    border-color: #33353a;
}

html[data-theme="dark"] .border-blue-100 {
    border-color: #24406f;
}

html[data-theme="dark"] .border-blue-200 {
    border-color: #2b4a80;
}

html[data-theme="dark"] .hover\:bg-gray-50:hover,
html[data-theme="dark"] .hover\:bg-white:hover {
    background-color: #1f2023;
}

html[data-theme="dark"] .hover\:bg-gray-100:hover {
    background-color: #26272b;
}

html[data-theme="dark"] .hover\:text-blue-600:hover {
    color: #60a5fa;
}

html[data-theme="mono"] .bg-blue-50,
html[data-theme="mono"] .bg-indigo-50,
html[data-theme="mono"] .bg-purple-50,
html[data-theme="mono"] .bg-pink-50,
html[data-theme="mono"] .bg-red-50,
html[data-theme="mono"] .bg-rose-50,
html[data-theme="mono"] .bg-orange-50,
html[data-theme="mono"] .bg-amber-50,
html[data-theme="mono"] .bg-yellow-50,
html[data-theme="mono"] .bg-green-50,
html[data-theme="mono"] .bg-emerald-50 {
    background-color: #f0f0f0;
}

html[data-theme="mono"] .bg-blue-600,
html[data-theme="mono"] .bg-blue-500,
html[data-theme="mono"] .bg-blue-400,
html[data-theme="mono"] .bg-indigo-500,
html[data-theme="mono"] .bg-purple-600,
html[data-theme="mono"] .bg-pink-600,
html[data-theme="mono"] .bg-red-600,
html[data-theme="mono"] .bg-rose-500,
html[data-theme="mono"] .bg-orange-600,
html[data-theme="mono"] .bg-amber-600,
html[data-theme="mono"] .bg-yellow-600,
html[data-theme="mono"] .bg-green-600,
html[data-theme="mono"] .bg-emerald-600 {
    background-color: #111111;
}

html[data-theme="mono"] .text-blue-600,
html[data-theme="mono"] .text-blue-500,
html[data-theme="mono"] .text-blue-400,
html[data-theme="mono"] .text-indigo-500,
html[data-theme="mono"] .text-purple-600,
html[data-theme="mono"] .text-pink-600 {
    color: #111111;
}

html[data-theme="mono"] .text-green-600,
html[data-theme="mono"] .text-emerald-600 {
    color: #4b4b4b;
}

html[data-theme="mono"] .text-red-600,
html[data-theme="mono"] .text-rose-500 {
    color: #000000;
}

html[data-theme="mono"] .text-orange-600,
html[data-theme="mono"] .text-amber-600,
html[data-theme="mono"] .text-yellow-600 {
    color: #6b6b6b;
}

html[data-theme="mono"] .border-blue-100,
html[data-theme="mono"] .border-blue-200 {
    border-color: #e5e5e5;
}

html[data-theme="mono"] .border-red-100,
html[data-theme="mono"] .border-green-100 {
    border-color: #e5e5e5;
}

html[data-theme="mono"] .from-blue-600,
html[data-theme="mono"] .from-blue-500,
html[data-theme="mono"] .from-blue-400 {
    --tw-gradient-from: #111111;
    --tw-gradient-to: rgba(17, 17, 17, 0);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

html[data-theme="mono"] .to-blue-800,
html[data-theme="mono"] .to-blue-700,
html[data-theme="mono"] .to-blue-600,
html[data-theme="mono"] .to-blue-500,
html[data-theme="mono"] .to-blue-400 {
    --tw-gradient-to: #333333;
}

html[data-theme="mono"] .hover\:from-blue-600:hover {
    --tw-gradient-from: #000000;
    --tw-gradient-to: rgba(0, 0, 0, 0);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

html[data-theme="mono"] .hover\:to-blue-700:hover {
    --tw-gradient-to: #222222;
}

html[data-theme="mono"] [class*="shadow-"] {
    --tw-shadow-color: rgba(17, 17, 17, 0.12);
}

html[data-theme="mono"] .hover\:text-\[\#00B900\]:hover,
html[data-theme="mono"] .text-\[\#00B900\] {
    color: #333333;
}

html[data-theme="mono"] .bg-\[\#f53d2d\] {
    background-color: #111111;
}

html[data-theme="mono"] .hover\:bg-\[\#d73224\]:hover {
    background-color: #000000;
}

html[data-theme="mono"] .bg-\[\#f68b8b\] {
    background-color: #444444;
}

html[data-theme="mono"] .hover\:bg-\[\#ef7a7a\]:hover {
    background-color: #333333;
}

html[data-theme="mono"] .bg-\[\#fdf8f8\] {
    background-color: #f5f5f5;
}

html[data-theme="mono"] .text-\[\#d6a5a5\] {
    color: #666666;
}
