/* Q/A Systeem - Basis Variabelen */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #14b8a6;
    --accent: #f59e0b;
    --text-dark: #111827;
    --text-light: #374151;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --content-width: 950px;
}

/* Basis stijlen */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background: var(--bg-light); 
    color: var(--text-dark); 
    line-height: 1.6; 
    padding-bottom: 3rem; 
    overflow-x: hidden; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}

/* Header styling */
header { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: white; 
    padding: 2rem 1rem; 
    text-align: center; 
    position: relative; 
    overflow: hidden; 
}
header::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%), 
                radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%); 
    pointer-events: none; 
}
.header-content { 
    position: relative; 
    z-index: 2; 
    max-width: 800px; 
    margin: 0 auto; 
}
h1 { 
    margin: 0 0 1rem 0; 
    font-weight: 700; 
    font-size: 2rem; 
    letter-spacing: -0.025em; 
}
.header-intro { 
    opacity: 0.9; 
    max-width: 800px; 
    margin: 0 auto; 
    font-size: 1.1rem; 
}

/* Main container */
main { 
    max-width: var(--content-width); 
    margin: 0 auto; 
    padding: 0 1rem; 
    position: relative; 
    z-index: 10; 
    width: 100%; 
    overflow-x: hidden; 
}

/* Zoekbalk */
.search-container { 
    margin: 1.5rem auto 2rem auto; 
    max-width: 650px; 
    position: relative; 
}
#search { 
    width: 100%; 
    padding: 1rem 1rem 1rem 3rem; 
    font-size: 1rem; 
    border: 1px solid var(--border-light); 
    background: var(--bg-white); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    outline: none; 
    transition: all 0.2s ease; 
}
#search:focus { 
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), var(--shadow); 
    border-color: var(--primary-light); 
}
.search-icon { 
    position: absolute; 
    left: 1rem; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-muted); 
    font-size: 1.2rem; 
}

/* FAQ Container layout */
.faq-container { 
    margin-top: 2rem; 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 2rem; 
}

/* Categorieën navigatie */
.categories { margin-bottom: 1.5rem; }
.category-list { 
    position: sticky; 
    top: 2rem; 
    list-style: none; 
    padding: 0; 
}
.category-item { margin-bottom: 0.5rem; }
.category-link { 
    display: flex; 
    align-items: center; 
    padding: 0.75rem 1rem; 
    color: var(--text-light); 
    text-decoration: none; 
    border-radius: var(--radius-sm); 
    font-weight: 500; 
    transition: all 0.2s ease; 
}
.category-link:hover { 
    background: rgba(99, 102, 241, 0.1); 
    color: var(--primary); 
}
.category-link.active { 
    background: var(--primary); 
    color: white; 
}
.category-icon { 
    margin-right: 0.75rem; 
    font-size: 1.1rem; 
}

/* FAQ Inhoud */
.faq-content { min-width: 0; }
.category-section { 
    margin-bottom: 3rem; 
    background: var(--bg-white); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    overflow: hidden; 
}
.category-header { 
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: white; 
    padding: 1.25rem 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
}
.category-header h2 { 
    margin: 0; 
    font-size: 1.3rem; 
    font-weight: 600; 
    letter-spacing: -0.025em; 
    border: none; 
}
.question-list { padding: 1.5rem; }

/* Vragen en Antwoorden */
details { 
    margin-bottom: 1.25rem; 
    border: 1px solid var(--border-light); 
    border-radius: var(--radius-sm); 
    overflow: hidden; 
    transition: all 0.3s ease; 
}
details:last-child { margin-bottom: 0; }
summary { 
    padding: 1rem 1.25rem; 
    font-weight: 500; 
    cursor: pointer; 
    background: var(--bg-light); 
    position: relative; 
    outline: none; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    list-style: none; 
    width: 100%; 
    box-sizing: border-box; 
}
summary::-webkit-details-marker { display: none; }
summary::after { 
    content: "+"; 
    font-weight: 700; 
    font-size: 1.25rem; 
    color: var(--primary); 
    margin-left: 0.5rem; 
    transition: transform 0.3s ease; 
    flex-shrink: 0; 
}
details[open] summary::after { 
    content: "−"; 
    transform: rotate(0deg); 
}
details[open] summary { 
    border-bottom: 1px solid var(--border-light); 
    background: white; 
    font-weight: 600; 
    color: var(--primary-dark); 
}
.answer { 
    padding: 1.25rem; 
    color: var(--text-dark); 
    line-height: 1.6; 
    background: white; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    hyphens: auto; 
}
.answer p { margin-bottom: 1rem; }
.answer p:last-child { margin-bottom: 0; }
.answer a { 
    color: var(--primary); 
    text-decoration: underline; 
    font-weight: 500; 
    word-break: break-all; 
}
.answer a:hover { color: var(--primary-dark); }
.highlight { 
    border: 2px solid var(--primary) !important; 
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); 
}
.linkref { 
    display: block; 
    margin-top: 1rem; 
    font-size: 0.9rem; 
    border-top: 1px dashed var(--border-light); 
    padding-top: 0.75rem; 
}
.linkref a { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 500; 
    display: inline-flex; 
    align-items: center; 
}
.linkref a:hover { text-decoration: underline; }
.linkref a i { margin-right: 0.5rem; }

