@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --color-primary: #1e3a8a; /* Сапфирово-синий */
    --color-hover: #1d4ed8;
    --color-accent: #f97316; /* Янтарно-оранжевый */
    --color-bg: #f8fafc;
    --font-main: 'Inter', 'Outfit', system-ui, sans-serif;
    --font-heading: 'Outfit', system-ui, sans-serif;
    --border-radius: 12px;
    --card-radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
}

body, html {
    font-family: var(--font-main) !important;
    background-color: var(--color-bg);
    color: #111827; /* Высококонтрастный темно-угольный */
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading) !important;
    color: #111827;
}

/* Дефолтный цвет для светлых текстов */
p, span, li, td, th, label, input, textarea, select {
    color: #111827;
}

/* --- СВЕТЛЫЕ КАРТОЧКИ И БЛОКИ (всегда темный текст) --- */
.bg-white, .bg-slate-50, .bg-slate-100, .bg-gray-50, .bg-gray-100, .premium-card {
    background-color: #ffffff;
    color: #111827 !important;
}

.bg-white p, .bg-white span, .bg-white li, .bg-white td, .bg-white th, .bg-white label,
.premium-card p, .premium-card span, .premium-card li, .premium-card td, .premium-card th, .premium-card label,
.bg-slate-50 p, .bg-slate-50 span, .bg-slate-50 li, .bg-slate-100 p, .bg-slate-100 span, .bg-slate-100 li,
.bg-gray-50 p, .bg-gray-50 span, .bg-gray-50 li, .bg-gray-100 p, .bg-gray-100 span, .bg-gray-100 li {
    color: #111827 !important;
}

.bg-white h1, .bg-white h2, .bg-white h3, .bg-white h4, .bg-white h5, .bg-white h6,
.premium-card h1, .premium-card h2, .premium-card h3, .premium-card h4, .premium-card h5, .premium-card h6 {
    color: #111827 !important;
}

/* --- ТЕМНЫЕ БЛОКИ (всегда белый текст по умолчанию, кроме светлых карточек внутри них) --- */
.bg-slate-900, .bg-gray-900, .bg-blue-900, .bg-blue-950, .bg-neutral-900, footer {
    color: #ffffff !important;
}

.bg-slate-900 p:not(.bg-white *):not(.premium-card *),
.bg-slate-900 span:not(.bg-white *):not(.premium-card *),
.bg-slate-900 li:not(.bg-white *):not(.premium-card *),
.bg-slate-900 h1:not(.bg-white *):not(.premium-card *),
.bg-slate-900 h2:not(.bg-white *):not(.premium-card *),
.bg-slate-900 h3:not(.bg-white *):not(.premium-card *),
.bg-slate-900 h4:not(.bg-white *):not(.premium-card *),
.bg-gray-900 p:not(.bg-white *):not(.premium-card *),
.bg-gray-900 span:not(.bg-white *):not(.premium-card *),
.bg-gray-900 li:not(.bg-white *):not(.premium-card *),
.bg-gray-900 h1:not(.bg-white *):not(.premium-card *),
.bg-gray-900 h2:not(.bg-white *):not(.premium-card *),
.bg-gray-900 h3:not(.bg-white *):not(.premium-card *),
.bg-gray-900 h4:not(.bg-white *):not(.premium-card *),
.bg-blue-950 p:not(.bg-white *):not(.premium-card *),
.bg-blue-950 span:not(.bg-white *):not(.premium-card *),
.bg-blue-950 li:not(.bg-white *):not(.premium-card *),
.bg-blue-950 h1:not(.bg-white *):not(.premium-card *),
.bg-blue-950 h2:not(.bg-white *):not(.premium-card *),
.bg-blue-950 h3:not(.bg-white *):not(.premium-card *),
.bg-blue-950 h4:not(.bg-white *):not(.premium-card *),
footer p, footer span, footer li, footer a, footer h3, footer h4, footer div {
    color: #ffffff !important;
}

/* --- ИСКЛЮЧЕНИЯ: Утилитарные классы цветов, которые ВСЕГДА работают --- */
.text-white { color: #ffffff !important; }
.text-gray-900, .text-slate-900, .text-black { color: #111827 !important; }
.text-blue-900 { color: #1e3a8a !important; }
.text-orange-500 { color: #f97316 !important; }
.text-orange-400 { color: #fb923c !important; }
.text-green-600 { color: #16a34a !important; }
.text-emerald-500 { color: #10b981 !important; }
.text-primary { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }

/* Звезды рейтинга */
i.fa-star, .fa-star {
    color: #f97316 !important;
}

/* --- Премиальные белые карточки --- */
.premium-card {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: var(--shadow) !important;
    border-radius: var(--card-radius) !important;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.premium-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02) !important;
    border-color: #94a3b8 !important;
}

/* --- Кнопки с высоким контрастом --- */
.btn-primary {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 2px solid var(--color-primary) !important;
    transition: all 0.2s ease-in-out;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--color-hover) !important;
    border-color: var(--color-hover) !important;
}
.btn-primary * {
    color: #ffffff !important;
}

.btn-accent {
    background-color: var(--color-accent) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 2px solid var(--color-accent) !important;
    transition: all 0.2s ease-in-out;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}
.btn-accent:hover {
    background-color: #ea580c;
    border-color: #ea580c;
}
.btn-accent * {
    color: #ffffff !important;
}

/* --- Кнопки фильтрации --- */
.filter-btn {
    background-color: #ffffff !important;
    color: var(--color-primary) !important;
    border: 1px solid #cbd5e1 !important;
    transition: all 0.2s ease;
    cursor: pointer;
}
.filter-btn:hover {
    background-color: #f1f5f9 !important;
    border-color: var(--color-primary) !important;
}
.filter-btn.bg-blue-900, .filter-btn.active, .filter-btn.bg-blue-900 * {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    border-color: var(--color-primary) !important;
}

/* Ссылки */
a {
    transition: color 0.2s ease;
}
a:hover {
    color: var(--color-primary) !important;
}
header a:hover {
    color: var(--color-primary) !important;
}
footer a {
    color: #e5e7eb !important;
}
footer a:hover {
    color: var(--color-accent) !important;
}
