/*
 * Standalone Terugvalanalyse - Applicatie CSS
 * Versie: Definitief Gecorrigeerd
 * Beschrijving: Dit bestand bevat alle styling voor de Terugvalanalyse applicatie,
 * inclusief de algemene layout, specifieke pagina's en de 'Reflective Journey' wizard.
 */

/* ==========================================================================
   1. ROOT VARIABELEN & BASIS STYLING
   ========================================================================== */
:root {
    --primary-color: #3b82f6;
    --success-color: #16a34a;
    --info-color: #0ea5e9;
    --warning-color: #f9c74f;
    --danger-color: #dc3545;
    --text-dark: #1f2937;
    --text-light: #f9fafb;
    --text-muted: #6b7280;
    --bg-main: #111827;
    --border-color: rgba(255, 255, 255, 0.2);
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Merriweather', serif;
    --white: #ffffff;
    --bg-image-opacity: 0.3;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f3f4f6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: #1d4ed8;
}

/* ==========================================================================
   2. ALGEMENE LAYOUT & COMPONENTEN
   ========================================================================== */
.app-container { max-width: 1200px; margin: 20px auto; background-color: transparent; }
.app-content { padding: 2rem; background-color: var(--white); border-radius: 1rem; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.app-header-v3 { background-color: var(--success-color); color: var(--white); padding: 25px; border-radius: 12px; margin: 0 15px 30px 15px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: center; }
.app-header-v3 .app-title { font-size: 2.8em; display: flex; align-items: center; gap: 15px; margin: 0; font-family: var(--font-serif); }
.app-footer { text-align: center; padding: 20px; margin-top: 50px; color: var(--white); background-color: var(--text-dark); border-radius: 12px; margin: 50px 15px 0 15px; }

.message { padding: 15px 20px; margin-bottom: 20px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.message.success { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.message.error { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-size: 1em; font-weight: 600; text-align: center; border: 1px solid transparent; border-radius: 50px; cursor: pointer; transition: all 0.2s ease-in-out; text-decoration: none; }
.btn, a.btn, button.btn { color: var(--white) !important; }
.btn-primary { background-color: var(--primary-color); } .btn-primary:hover { background-color: #2563eb; }
.btn-success { background-color: var(--success-color); } .btn-success:hover { background-color: #15803d; }
.btn-info { background-color: var(--info-color); } .btn-info:hover { background-color: #0c84b4; }
.btn-warning { background-color: var(--warning-color); color: var(--text-dark) !important; }
.btn-secondary { background-color: #e9ecef; color: var(--text-dark) !important; border: 1px solid #ced4da; } .btn-secondary:hover { background-color: #dee2e6; }

.card { text-align: center; padding: 30px; margin-top: 30px; background-color: #fff; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.card-header-with-btn { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.form-group { text-align: left; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.form-control { width: 100%; background: var(--white); border: 1px solid #ced4da; color: var(--text-dark); font-size: 1rem; padding: 0.75rem 1rem; border-radius: 8px; resize: vertical; transition: border-color 0.2s; }
.form-control:focus { border-color: var(--primary-color); outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

/* ==========================================================================
   3. PAGINA-SPECIFIEKE STYLING
   ========================================================================== */

/* ------------------------------------------
   3.1 Dashboard & Overzichten
   ------------------------------------------ */
.dashboard-window { background-color: #fff; border-radius: 12px; padding: 25px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.card-header-actions { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.section-title { font-size: 1.5em; margin-bottom: 1rem; display: flex; align-items: center; gap: 10px; color: var(--text-dark); text-align: left; }
.section-footer { padding-top: 1.5rem; text-align: center; }

.data-table { width: 100%; border-collapse: collapse; background-color: #fff; box-shadow: 0 5px 25px rgba(0,0,0,0.07); border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid #dee2e6; white-space: nowrap; }
.data-table thead th { background-color: #f8f9fa; font-weight: bold; }

.view-entry-detail-page, .ai-summary-page { padding: 0; }
.view-entry-detail-page .card-header-with-btn h2, .ai-summary-page .card-header-with-btn h2 { font-family: var(--font-heading); color: var(--primary-color); font-size: 2.2em; margin: 0; }
.ai-summary-page .card-header-with-btn h2 { color: var(--info-color); }
.detail-card { padding: 30px; margin-bottom: 20px; text-align: left; border: 1px solid #e5e7eb; }
.detail-card h3 { font-size: 1.5em; margin-bottom: 1.5rem; border-bottom: 1px solid #e0e0e0; padding-bottom: 1rem; font-family: var(--font-heading); }
.detail-list { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.detail-list dt { font-weight: bold; color: var(--text-dark); font-size: 1em; margin-bottom: 0.25rem; }
.detail-list dd { color: var(--text-muted); margin-left: 0; line-height: 1.7; }

.summary-card { background-color: #fff; border-radius: 12px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); overflow: hidden; margin-top: 1.5rem; }
.summary-content { padding: 30px; }
.summary-content .ai-response { background-color: #f8f9fa; border-left: 5px solid var(--info-color); padding: 20px; border-radius: 8px; line-height: 1.7; }
.summary-content .ai-response h3 { font-family: var(--font-heading); margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.2em; color: var(--text-dark); }
.summary-content .ai-response h3:first-child { margin-top: 0; }
.summary-content hr { margin: 20px 0; border: 0; border-top: 1px solid #eee; }
.error-box { background-color: #f8d7da; border-left: 5px solid #721c24; padding: 20px; color: #721c24; border-radius: 8px; }

.email-pdf-section { background-color: #e6f7ff; border: 1px solid #cceeff; padding: 30px; text-align: left; }
.email-pdf-section .btn { display: inline-block; width: auto; }

/* ------------------------------------------
   3.2 Anoniem Dashboard
   ------------------------------------------ */
.anonymous-dashboard { text-align: center; max-width: 700px; margin: 0 auto; padding: 20px 0; }
.anonymous-dashboard h2 { font-size: 2.2em; font-weight: 700; margin-bottom: 1rem; color: var(--text-dark); font-family: var(--font-heading); }
.anonymous-dashboard .intro-text { font-size: 1.1em; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.feature-box { background-color: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 2rem; margin-bottom: 2.5rem; text-align: left; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.feature-box h4 { margin-top: 0; margin-bottom: 1.5rem; font-size: 1.1em; }
.feature-box ul { list-style: none; padding: 0; }
.feature-box li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 0.75rem; margin-bottom: 1rem; }
.feature-box li i { margin-top: 4px; }
.feature-box li .fa-check-circle { color: var(--success-color); }
.feature-box li.warning-item .fa-exclamation-triangle { color: var(--warning-color); }
.btn-xlarge { padding: 1rem 2rem; font-size: 1.2em; text-decoration: none; opacity: 1; }
.account-prompt { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.account-prompt p { margin-bottom: 0.5rem; }

/* ==========================================================================
   4. 'REFLECTIVE JOURNEY' WIZARD STYLING
   ========================================================================== */
body.journey-active { padding: 0 !important; background-color: var(--bg-main); overflow-y: scroll; }
body.journey-active .app-container, body.journey-active .app-content { height: auto; min-height: auto; max-width: 100%; margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; }
body.journey-active .app-header-v3, body.journey-active .app-footer { display: none; }

.reflective-journey { position: relative; min-height: 100vh; display: flex; flex-direction: column; color: var(--white); }
.journey-form { z-index: 2; display: flex; flex-direction: column; width: 100%; max-width: 750px; margin: 0 auto; padding: 0 1.5rem; min-height: 100vh; }
.journey-progress { flex-shrink: 0; padding: 1.5rem 0; }
.progress-dots { display: flex; justify-content: center; gap: 12px; }
.dot { width: 12px; height: 12px; background: rgba(255,255,255,0.3); border-radius: 50%; transition: all 0.4s ease; cursor: pointer; }
.dot.active { background: var(--white); transform: scale(1.3); }
.journey-content { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }

.form-step { width: 100%; text-align: center; display: none; padding: 2rem 0; }
.form-step.active { display: block; animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.step-icon, .transition-icon { font-size: 2rem; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border-color); margin: 0 auto 1.5rem auto; backdrop-filter: blur(5px); }
.step-title, .transition-title { font-family: var(--font-serif); font-size: 2.2rem; margin-bottom: 0.5rem; color: var(--white); }
.step-description, .transition-text { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem; max-width: 550px; margin-left: auto; margin-right: auto; }

body.journey-active .form-control { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.25); color: var(--white); backdrop-filter: blur(5px); }
body.journey-active .form-control::placeholder { color: rgba(255, 255, 255, 0.5); }
body.journey-active .form-control:focus { border-color: var(--primary-color); }

.context-box { background: rgba(0,0,0,0.3); border-left: 3px solid var(--info-color); padding: 1rem; margin-bottom: 1.5rem; border-radius: 4px; text-align: left; }
.context-label { font-weight: bold; font-size: 0.9em; margin-bottom: 0.5rem; }
.context-answer { font-style: italic; color: var(--text-muted); }

.ai-feedback-response { margin-top: 1.5rem; padding: 1rem; border-radius: 8px; line-height: 1.6; text-align: left; background-color: rgba(14, 165, 233, 0.2); border-left: 4px solid var(--info-color); backdrop-filter: blur(5px); }

#step_transition .transition-content { animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; }
.transition-icon { animation: tada 1.5s ease-in-out; }
.transition-title { font-size: 3rem; margin: 1rem 0; }
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tada { 0% {transform: scale(1);} 10%, 20% {transform: scale(0.9) rotate(-3deg);} 30%, 50%, 70%, 90% {transform: scale(1.1) rotate(3deg);} 40%, 60%, 80% {transform: scale(1.1) rotate(-3deg);} 100% {transform: scale(1) rotate(0);} }

.journey-navigation { margin-top: auto; flex-shrink: 0; padding: 0rem 0; display: flex; justify-content: center; align-items: center; gap: 1rem; }
.nav-button { background-color: rgba(255,255,255,0.2); border: 1px solid var(--border-color); color: var(--white) !important; font-size: 1.1rem; font-weight: 600; padding: 0.8rem 2rem; }
.nav-button.next-step { background-color: var(--success-color); border-color: var(--success-color); }
.nav-button:hover:not(:disabled) { transform: scale(1.05); }
.nav-button:disabled { opacity: 0.3 !important; cursor: not-allowed; }
.get-ai-feedback, .btn-finish { font-size: 1.1rem; padding: 0.8rem 2rem; }

/* ------------------------------------------
   4.1 Ken Burns Achtergrond Effect
   ------------------------------------------ */
.background-container, .background-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.background-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; transition: opacity 1.5s ease-in-out; animation: kenburns 40s ease-in-out infinite alternate; }
#bg-part1 { background-image: url('../images/background-part1.png'); }
#bg-part2 { background-image: url('../images/background-part2.png'); }
.background-overlay { background-color: #000; opacity: var(--bg-image-opacity); }
/* 
 * Ken Burns Effect:
 * Een subtiel pan- en zoom-effect op de achtergrondafbeelding.
 */
@keyframes kenburns {
    from { transform: scale(1.05) translate(-2%, 2%); }
    to   { transform: scale(1) translate(0, 0); }
}

/* ==========================================================================
   5. UTILITIES (bv. Loader)
   ========================================================================== */
#loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.85); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.loading-box { background-color: var(--white); padding: 2rem 3rem; border-radius: 1rem; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.loading-box .fa-spinner { font-size: 3em; color: var(--primary-color); margin-bottom: 1rem; }
.loading-box p { font-size: 1.1em; font-weight: 600; color: var(--text-dark); line-height: 1.5; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } 

/* ==========================================================================
   6. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .journey-form { padding: 1rem; }
    .step-title { font-size: 1.8rem; }
    .step-description { font-size: 1rem; }
    .progress-dots { display: none; }
    .journey-navigation { flex-wrap: wrap; }
    .journey-navigation .btn, .journey-navigation .nav-button { flex-basis: 48%; font-size: 1rem; padding: 0.7rem 1rem; }
}