/* Stijlen voor kopieerfunctionaliteit */
.chat-command-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    background-color: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 2px;
}
.chat-command {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #6366f1;
    padding-right: 4px;
}
.copy-btn {
    border: none;
    background: transparent;
    color: #6366f1;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.copy-btn:hover {
    opacity: 1;
    background-color: rgba(99, 102, 241, 0.2);
}

/* Animaties voor kopieerknop */
.copy-success {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #6366f1;
    color: white;
    border-radius: 3px;
    transform: scale(0);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.copy-success-active .copy-success {
    transform: scale(1);
    opacity: 1;
}
.copy-error {
    animation: shake 0.4s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Feedback elementen */
.copy-feedback {
    display: none;
    margin-left: 0.5em;
    color: var(--primary);
    font-size: 0.95em;
}
.copy-feedback.visible {
    display: inline;
}
.noresults {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}
.noresults.visible {
    display: block;
    text-align: center;
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.noresults i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--primary-light);
    opacity: 0.5;
}

/* Scroll naar boven knop */
.scroll-top {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    cursor: pointer;
}
.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}
.scroll-top:hover, .scroll-top:focus {
    background: var(--primary-dark);
}
.scroll-top i {
    font-size: 1.2rem;
}

/* Footer Styles */
.aw-footer {
    margin-top: 2rem;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-white);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Admin Stijlen */
.admin-box, .loginbox {
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 2.5rem;
    margin: 40px auto;
}
.admin-box {
    max-width: 1100px;
}
.loginbox {
    max-width: 350px;
}
.admin-table, .admin-box table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 1rem;
}
.admin-table th, .admin-box th, .admin-table td, .admin-box td {
    padding: 0.7rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}
.admin-table th, .admin-box th {
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
}
.admin-table .row-alt {
    background: #f7f7f7;
}
.admin-box h2, .admin-box h3, .loginbox h2 {
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
}
.admin-box label, .loginbox label {
    color: var(--text-dark);
    font-weight: 500;
}
.admin-box input[type="text"], .admin-box input[type="password"], .admin-box textarea, .admin-box select,
.loginbox input[type="text"], .loginbox input[type="password"] {
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 1rem;
}
.admin-box button, .loginbox button {
    padding: 0.7rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.admin-box button:hover, .loginbox button:hover {
    background: var(--primary-dark);
}
.admin-box a, .loginbox a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.admin-box a.logout {
    color: #b91c1c;
    font-weight: bold;
}
.admin-box a:hover, .loginbox a:hover {
    text-decoration: underline;
}
.admin-box .error, .loginbox .error {
    color: #b91c1c;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Verbeterde formulier-layout voor admin */
.admin-form-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.admin-form-section h3 {
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    align-items: start;
}
.admin-form-grid .field-group {
    display: flex;
    flex-direction: column;
}
.admin-form-grid .field-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}
.admin-form-grid .field-group input,
.admin-form-grid .field-group select,
.admin-form-grid .field-group textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-light);
}
.admin-form-grid .field-group textarea {
    min-height: 100px;
    resize: vertical;
}
.admin-form-grid .field-group input:focus,
.admin-form-grid .field-group select:focus,
.admin-form-grid .field-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.admin-form-grid .cat-name-field {
    grid-column: span 8;
}
.admin-form-grid .cat-icon-field {
    grid-column: span 4;
}
.admin-form-grid .question-cat-field {
    grid-column: span 3;
}
.admin-form-grid .question-field {
    grid-column: span 9;
}
.admin-form-grid .answer-field {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}
.admin-form-grid .button-group {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    margin-top: 1.25rem;
    gap: 0.75rem;
}
.admin-form-grid .button-group button {
    min-width: 120px;
}
.admin-form-grid .button-group a {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid var(--border-light);
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
}
.admin-form-grid .button-group a:hover {
    background: var(--border-light);
    text-decoration: none;
}

