/* --- 1. VARIABELEN & BASIS --- */
:root {
    --primary: #0284c7;
    --primary-light: #f0f9ff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

/* --- 2. NAVIGATIE & HEADER --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    width: 100%;
}

header { 
    text-align: center; 
    margin-bottom: 40px; 
    padding: 0 20px;
}

h1 { 
    font-size: 2.8rem; 
    color: var(--primary); 
    margin: 0; 
    letter-spacing: -1px; 
    font-weight: 800; 
}

header p, .subtitle { 
    color: var(--text-muted); 
    margin-top: 5px; 
    font-size: 1.1rem; 
}

/* --- 3. FILTER BALK & INPUTS --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.filter-bar {
    display: flex;
    gap: 15px;
    background: var(--card-bg);
    padding: 12px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 30px 0;
    border: 1px solid var(--border);
}

#searchInput, #categoryFilter {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 1rem;
    outline: none;
    background: var(--card-bg);
    color: inherit;
}

#searchInput { flex: 2; }
#categoryFilter { flex: 1; cursor: pointer; }

/* --- 4. DE LIJST (GRID & CARDS) --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 0;
    list-style: none;
}

.item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.item-header strong { 
    font-size: 1.5rem; 
    color: var(--primary); 
    display: block; 
    margin-bottom: 8px; 
}

.tag-container { 
    display: flex; 
    gap: 6px; 
    flex-wrap: wrap; 
    margin-bottom: 12px; 
}

.category-tag {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.item p {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-main);
}

/* --- 5. KNOPPEN & FOOTER --- */
.btn-subtle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-subtle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 14px 28px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: bold; 
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn:hover { background: #0369a1; }

.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--text-muted);
}

/* --- 6. MODALS --- */
.modal { 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.85); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000; 
    padding: 20px; 
}

.modal-content { 
    background: white; 
    padding: 20px 30px 30px; 
    border-radius: 20px; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); 
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    /* Verklein de witruimte aan de bovenkant van de pop-up container */
    padding-top: 15px !important; /* Was waarschijnlijk 20px of 30px */
}

/* Verwijder de standaard ruimte boven de titel */
.modal-content h2 {
    margin-top: 5 !important;
    padding-top: 0 !important;
    margin-bottom: 15px; /* Houdt een beetje afstand tot de tekst eronder */
}
/* Verklein de ruimte tussen de FAQ titel en de tekst */
.faq-item strong {
    margin-bottom: 2px !important; /* Ruimte onder de titel */
}

.faq-item p {
    margin-top: 0 !important;      /* Verwijder de standaard witruimte boven de paragraaf */
    padding-top: 0 !important;
}



/* --- 7. MOBIEL --- */
@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .top-nav { padding: 15px 20px; }
    .filter-bar { flex-direction: column; }
    .btn { width: 100%; }
}

/* --- 8. DARK MODE --- */

/* Gecombineerde selector voor systeem-instelling en handmatige knop */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme) { background-color: #121212 !important; color: #ffffff !important; }
    body:not(.light-theme) .filter-bar, 
    body:not(.light-theme) li.item, 
    body:not(.light-theme) #searchInput, 
    body:not(.light-theme) #categoryFilter,
    body:not(.light-theme) .modal-content,
    body:not(.light-theme) .site-footer {
        background-color: #1e1e1e !important;
        border-color: #333 !important;
        color: white !important;
    }
    body:not(.light-theme) .item:hover { background-color: #2a2a2a !important; }
    body:not(.light-theme) .item-header strong { color: #4da3ff !important; }
    body:not(.light-theme) .item p { border-top: 1px solid #444 !important; color: #ffffff !important; }
    
    /* Disciplines / Tags in Dark Mode */
    body:not(.light-theme) .category-tag {
        background-color: #333333 !important;
        color: #4da3ff !important;
        border: 1px solid #444 !important;
    }
    /* Knoppen in Dark Mode */
    body:not(.light-theme) .btn-subtle {
        background-color: #1e1e1e !important;
        color: #bbbbbb !important;
        border-color: #333 !important;
    }
}

/* Specifiek voor als de klasse via JS wordt toegevoegd */
body.dark-theme {
    background-color: #121212 !important;
    color: #ffffff !important;
}
body.dark-theme .filter-bar, 
body.dark-theme li.item, 
body.dark-theme #searchInput, 
body.dark-theme #categoryFilter,
body.dark-theme .modal-content,
body.dark-theme .site-footer {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: white !important;
}
body.dark-theme .item:hover { background-color: #2a2a2a !important; }
body.dark-theme .item-header strong { color: #4da3ff !important; }
body.dark-theme .item p { border-top: 1px solid #444 !important; color: #ffffff !important; }
body.dark-theme .category-tag {
    background-color: #333333 !important;
    color: #4da3ff !important;
    border: 1px solid #444 !important;
}
body.dark-theme .btn-subtle {
    background-color: #1e1e1e !important;
    color: #bbbbbb !important;
    border-color: #333 !important;
}

.warning-icon {
    margin-left: 8px;
    font-size: 1.2rem;
    cursor: help;
    vertical-align: middle;
}

/* --- THEMA KNOP STYLING --- */

/* --- DE THEMA-KNOP (HELEMAAL ONDERAAN ZETTEN) --- */

/* Forceer zwart in Light Mode */
html body #theme-toggle {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: none !important;
}

/* Forceer wit in Dark Mode (zowel systeem als handmatig) */
@media (prefers-color-scheme: dark) {
    html body:not(.light-theme) #theme-toggle {
        background-color: #ffffff !important;
        color: #000000 !important;
        border: none !important;
    }
}

html body.dark-theme #theme-toggle {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: none !important;
}