/* Глобальні покращення темної теми для всього сайту */

/* CSS змінні для темної теми */
body:not(.light-theme) {
    --dark-bg-primary: rgba(30, 41, 59, 0.95);
    --dark-bg-secondary: rgba(40, 50, 70, 0.9);
    --dark-bg-tertiary: rgba(50, 60, 80, 0.85);
    --dark-border: rgba(100, 116, 139, 0.4);
    --dark-border-focus: rgba(96, 165, 250, 0.6);
    --dark-text-primary: #f8fafc;
    --dark-text-secondary: #cbd5e1;
    --dark-text-muted: #94a3b8;
    --dark-text-accent: #60a5fa;
    --dark-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --dark-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Покращення загальної читабельності */
body:not(.light-theme) h1,
body:not(.light-theme) h2,
body:not(.light-theme) h3,
body:not(.light-theme) h4,
body:not(.light-theme) h5,
body:not(.light-theme) h6 {
    color: var(--dark-text-primary) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body:not(.light-theme) p,
body:not(.light-theme) span,
body:not(.light-theme) div {
    color: var(--dark-text-secondary) !important;
}

body:not(.light-theme) label {
    color: var(--dark-text-secondary) !important;
    font-weight: 500;
}

/* Покращення форм та полів вводу */
body:not(.light-theme) input[type="text"],
body:not(.light-theme) input[type="email"],
body:not(.light-theme) input[type="password"],
body:not(.light-theme) input[type="search"],
body:not(.light-theme) input[type="tel"],
body:not(.light-theme) input[type="url"],
body:not(.light-theme) input[type="number"],
body:not(.light-theme) textarea,
body:not(.light-theme) select {
    background: var(--dark-bg-primary) !important;
    border: 2px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* На сірому/білому page-bg темна тема тримає поля світлими (як select категорій).
   Auth-модалка виключена — там темні поля + світлий текст (інакше білий-на-білому). */
body:not(.light-theme).light-background-active input[type="text"]:not(.unified-form-input),
body:not(.light-theme).light-background-active input[type="email"]:not(.unified-form-input),
body:not(.light-theme).light-background-active input[type="search"]:not(.unified-form-input),
body:not(.light-theme).light-background-active input[type="tel"]:not(.unified-form-input),
body:not(.light-theme).light-background-active input[type="url"]:not(.unified-form-input),
body:not(.light-theme).light-background-active input[type="number"]:not(.unified-form-input),
body:not(.light-theme).light-background-active textarea:not(.unified-form-input),
body:not(.light-theme).light-background-active select:not(.unified-form-input),
body:not(.light-theme).light-background-active .filter-select,
body:not(.light-theme).light-background-active .country-input,
body:not(.light-theme).light-background-active #country-filter,
body:not(.light-theme).force-dark-cards input[type="text"]:not(.unified-form-input),
body:not(.light-theme).force-dark-cards input[type="email"]:not(.unified-form-input),
body:not(.light-theme).force-dark-cards input[type="search"]:not(.unified-form-input),
body:not(.light-theme).force-dark-cards select:not(.unified-form-input),
body:not(.light-theme).force-dark-cards .filter-select,
body:not(.light-theme).force-dark-cards .country-input,
body:not(.light-theme).force-dark-cards #country-filter {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

body:not(.light-theme).light-background-active input::placeholder,
body:not(.light-theme).force-dark-cards input::placeholder {
    color: #94a3b8 !important;
}

body:not(.light-theme) input[type="text"]:focus,
body:not(.light-theme) input[type="email"]:focus,
body:not(.light-theme) input[type="password"]:focus,
body:not(.light-theme) input[type="search"]:focus,
body:not(.light-theme) input[type="tel"]:focus,
body:not(.light-theme) input[type="url"]:focus,
body:not(.light-theme) input[type="number"]:focus,
body:not(.light-theme) textarea:focus,
body:not(.light-theme) select:focus {
    border-color: var(--dark-border-focus) !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2) !important;
    outline: none;
    background: rgba(30, 41, 59, 0.98) !important;
}

/* Фокус на світлому page-bg — поле лишається білим (інакше країна «чорніє» при відкритому списку).
   .unified-form-input (auth modal) не чіпаємо. */
body:not(.light-theme).light-background-active input[type="text"]:not(.unified-form-input):focus,
body:not(.light-theme).light-background-active input[type="email"]:not(.unified-form-input):focus,
body:not(.light-theme).light-background-active input[type="search"]:not(.unified-form-input):focus,
body:not(.light-theme).light-background-active input[type="tel"]:not(.unified-form-input):focus,
body:not(.light-theme).light-background-active textarea:not(.unified-form-input):focus,
body:not(.light-theme).light-background-active select:not(.unified-form-input):focus,
body:not(.light-theme).light-background-active .filter-select:focus,
body:not(.light-theme).light-background-active .country-input:focus,
body:not(.light-theme).light-background-active #country-filter:focus,
body:not(.light-theme).force-dark-cards input[type="text"]:not(.unified-form-input):focus,
body:not(.light-theme).force-dark-cards .filter-select:focus,
body:not(.light-theme).force-dark-cards .country-input:focus,
body:not(.light-theme).force-dark-cards #country-filter:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #3182ce !important;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15) !important;
    color: #0f172a !important;
}

/* Плейсхолдери */
body:not(.light-theme) input::placeholder,
body:not(.light-theme) textarea::placeholder {
    color: rgba(203, 213, 225, 0.6) !important;
}

/* Опції в селектах */
body:not(.light-theme):not(.light-background-active) select option {
    background: var(--dark-bg-primary) !important;
    color: var(--dark-text-primary) !important;
    padding: 10px;
}

/* Покращення карточок та секцій */
body:not(.light-theme) .section,
body:not(.light-theme) .card,
body:not(.light-theme) .panel,
body:not(.light-theme) .container,
body:not(.light-theme) .vacancy-item,
body:not(.light-theme) .specialist-card,
body:not(.light-theme) .filter-section,
body:not(.light-theme) .contacts-section,
body:not(.light-theme) .contact-card {
    background: var(--dark-bg-secondary) !important;
    border: 2px solid var(--dark-border) !important;
    box-shadow: var(--dark-shadow) !important;
    backdrop-filter: blur(10px);
}

/* Сторінка контактів: не застосовувати фон .container до внутрішньої секції двічі */
body:not(.light-theme).contacts-page .contacts-container.container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none;
}