/* Media queries - Desktop */
@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    header { padding: 3rem 2rem; }
    .faq-container { grid-template-columns: 220px 1fr; gap: 3rem; }
    main { padding: 0 2rem; }
}

/* Media queries - Mobiel */
@media (max-width: 767px) {
    body { font-size: 15px; overflow-x: hidden; width: 100%; }
    header { padding: 1.5rem 1rem; }
    .header-intro { font-size: 0.95rem; line-height: 1.5; }
    .search-container { margin: 1.25rem auto 1.5rem auto; }
    #search { padding: 0.85rem 0.85rem 0.85rem 2.5rem; font-size: 0.95rem; border-radius: var(--radius-sm); }
    .search-icon { left: 0.85rem; font-size: 1rem; }
    main { padding: 0 0.75rem; overflow-x: hidden; max-width: 100%; }
    .faq-container { margin-top: 1rem; gap: 1rem; width: 100%; }
    
    /* Mobiele categorie navigatie */
    .categories { 
        margin-bottom: 1rem; 
        background: var(--bg-white); 
        padding: 0.5rem; 
        border-radius: var(--radius-sm); 
        box-shadow: var(--shadow-sm); 
        width: 100%; 
        overflow-x: auto; 
        position: relative; 
    }
    .categories::before, .categories::after { 
        content: ''; 
        position: absolute; 
        top: 0; bottom: 0; 
        width: 20px; 
        pointer-events: none; 
        z-index: 2; 
    }
    .categories::before { 
        left: 0; 
        background: linear-gradient(to right, var(--bg-white) 0%, transparent 100%); 
    }
    .categories::after { 
        right: 0; 
        background: linear-gradient(to left, var(--bg-white) 0%, transparent 100%); 
    }
    .category-list { 
        display: flex; 
        flex-wrap: nowrap; 
        overflow-x: auto; 
        gap: 0.5rem; 
        padding-bottom: 1rem; 
        -webkit-overflow-scrolling: touch; 
        scrollbar-width: none; 
        position: relative; 
        top: 0; 
        margin-bottom: 0.5rem; 
        padding-right: 40px; 
        animation: hintScroll 2s ease-in-out 1s 1; 
    }
    .category-list::after { 
        content: '>'; 
        display: block; 
        position: absolute; 
        right: 10px; 
        top: 50%; 
        transform: translateY(-50%); 
        color: var(--primary); 
        font-size: 1.2rem; 
        font-weight: bold; 
        opacity: 0.7; 
        animation: pulseIndicator 2s infinite; 
    }
    .category-list::-webkit-scrollbar { display: none; }
    .category-item { flex: 0 0 auto; margin-bottom: 0; }
    .category-link { 
        white-space: nowrap; 
        padding: 0.6rem 1rem; 
        border: 1px solid var(--border-light); 
        background: white; 
        font-size: 0.9rem; 
        border-radius: var(--radius-sm); 
        box-shadow: var(--shadow-sm);
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .category-link .category-icon { font-size: 1rem; }
    
    /* Mobiele Q&A stijlen */
    .category-section { margin-bottom: 1.5rem; border-radius: var(--radius-sm); width: 100%; }
    .category-header { padding: 0.85rem 1rem; }
    .category-header h2 { font-size: 1.1rem; }
    .question-list { padding: 0.85rem; }
    .answer { 
        padding: 0.85rem; 
        font-size: 0.95rem; 
        max-width: 100%; 
        overflow-wrap: break-word; 
        word-break: break-word; 
    }
    details { margin-bottom: 0.85rem; border-radius: var(--radius-sm); width: 100%; }
    summary { 
        padding: 0.75rem 1rem; 
        font-size: 0.95rem; 
        white-space: normal;
        min-height: 44px;
        flex-wrap: wrap;
        justify-content: space-between;
        line-height: 1.4;
    }
    summary::after { font-size: 1.1rem; flex-shrink: 0; }
    .linkref { margin-top: 0.85rem; padding-top: 0.6rem; font-size: 0.8rem; }
    
    /* Animaties en speciale effecten */
    @keyframes pulseIndicator { 
        0% { opacity: 0.5; } 
        50% { opacity: 1; } 
        100% { opacity: 0.5; } 
    }
    @keyframes hintScroll { 
        0% { transform: translateX(0); } 
        15% { transform: translateX(-30px); } 
        30% { transform: translateX(0); } 
        100% { transform: translateX(0); } 
    }
    
    /* Mobiele tekst opmaak */
    .answer strong { display: inline-block; margin-bottom: 0.3rem; }
    .answer ul, .answer ol { padding-left: 1.2rem; margin-left: 0; margin-right: 0; }
    .answer code, .answer pre { white-space: pre-wrap; word-wrap: break-word; max-width: 100%; }
    .answer table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    
    /* Mobiele chat command styling */
    .chat-command-container {
        display: inline-flex;
        align-items: center;
        margin: 0.1rem 0;
    }
    .chat-command { 
        display: inline-block; 
        font-family: monospace; 
        background-color: var(--primary-light, #e5e7ff); 
        color: var(--primary-dark, #4f46e5); 
        padding: 0.25rem 0.6rem; 
        border-radius: 4px 0 0 4px;
        font-weight: bold;
        border: 1px solid var(--primary, #6366f1);
        border-right: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }
    .copy-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: var(--primary, #6366f1);
        color: white;
        border: 1px solid var(--primary, #6366f1);
        border-radius: 0 4px 4px 0;
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
        cursor: pointer;
        transition: background-color 0.2s;
        height: 100%;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }
    .copy-btn:hover {
        background-color: var(--primary-dark, #4f46e5);
    }
    .copy-btn:active {
        transform: translateY(1px);
    }
    
    /* Admin formulier responsiviteit */
    .admin-form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .admin-form-grid .cat-name-field,
    .admin-form-grid .cat-icon-field,
    .admin-form-grid .question-cat-field,
    .admin-form-grid .question-field,
    .admin-form-grid .answer-field {
        grid-column: 1 / -1;
    }
}

/* Extra kleine schermen */
@media (max-width: 360px) { 
    body { font-size: 14px; } 
    .answer { padding: 0.75rem; font-size: 0.9rem; } 
    summary { padding: 0.7rem 0.85rem; font-size: 0.9rem; } 
    .category-header h2 { font-size: 1rem; } 
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root { 
        --bg-light: #111827; 
        --bg-white: #1f2937; 
        --text-dark: #f9fafb; 
        --text-light: #d1d5db; 
        --text-muted: #9ca3af; 
        --border-light: #374151; 
    }
    #search { 
        background: #283142; 
        border-color: #374151; 
        color: #e5e7eb; 
    }
    #search::placeholder { color: #9ca3af; }
    details { border-color: #374151; }
    summary { background: #1a1f2e; color: #e5e7eb; }
    details[open] summary { background: #283142; border-color: #374151; color: #f9fafb; }
    .answer { color: #f9fafb; background: #1f2937; }
    .category-link:not(.active) { color: #d1d5db; }
    .category-link:hover:not(.active) { background: rgba(99, 102, 241, 0.2); }
    .admin-table .row-alt { background: #23293a; }
    
    /* Dark mode chat command styling */
    .chat-command { 
        background-color: #2d3748; 
        color: #93c5fd; 
        border-color: #4b5563; 
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
        text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    }
    .copy-btn {
        background-color: #4b5563;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    .copy-btn:hover {
        background-color: #374151;
    }
    
    /* Mobiel dark mode */
    @media (max-width: 767px) { 
        .category-link { background: #1f2937; border-color: #374151; } 
        .categories { background: #1f2937; border-color: #374151; } 
        .categories::before { background: linear-gradient(to right, #1f2937 0%, transparent 100%); } 
        .categories::after { background: linear-gradient(to left, #1f2937 0%, transparent 100%); } 
        summary:active, .category-link:active { background: #2d3748; } 
        .answer strong { color: #d1d5db; } 
    }
}
