/**
 * Standalone Terugvalanalyse - App-Ready Styling
 * Versie: App-Ready (Definitieve GPU-Layer Spinner Fix voor iOS)
 * Update: ACCORDEON STYLING TOEGEVOEGD (#69686933)
 */

/* --- 1. iOS/Android Form Resets --- */
input, textarea, button, select, .app-btn, .btn {
    -webkit-appearance: none;
    appearance: none;
    font-size: 16px !important; 
    border: none;
    color: inherit;
    outline: none;
}

/* --- 2. Main Layout Reset & Sticky Footer Logic --- */
html, body { height: 100%; }
body.app-ready { background-color: #f4f7f6; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; color: #2c3e50; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
.app-container { max-width: 600px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; flex: 1; 
}


/* --- 3. Native App Header Styling --- */
.app-header-native {
    background-color: #2c3e50;
    color: #ffffff;
    padding-top: calc(20px + env(safe-area-inset-top)); 
    padding-bottom: 45px;
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 0 0 30px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-top: -1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.header-left { flex: 1; display: flex; }
.header-right { 
    flex: 1; 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
}

.app-back-btn {
    background-color: #ffffff;
    color: #2c3e50 !important;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center; gap: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.app-header-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- 4. Anti-Freeze Spinner Overlay --- */
.app-spinner-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 20000;
    display: flex; 
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transform: translateZ(0);
    will-change: opacity, visibility;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.app-spinner-overlay.active-spinner {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

.pure-css-loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: pure-spin 1s linear infinite;
    margin: 0 auto 15px auto;
    transform: translateZ(0);
}

.pure-css-loader-small {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: pure-spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes pure-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text { font-weight: 700; color: #2c3e50; text-align: center; }

/* --- 5. Content Area --- */
.app-content { margin-top: 20px; padding: 0 15px; flex: 1; }
.app-view-container { padding-top: 20px; }

/* --- 6. Card Design System --- */
.app-card { background-color: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); margin-bottom: 25px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.4); }
.app-card .card-header { padding: 20px 20px 10px 20px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.app-card .card-body { padding: 15px; }

/* --- 6.1 Info Accordeon Styling --- */
.info-accordion-card {
    margin-bottom: 20px;
    padding: 0 !important; /* Reset padding voor de balk */
}

.accordion-header-bar {
    background-color: #69686933; /* Gevraagde kleur */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.accordion-header-bar:active {
    background-color: #69686955;
}

.accordion-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
}

.accordion-icon {
    font-size: 0.9rem;
    color: #7f8c8d;
    transition: transform 0.3s ease;
}

.info-accordion-card.is-open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
    background-color: #ffffff;
}

.info-accordion-card.is-open .accordion-panel {
    max-height: 500px; /* Voldoende ruimte voor de tekst */
    padding: 20px;
}

.accordion-panel p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #34495e;
}

/* --- 7. App Action Buttons --- */
.app-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
	margin-top: 20px;
    transition: transform 0.1s;
    color: #ffffff !important;
}