body:not(.light-theme) .contacts-section > h2,
body:not(.light-theme) .contact-card h3 {
    text-shadow: none !important;
}

body:not(.light-theme):not(.light-background-active) .section:hover,
body:not(.light-theme):not(.light-background-active) .card:hover,
body:not(.light-theme):not(.light-background-active) .vacancy-item:hover,
body:not(.light-theme):not(.light-background-active) .specialist-card:hover {
    box-shadow: var(--dark-shadow-hover) !important;
    border-color: rgba(96, 165, 250, 0.4) !important;
}

/* Покращення кнопок */
body:not(.light-theme) .btn,
body:not(.light-theme) button {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body:not(.light-theme) .btn-primary,
body:not(.light-theme) .primary-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

body:not(.light-theme) .btn-primary:hover,
body:not(.light-theme) .primary-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

body:not(.light-theme) .btn-secondary,
body:not(.light-theme) .secondary-btn {
    background: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    border: 2px solid var(--dark-border);
}

body:not(.light-theme) .btn-secondary:hover,
body:not(.light-theme) .secondary-btn:hover {
    background: var(--dark-bg-primary) !important;
    border-color: var(--dark-border-focus) !important;
    transform: translateY(-1px);
}

/* На світлому page-bg — світлі картки (не темна «скляна» заливка) */
body:not(.light-theme)[style*="f5f7fa"] .section,
body:not(.light-theme)[style*="f5f7fa"] .card,
body:not(.light-theme)[style*="f5f7fa"] .vacancy-item,
body:not(.light-theme)[style*="f5f7fa"] .specialist-card,
body:not(.light-theme)[style*="f5f7fa"] .specialist-item,
body:not(.light-theme)[style*="f5f7fa"] .filter-section,
body:not(.light-theme)[style*="c3cfe2"] .section,
body:not(.light-theme)[style*="c3cfe2"] .card,
body:not(.light-theme)[style*="c3cfe2"] .vacancy-item,
body:not(.light-theme)[style*="c3cfe2"] .specialist-card,
body:not(.light-theme)[style*="c3cfe2"] .specialist-item,
body:not(.light-theme)[style*="c3cfe2"] .filter-section,
body:not(.light-theme)[style*="e3ffe7"] .section,
body:not(.light-theme)[style*="e3ffe7"] .card,
body:not(.light-theme)[style*="e3ffe7"] .vacancy-item,
body:not(.light-theme)[style*="e3ffe7"] .specialist-card,
body:not(.light-theme)[style*="e3ffe7"] .specialist-item,
body:not(.light-theme)[style*="e3ffe7"] .filter-section,
body:not(.light-theme)[style*="d9e7ff"] .section,
body:not(.light-theme)[style*="d9e7ff"] .card,
body:not(.light-theme)[style*="d9e7ff"] .vacancy-item,
body:not(.light-theme)[style*="d9e7ff"] .specialist-card,
body:not(.light-theme)[style*="d9e7ff"] .specialist-item,
body:not(.light-theme)[style*="d9e7ff"] .filter-section,
body:not(.light-theme)[style*="ffffff"] .section,
body:not(.light-theme)[style*="ffffff"] .card,
body:not(.light-theme)[style*="ffffff"] .vacancy-item,
body:not(.light-theme)[style*="ffffff"] .specialist-card,
body:not(.light-theme)[style*="ffffff"] .specialist-item,
body:not(.light-theme)[style*="ffffff"] .filter-section,
body:not(.light-theme)[style*="e2e8f0"] .section,
body:not(.light-theme)[style*="e2e8f0"] .card,
body:not(.light-theme)[style*="e2e8f0"] .vacancy-item,
body:not(.light-theme)[style*="e2e8f0"] .specialist-card,
body:not(.light-theme)[style*="e2e8f0"] .specialist-item,
body:not(.light-theme)[style*="e2e8f0"] .filter-section,
body:not(.light-theme)[style*="cbd5e0"] .section,
body:not(.light-theme)[style*="cbd5e0"] .card,
body:not(.light-theme)[style*="cbd5e0"] .vacancy-item,
body:not(.light-theme)[style*="cbd5e0"] .specialist-card,
body:not(.light-theme)[style*="cbd5e0"] .specialist-item,
body:not(.light-theme)[style*="cbd5e0"] .filter-section {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: none;
    color: #0f172a !important;
}

/* Поля вводу на світлому page-bg (окрім auth modal .unified-form-input) */
body:not(.light-theme)[style*="f5f7fa"] input[type="text"]:not(.unified-form-input),
body:not(.light-theme)[style*="f5f7fa"] input[type="email"]:not(.unified-form-input),
body:not(.light-theme)[style*="f5f7fa"] input[type="search"]:not(.unified-form-input),
body:not(.light-theme)[style*="f5f7fa"] textarea:not(.unified-form-input),
body:not(.light-theme)[style*="f5f7fa"] select:not(.unified-form-input),
body:not(.light-theme)[style*="c3cfe2"] input[type="text"]:not(.unified-form-input),
body:not(.light-theme)[style*="c3cfe2"] input[type="email"]:not(.unified-form-input),
body:not(.light-theme)[style*="c3cfe2"] input[type="search"]:not(.unified-form-input),
body:not(.light-theme)[style*="c3cfe2"] textarea:not(.unified-form-input),
body:not(.light-theme)[style*="c3cfe2"] select:not(.unified-form-input),
body:not(.light-theme)[style*="ffffff"] input[type="text"]:not(.unified-form-input),
body:not(.light-theme)[style*="ffffff"] input[type="email"]:not(.unified-form-input),
body:not(.light-theme)[style*="ffffff"] input[type="search"]:not(.unified-form-input),
body:not(.light-theme)[style*="ffffff"] textarea:not(.unified-form-input),
body:not(.light-theme)[style*="ffffff"] select:not(.unified-form-input),
body:not(.light-theme)[style*="e2e8f0"] input[type="text"]:not(.unified-form-input),
body:not(.light-theme)[style*="e2e8f0"] input[type="email"]:not(.unified-form-input),
body:not(.light-theme)[style*="e2e8f0"] input[type="search"]:not(.unified-form-input),
body:not(.light-theme)[style*="e2e8f0"] textarea:not(.unified-form-input),
body:not(.light-theme)[style*="e2e8f0"] select:not(.unified-form-input) {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Покращення іконок */
body:not(.light-theme) .fa,
body:not(.light-theme) .fas,
body:not(.light-theme) .far,
body:not(.light-theme) .fab,
body:not(.light-theme) i[class*="fa"] {
    color: var(--dark-text-secondary) !important;
}

/* Покращення посилань — але не footer і не light page-bg */
body:not(.light-theme):not(.light-background-active) a {
    color: var(--dark-text-accent) !important;
    transition: color 0.3s ease;
}

body:not(.light-theme):not(.light-background-active) a:hover {
    color: #93c5fd !important;
    text-shadow: 0 0 8px rgba(147, 197, 253, 0.5);
}

/* Покращення списків */
body:not(.light-theme) ul,
body:not(.light-theme) ol {
    color: var(--dark-text-secondary) !important;
}

body:not(.light-theme) li {
    color: var(--dark-text-secondary) !important;
}

/* Покращення таблиць */
body:not(.light-theme) table {
    background: var(--dark-bg-secondary) !important;
    border: 2px solid var(--dark-border) !important;
    color: var(--dark-text-primary) !important;
}

body:not(.light-theme) th,
body:not(.light-theme) td {
    border: 1px solid var(--dark-border) !important;
    color: var(--dark-text-secondary) !important;
    padding: 12px !important;
}

body:not(.light-theme) th {
    background: var(--dark-bg-tertiary) !important;
    color: var(--dark-text-primary) !important;
    font-weight: 600;
}

/* Покращення скролбарів для всього сайту */
body:not(.light-theme) ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body:not(.light-theme) ::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
}

body:not(.light-theme) ::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.7);
    border-radius: 6px;
    border: 2px solid rgba(30, 41, 59, 0.5);
}

