/*
 * JovAI Theme - Warm teal AI colors
 * AI for the curious mind - optimistic, grounded, approachable
 */

:root {
    /* Primary colors */
    --color-primary: #0d7377;
    --color-primary-light: #14a3a8;
    --color-section-bg: #e6f5f4;

    /* Gradients */
    --gradient-primary: linear-gradient(90deg, #0d7377, #14a3a8);
    --gradient-sidebar: linear-gradient(180deg, #0d7377 0%, #14a3a8 100%);
    --gradient-button: linear-gradient(135deg, #0d7377, #14a3a8);
    --gradient-welcome: linear-gradient(135deg, #e6f5f4 0%, #f0faf9 100%);

    /* Tooltip */
    --color-tooltip-bg: rgba(13, 115, 119, 0.95);
}

/* Filter visibility rules */
.filter-container:has(#filter-llms:checked) ~ .content .section[data-tags*="llms"] {
    display: block;
}

.filter-container:has(#filter-applications:checked) ~ .content .section[data-tags*="applications"] {
    display: block;
}

.filter-container:has(#filter-fundamentals:checked) ~ .content .section[data-tags*="fundamentals"] {
    display: block;
}

.filter-container:has(#filter-society:checked) ~ .content .section[data-tags*="society"] {
    display: block;
}

/* Filter chip active states */
#filter-all:checked ~ .quick-filter-bar label[for="filter-all"],
#filter-llms:checked ~ .quick-filter-bar label[for="filter-llms"],
#filter-applications:checked ~ .quick-filter-bar label[for="filter-applications"],
#filter-fundamentals:checked ~ .quick-filter-bar label[for="filter-fundamentals"],
#filter-society:checked ~ .quick-filter-bar label[for="filter-society"] {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 115, 119, 0.3);
}

#filter-all:checked ~ .quick-filter-bar label[for="filter-all"] .chip-count,
#filter-llms:checked ~ .quick-filter-bar label[for="filter-llms"] .chip-count,
#filter-applications:checked ~ .quick-filter-bar label[for="filter-applications"] .chip-count,
#filter-fundamentals:checked ~ .quick-filter-bar label[for="filter-fundamentals"] .chip-count,
#filter-society:checked ~ .quick-filter-bar label[for="filter-society"] .chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* TOC sync rules - grey out non-matching TOC links when a filter is active */

/* LLMs filter: hide non-llms articles (alphafold, ai-medicine, what-is-ml, self-driving, ai-weather, deepfakes) */
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#alphafold"],
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#ai-medicine"],
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#what-is-ml"],
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#self-driving"],
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#ai-weather"],
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#deepfakes"],
body:has(#filter-llms:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

/* Applications filter: hide non-applications articles (chatgpt-works, what-is-ml, ai-art, deepfakes, open-source-ai) */
body:has(#filter-applications:checked) .toc-sidebar .toc-link[href="#chatgpt-works"],
body:has(#filter-applications:checked) .toc-sidebar .toc-link[href="#what-is-ml"],
body:has(#filter-applications:checked) .toc-sidebar .toc-link[href="#ai-art"],
body:has(#filter-applications:checked) .toc-sidebar .toc-link[href="#deepfakes"],
body:has(#filter-applications:checked) .toc-sidebar .toc-link[href="#open-source-ai"],
body:has(#filter-applications:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

/* Fundamentals filter: hide non-fundamentals articles (alphafold, ai-medicine, ai-art, deepfakes, open-source-ai) */
body:has(#filter-fundamentals:checked) .toc-sidebar .toc-link[href="#alphafold"],
body:has(#filter-fundamentals:checked) .toc-sidebar .toc-link[href="#ai-medicine"],
body:has(#filter-fundamentals:checked) .toc-sidebar .toc-link[href="#ai-art"],
body:has(#filter-fundamentals:checked) .toc-sidebar .toc-link[href="#deepfakes"],
body:has(#filter-fundamentals:checked) .toc-sidebar .toc-link[href="#open-source-ai"],
body:has(#filter-fundamentals:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

/* Society filter: hide non-society articles (chatgpt-works, alphafold, what-is-ml, self-driving, ai-weather) */
body:has(#filter-society:checked) .toc-sidebar .toc-link[href="#chatgpt-works"],
body:has(#filter-society:checked) .toc-sidebar .toc-link[href="#alphafold"],
body:has(#filter-society:checked) .toc-sidebar .toc-link[href="#what-is-ml"],
body:has(#filter-society:checked) .toc-sidebar .toc-link[href="#self-driving"],
body:has(#filter-society:checked) .toc-sidebar .toc-link[href="#ai-weather"],
body:has(#filter-society:checked) .toc-sidebar .toc-link[href="#welcome"] {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}