.app-btn:active { transform: scale(0.97); }
.btn-success { background-color: #27ae60; }
.btn-info { background-color: #3498db; }
.btn-primary { background-color: #3b82f6; }
.btn-secondary { background-color: #ecf0f1; color: #2c3e50 !important; }

/* --- 8. Native Data List --- */
.native-data-list { display: flex; flex-direction: column; }
.analysis-row { padding: 15px 5px; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 8px; }
.analysis-row:last-child { border-bottom: none; }
.row-top-bar { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.row-item-compact { display: flex; align-items: center; gap: 8px; }
.row-item-full { display: flex; flex-direction: column; width: 100%; line-height: 1.4; }
.row-label { font-weight: 800; color: #2c3e50; font-size: 0.85rem; }
.row-value { color: #5d6d7e; font-size: 0.95rem; word-wrap: break-word; }
.row-item-full .row-label { margin-bottom: 2px; }

.delete-btn-trash { background: none; border: none; color: #e74c3c; font-size: 1.2rem; padding: 10px; margin-right: 5px; cursor: pointer; }
.view-btn-pill { background-color: #3498db; color: #ffffff !important; padding: 6px 18px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 3px 8px rgba(52, 152, 219, 0.2); }

.card-footer-simple { padding: 10px 15px 20px 15px; text-align: center; }
.app-btn-pill-secondary { background-color: #3498db !important; color: #ffffff !important; padding: 12px 30px; border-radius: 50px; font-size: 0.9rem; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); }

/* --- 23. Sticky Footer --- */
.app-footer { text-align: center; padding: 25px 20px; margin-top: auto; color: #ffffff; background-color: #2c3e50; border-radius: 20px 20px 0 0; }

/* ==========================================================================
   WIZARD / JOURNEY STYLING (GECORRIGEERD VOOR iPHONE SCROLL)
   ========================================================================== */

body.journey-active { 
    padding: 0 !important; 
    background-color: #000; 
    overflow-y: auto !important; 
    -webkit-overflow-scrolling: touch;
}

.reflective-journey { 
    position: relative; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 5px; 
}

.journey-form { 
    z-index: 2; 
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    max-width: 750px; 
    margin: 0 auto; 
}

.journey-content-wrapper {
    margin-top: 0px; 
    padding: 0 15px;
}

.background-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; }
.background-image { position: absolute; width: 100%; height: 100%; background-size: cover; background-position: center; transition: opacity 1.5s ease-in-out; }
.background-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background: rgba(0, 0, 0, 0.3); }

.journey-progress { 
    padding: 15px 0 5px 0; 
    text-align: center; 
}
.progress-dots { display: flex; justify-content: center; gap: 8px; }
.dot { width: 8px; height: 8px; background: rgba(255, 255, 255, 0.3); border-radius: 50%; }
.dot.active { background: #ffffff; transform: scale(1.3); }

.form-step { 
    width: 100%; 
    display: none; 
    padding: 0.5rem 0; 
    scroll-margin-top: 140px;
}
.form-step.active { display: block; }

.journey-card { margin-bottom: 8px !important; }
.journey-card .card-body { padding: 15px 20px !important; }

.step-icon-container { width: 50px; height: 50px; background: #e0f2fe; color: #3498db; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; margin: 0 auto 10px auto; }
.step-title { font-family: 'Merriweather', serif; font-size: 1.4rem; text-align: center; margin-bottom: 4px; color: #2c3e50; font-weight: 700; }
.step-description { text-align: center; color: #5d6d7e; font-size: 0.9rem; margin-bottom: 15px; line-height: 1.4; }

.app-form-control { width: 100% !important; min-height: 100px; border: 1px solid #dcdde1; border-radius: 12px; padding: 12px; background-color: #fcfcfc; color: #111827; font-size: 16px !important; line-height: 1.5; resize: none; display: block; }

.context-box { background-color: rgba(52, 152, 219, 0.12); border-left: 4px solid #3498db; padding: 10px 15px; margin-bottom: 12px; border-radius: 0 8px 8px 0; text-align: left; }
.context-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: #2980b9; margin-bottom: 2px; }
.context-answer { font-style: italic; color: #1e293b !important; font-size: 0.9rem; margin: 0; }

.ai-feedback-container { margin-top: 12px; padding: 12px; background-color: #f0f7ff; border-radius: 12px; color: #2c3e50; font-size: 0.85rem; line-height: 1.5; display: none; border-left: 4px solid #0ea5e9; text-align: left; }

.journey-navigation { display: flex; flex-direction: column; gap: 8px; margin-top: 0; padding-bottom: 30px; }
.nav-button-row { display: flex; flex-direction: row; justify-content: space-between; gap: 10px; }
.nav-button-row .app-btn { flex: 1; margin-bottom: 0; padding: 12px 22px; font-size: 0.9rem; }

/* Timeline styling behouden */
.analysis-timeline { position: relative; padding: 20px 0 20px 25px; margin-bottom: 30px; }
.analysis-timeline::before { content: ''; position: absolute; left: 0; top: 60px; bottom: 20px; width: 2px; background: rgba(44, 62, 80, 0.15); }


.timeline-header { font-family: 'Merriweather', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1.2rem; font-weight: 800; color: #2c3e50; margin-bottom: 20px; margin-left: -15px; display: flex; align-items: center; gap: 10px; }
.timeline-item { position: relative; margin-bottom: 15px; }
.timeline-badge { position: absolute; left: -37px; top: 25px; width: 26px; height: 26px; background-color: #2c3e50; color: #ffffff; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; z-index: 5; }
.accent-badge { background-color: #3498db; }
.detail-label { display: block; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: #3498db; margin-bottom: 5px; }
.detail-value { color: #2c3e50; font-size: 0.9rem; line-height: 1.5; }