body:not(.light-theme) ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.9);
}

/* Покращення контрастності тексту на всіх елементах */
body:not(.light-theme) .company-name {
    color: var(--dark-text-accent) !important;
    font-weight: 600;
}

body:not(.light-theme) .job-title,
body:not(.light-theme) .vacancy-title {
    color: var(--dark-text-primary) !important;
    font-weight: 600;
}

body:not(.light-theme) .description,
body:not(.light-theme) .vacancy-description {
    color: var(--dark-text-secondary) !important;
    line-height: 1.6;
}

/* Описи в картках спеціалістів — світлий текст у темній темі (картки мають клас .specialist-item) */
body:not(.light-theme) .specialist-item .specialist-description,
body:not(.light-theme) .specialist-card .specialist-description,
body:not(.light-theme) .specialist-description {
    color: #cbd5e1 !important;
}

body:not(.light-theme) .meta,
body:not(.light-theme) .date,
body:not(.light-theme) .salary,
body:not(.light-theme) .location {
    color: var(--dark-text-muted) !important;
    font-size: 0.9rem;
}

/* Адаптивність */
@media (max-width: 768px) {
    body:not(.light-theme) input[type="text"],
    body:not(.light-theme) input[type="email"],
    body:not(.light-theme) input[type="search"],
    body:not(.light-theme) textarea,
    body:not(.light-theme) select {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    body:not(.light-theme) .btn,
    body:not(.light-theme) button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
} 