/* ===== FIX DLA WIDOCZNOŚCI NA WINDOWS I MACOS ===== */

/* WYMUSZENIE TRYBU CIEMNEGO - zawsze aktywne style dark: */
:root {
    color-scheme: dark;
}

/* Windows-specific fixes dla lepszej zgodności z macOS */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* Fix dla starszych wersji Edge */
    body {
        font-smoothing: antialiased;
    }
}

/* Chrome/Edge na Windows - lepszy rendering */
@supports (-webkit-appearance:none) {
    body {
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }
}

/* Nadpisanie problematycznych klas Tailwind dla lepszej widoczności */

/* Teksty - zamiana text-gray-900 na jaśniejsze kolory */
.text-gray-900 {
    color: #F3F4F6 !important; /* light gray-100 zamiast prawie czarnego */
}

/* Tła - wymuszenie spójnych kolorów */
.bg-white {
    background-color: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(6px);
}

.dark\:bg-white {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.bg-gray-50 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.bg-gray-100 {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

/* Wymuszenie dark mode stylów bez potrzeby klasy .dark */
.dark\:bg-gray-900 {
    background-color: rgba(18, 18, 18, 0.8) !important;
}

.dark\:bg-gray-800 {
    background-color: rgba(31, 31, 31, 0.8) !important;
}

.dark\:text-white {
    color: #FFFFFF !important;
}

.dark\:text-gray-300 {
    color: #D1D5DB !important;
}

.dark\:text-gray-400 {
    color: #9CA3AF !important;
}

.dark\:border-gray-800 {
    border-color: rgba(31, 31, 31, 0.9) !important;
}

.dark\:border-gray-700 {
    border-color: rgba(55, 65, 81, 0.8) !important;
}

/* Fix dla border */
.border-gray-200 {
    border-color: rgba(75, 85, 99, 0.3) !important;
}

.dark\:border-gray-200 {
    border-color: rgba(75, 85, 99, 0.3) !important;
}

/* ===== SELECTY I INPUTY - SPÓJNA WIDOCZNOŚĆ ===== */

/* Wszystkie selecty */
select,
.form-select,
select[class*="bg-"],
select.form-control {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #F3F4F6 !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    /* Fix dla Windows ClearType */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

select:focus,
.form-select:focus {
    outline: none;
    border-color: #60A5FA !important;
    background-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Opcje w selectach - KRYTYCZNE dla Windows */
select option,
.form-select option {
    background-color: #1e293b !important;
    color: #F3F4F6 !important;
    padding: 8px;
}

select option:checked,
.form-select option:checked {
    background-color: #3B82F6 !important;
    color: #FFFFFF !important;
}

/* Inputy tekstowe */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
.form-control,
.form-input {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #F3F4F6 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
.form-control:focus,
.form-input:focus {
    border-color: #60A5FA !important;
    background-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Placeholder dla lepszej widoczności */
::placeholder {
    color: #9CA3AF !important;
    opacity: 1;
}

input::placeholder,
textarea::placeholder,
select::placeholder {
    color: #9CA3AF !important;
}

/* ===== BUTTONY - SPÓJNA WIDOCZNOŚĆ ===== */

button,
.btn,
a.btn {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== FIX DLA WINDOWS CLEARTYPE I SUBPIXEL RENDERING ===== */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Wymuszenie lepszego kontrastu na wszystkich tekstach */
body, p, span, div, a, li, td, th {
    text-shadow: 0 0 0.01px rgba(255, 255, 255, 0.1);
}

/* ===== KARTY I KONTENERY ===== */

/* Fix dla kart z białym tłem */
.bg-white.dark\:bg-gray-900\/60,
.bg-white.dark\:bg-gray-900\/80,
[class*="bg-white"][class*="dark:bg-gray-9"] {
    background-color: rgba(18, 18, 18, 0.85) !important;
    backdrop-filter: blur(8px);
}

.bg-white.dark\:bg-gray-800\/60,
[class*="bg-white"][class*="dark:bg-gray-8"] {
    background-color: rgba(31, 31, 31, 0.75) !important;
    backdrop-filter: blur(6px);
}

/* ===== CHROME/EDGE AUTOFILL FIX ===== */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #F3F4F6 !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(59, 130, 246, 0.1) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===== PROGRESS BAR FIX ===== */

.h-3.bg-gray-200.dark\:bg-gray-700 {
    background-color: rgba(55, 65, 81, 0.6) !important;
}

/* ===== GRADIENT BACKGROUNDS - SOLIDNIEJSZE DLA WINDOWS ===== */

[class*="dark:from-blue-900"],
[class*="dark:to-blue-950"] {
    backdrop-filter: blur(4px);
}

/* Fix dla elementów z niską opacity - DISABLED bo psuje normalne zachowanie */
/* Tailwind już dobrze zarządza opacity po naszych zmianach w HTML */

/* ===== SCROLLBAR DLA WINDOWS ===== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #3B82F6 #0A0A0A;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #60A5FA, #3B82F6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3B82F6, #2563EB);
}

/* ===== DODATKOWE FIXY DLA PROFILU UŻYTKOWNIKA ===== */

/* Wzmocnienie kolorów dla gradientów niebieskich w dark mode */
.dark [class*="from-blue-900"] {
    --tw-gradient-from: rgba(30, 58, 138, 0.5) !important;
}

.dark [class*="to-blue-950"] {
    --tw-gradient-to: rgba(23, 37, 84, 0.5) !important;
}

/* Lepszy kontrast dla border */
.dark [class*="border-blue-800"] {
    border-color: rgba(30, 64, 175, 0.7) !important;
}

/* Wzmocnienie tła dla kart statystyk */
.dark .rounded-xl[class*="bg-gray-800"] {
    background-color: rgba(31, 41, 55, 0.7) !important;
}

/* Lepsze tło dla liczników tokenów */
.dark .rounded-xl[class*="border-gray-700"] {
    background-color: rgba(31, 41, 55, 0.65) !important;
    border-color: rgba(55, 65, 81, 0.75) !important;
}

/* Zwiększenie widoczności info boxu */
.dark .rounded-lg[class*="from-blue-900"][class*="to-blue-950"] {
    background: linear-gradient(to bottom right, rgba(30, 58, 138, 0.45), rgba(23, 37, 84, 0.45)) !important;
}

/* Solidniejsze tło dla ikony SH */
.dark .rounded-2xl[class*="from-blue-900"][class*="to-blue-950"] {
    background: linear-gradient(to bottom right, rgba(30, 58, 138, 0.65), rgba(23, 37, 84, 0.65)) !important;
}

