/* LCC Pillar Quiz Styles v3.3.1 - Fixes & Refinements */

/* --- Base & Container --- */
#lcc-pillar-quiz-container.lcc-pillar-quiz-v3-3 { 
    padding: 20px 25px 30px 25px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #ffffff;
    max-width: 800px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    line-height: 1.6;
    color: #495057;
    position: relative;
    transition: background-color 0.4s ease;
}

/* --- Headings & Intro --- */
#lcc-pillar-quiz-container h2 { text-align: center; color: #343a40; margin-top: 10px; margin-bottom: 15px; font-size: 1.9em; font-weight: 600; }
#lcc-pillar-quiz-container p.quiz-intro { text-align: center; color: #6c757d; margin-bottom: 25px; font-size: 1.1em; }

/* --- Progress Bar --- */
#quiz-progress { margin-bottom: 35px; padding: 10px 0; display: none; }
.progress-bar-container { width: 100%; height: 12px; background-color: #e9ecef; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progress-bar-visual { height: 100%; width: 0; background-color: #007bff; border-radius: 6px; transition: width 0.4s ease-out; }
.progress-text { text-align: center; font-size: 0.95em; color: #6c757d; }
.progress-text .current-q, .progress-text .total-q { font-weight: bold; }

/* --- Pillar Titles & Sections --- */
#lcc-pillar-quiz-container h3.pillar-title { margin-top: 45px; margin-bottom: 25px; border-bottom-width: 3px; border-bottom-style: solid; padding-bottom: 10px; font-size: 1.6em; font-weight: 600; transition: color 0.4s ease, border-color 0.4s ease; display: none; }
#lcc-pillar-quiz-container h3.pillar-title:first-of-type { margin-top: 20px; }
.quiz-section { margin-bottom: 20px; }
.quiz-question { display: none; margin-bottom: 35px; padding: 20px; border-left-width: 5px; border-left-style: solid; border-left-color: #ced4da; background-color: #f8f9fa; border-radius: 0 6px 6px 0; transition: background-color 0.3s ease, border-left-color 0.4s ease; }
.quiz-question.question-error { background-color: #fff3f3; border-left-color: #dc3545 !important; }
.quiz-question.question-error p strong { color: #dc3545; }
.quiz-question p { margin-top: 0; margin-bottom: 18px; font-weight: 600; color: #343a40; font-size: 1.15em; line-height: 1.5; }

/* --- Pillar Theme Styling --- */
.active-pillar-spirit .quiz-question { border-left-color: #ffde59; }
.active-pillar-mind .quiz-question { border-left-color: #38b6ff; }
.active-pillar-body .quiz-question { border-left-color: #7ed957; }
.active-pillar-heart .quiz-question { border-left-color: #ff5757; }
h3.pillar-title.pillar-spirit { color: #e6aa00; border-color: #ffde59; }
h3.pillar-title.pillar-mind { color: #008bdb; border-color: #38b6ff; }
h3.pillar-title.pillar-body { color: #5ca341; border-color: #7ed957; }
h3.pillar-title.pillar-heart { color: #e03030; border-color: #ff5757; }

/* --- Radio Options & Micro-interaction --- */
.options-container { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.option-label { display: inline-block; cursor: pointer; }
.option-input { appearance: none; -webkit-appearance: none; position: absolute; opacity: 0; width: 0; height: 0; }
.option-text { display: flex; align-items: center; justify-content: center; min-width: 48px; height: 48px; padding: 0 10px; border: 2px solid #ced4da; border-radius: 50%; background-color: #ffffff; color: #495057; font-weight: 600; transition: all 0.2s ease-in-out; font-size: 1.1em; }
.option-label:hover .option-text { background-color: #e9ecef; border-color: #007bff; }
.option-input:checked + .option-text { background-color: #007bff; color: #ffffff; border-color: #0056b3; transform: scale(1.08); box-shadow: 0 3px 7px rgba(0, 123, 255, 0.3); }
.option-input:focus + .option-text { box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.4); outline: none; }
@keyframes selectedFlash { 0%, 100% { background-color: #007bff; transform: scale(1.08); } 50% { background-color: #66b3ff; transform: scale(1.15); } }
.answer-selected-flash .option-text { animation: selectedFlash 0.3s ease-out; }
.option-input:not(:checked) + .answer-selected-flash .option-text { animation: none; }

/* --- Submit Button & Spinner --- */
#submit-container { display: none; text-align: center; margin-top: 30px; }
#submit-quiz { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 10px; width: auto; min-width: 200px; padding: 15px 35px; background-color: #28a745; color: white; border: none; border-radius: 30px; font-size: 1.15em; font-weight: 600; cursor: pointer; margin: 0 auto 20px auto; transition: all 0.25s ease; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); position: relative; overflow: hidden; }
#submit-quiz:hover:not(:disabled) { background-color: #218838; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); transform: translateY(-2px); }
#submit-quiz:focus { outline: none; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5); }
#submit-quiz:disabled { background-color: #6c757d; cursor: wait; opacity: 0.8; }
#submit-quiz .button-text { line-height: 1; }
.spinner-container { width: 1.2em; height: 1.2em; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.spinner-container .spinner { border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: #fff; width: 100%; height: 100%; animation: spin 1s linear infinite; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Notices (Error / Info) --- */
.quiz-notice { padding: 15px 20px; margin: 25px 0; border-radius: 6px; border: 1px solid transparent; font-size: 1.05em; }
.quiz-notice.error { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; text-align: center; }
#quick-solutions.quiz-notice.info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; text-align: left; }
#quick-solutions h4 { margin-top: 0; margin-bottom: 12px; color: #0c5460; font-size: 1.2em; font-weight: 600; }
#quick-solutions p { margin-bottom: 10px; line-height: 1.5; }
#quick-solutions ul { list-style: none; padding-left: 0; margin-top: 10px; margin-bottom: 5px; }
#quick-solutions li.tip-pillar-heading { padding-left: 0; margin-bottom: 5px; margin-top: 10px; font-size: 1.05em; }
#quick-solutions li.tip-pillar-heading:first-child { margin-top: 0; }
#quick-solutions li:not(.tip-pillar-heading) { margin-bottom: 8px; padding-left: 28px; position: relative; line-height: 1.5; }
#quick-solutions li:not(.tip-pillar-heading)::before { content: '✓'; position: absolute; left: 5px; top: 2px; color: #155724; font-weight: bold; font-size: 1.1em; }
#quick-solutions strong { color: #004085; font-weight: 600; }

/* --- Results Section --- */
#quiz-results { margin-top: 40px; padding-top: 30px; border-top: 3px solid #007bff; display: none; }
#quiz-results h2 { color: #007bff; margin-bottom: 20px; text-align: center; }

/* --- Summary Statement --- */
#quiz-summary-statement { display: none; text-align: center; font-size: 1.15em; font-weight: 500; margin-bottom: 30px; padding: 18px 25px; color: #004085; background-color: #cce5ff; border: 1px solid #b8daff; border-radius: 6px; }
#quiz-summary-statement strong { font-weight: 700; }

/* --- Results Grid (Chart & Scores) --- */
.results-grid { display: flex; flex-wrap: wrap; gap: 30px; margin-bottom: 30px; align-items: center; }
.chart-column { flex: 1 1 350px; min-width: 300px; }
.scores-column { flex: 1 1 250px; min-width: 200px; }
.chart-container { position: relative; height: auto; max-width: 450px; margin: 0 auto; }
#pillarChart { max-width: 100%; height: auto !important; }

/* Score List & Interaction */
#pillar-scores { padding: 20px 25px; background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; }
/* REMOVED display:inline-flex and gap from H4 */
#pillar-scores h4 { margin-top: 0; margin-bottom: 15px; color: #495057; font-size: 1.25em; font-weight: 600; }
#pillar-scores p { margin-bottom: 10px; font-size: 1.1em; display: flex; justify-content: space-between; align-items: center; padding: 5px; border-radius: 4px; transition: background-color 0.2s ease, box-shadow 0.2s ease; cursor: default; }
#pillar-scores p:last-child { margin-bottom: 0; }
#pillar-scores p strong { color: #343a40; margin-right: 10px; }
#pillar-scores p span { font-weight: bold; font-size: 1.15em; color: #007bff; background-color: #e7f3ff; padding: 3px 8px; border-radius: 4px; }
#pillar-scores p.highlighted { background-color: #d4edff; box-shadow: 0 0 0 2px #007bff inset; }

/* Info Icon & Tooltip Styles Removed */

/* --- Interpretation Section (Accordion Styles) --- */
#interpretation-section { margin: 30px 0; background-color: transparent; border: none; }
.interpretation-accordion { border: 1px solid #e9ecef; border-radius: 6px; margin-bottom: 15px; background-color: #fff; overflow: hidden; }
.accordion-header { color: #343a40; margin: 0; padding: 15px 20px; font-size: 1.3em; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid transparent; transition: background-color 0.2s ease; position: relative; }
.accordion-header:hover { background-color: #f8f9fa; }
.accordion-icon { font-size: 0.8em; transition: transform 0.3s ease; margin-left: 10px; }
.accordion-content { display: none; padding: 20px 25px; border-top: 1px solid #e9ecef; background-color: #ffffff; overflow: visible !important; height: auto !important; max-height: none !important; }
.accordion-header.active { background-color: #f8f9fa; border-bottom-color: #e9ecef;}
.accordion-header.active .accordion-icon { transform: rotate(180deg); }

/* Accordion Header Cues */
.accordion-header::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; opacity: 0; transition: opacity 0.3s ease; vertical-align: middle; }
.accordion-header.has-low-score-cue::before { background-color: #ffc107; opacity: 1; }
.accordion-header.has-imbalance-cue::before { background-color: #dc3545; opacity: 1; }
.accordion-header.has-low-score-cue.has-imbalance-cue::before { background-color: #dc3545; }

/* Pillar Evaluation Content Styles */
#pillar-evaluation-content p { margin-bottom: 15px; color: #495057; line-height: 1.7; padding: 10px 15px; border-radius: 4px; border-left: 4px solid transparent; position: relative; }
#pillar-evaluation-content p:last-child { margin-bottom: 0; }
#pillar-evaluation-content p strong { color: #212529; font-weight: 600; }
p.pillar-eval-high { border-left-color: #28a745; background-color: #f0fff4; }
p.pillar-eval-high::before { content: "▲"; color: #28a745; font-weight: bold; margin-right: 8px; }
p.pillar-eval-low { border-left-color: #ffc107; background-color: #fff9e6; }
p.pillar-eval-low::before { content: "▼"; color: #ffc107; font-weight: bold; margin-right: 8px; }
p.pillar-eval-mid { border-left-color: #6c757d; background-color: #f8f9fa; }

/* Balance Interpretation Content Styles */
#balance-interpretation-content p { margin-bottom: 15px; color: #495057; line-height: 1.7; }
#balance-interpretation-content p:last-child { margin-bottom: 0; }
#balance-interpretation-content p strong { color: #212529; font-weight: 600; }
.highlight-pillar-name { font-weight: bold; color: #0056b3; }
.detailed-interpretation { margin-top: 15px; padding: 15px 20px; background-color: #f1fafd; border-left: 4px solid #17a2b8; border-radius: 0 4px 4px 0; overflow: visible !important; height: auto !important; max-height: none !important; }
.detailed-interpretation h4 { margin-top: 0; margin-bottom: 10px; font-size: 1.15em; color: #0c5460; }
.detailed-interpretation p { margin-bottom: 10px; font-size: 1em; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; -webkit-line-clamp: unset !important; display: block !important; height: auto !important; max-height: none !important; line-height: 1.6; }
.detailed-interpretation p:last-child { margin-bottom: 0; }
p.journal-prompt { font-style: italic; color: #5a6268; margin-top: 20px; padding: 15px; background-color: #fdfdfe; border: 1px dashed #ced4da; border-radius: 4px; font-size: 1em; line-height: 1.6; white-space: normal !important; overflow: visible !important; height: auto !important; max-height: none !important; -webkit-line-clamp: unset !important; }
p.journal-prompt em { font-weight: 600; color: #495057; font-style: normal; }

/* --- Recommendations & Course Links --- */
#recommendations { margin-top: 35px; padding: 30px; background-color: #f1fafd; border: 1px solid #d6eaf8; border-radius: 6px; }
#recommendations h3 { margin-top: 0; color: #17a2b8; border-bottom: none; text-align: center; margin-bottom: 25px; font-size: 1.5em; }
#recommendations p.recommendations-intro { text-align: center; margin-bottom: 20px; color: #495057; font-size: 1.1em; }
#recommendations h4 { color: #343a40; margin-top: 20px; margin-bottom: 10px; font-size: 1.2em; font-weight: 600; border-bottom: 1px solid #d6eaf8; padding-bottom: 5px; }
#recommendations ul { list-style: none; padding-left: 0; margin-bottom: 20px; }
#recommendations li { margin-bottom: 12px; padding-left: 30px; position: relative; line-height: 1.5; }
#recommendations li::before { content: '→'; position: absolute; left: 5px; top: 1px; color: #007bff; font-weight: bold; font-size: 1.3em; }
#recommendations a { color: #0056b3; text-decoration: none; font-weight: 500; border-bottom: 1px solid transparent; transition: border-color 0.2s ease, color 0.2s ease; }
#recommendations a:hover, #recommendations a:focus { color: #003d80; border-bottom-color: #003d80; outline: none; }
#recommendations .loading-recommendations, #recommendations .error-recommendations { text-align: center; padding: 15px; color: #6c757d; font-style: italic; }

/* Pillar Name Links */
a.pillar-link { text-decoration: underline; text-decoration-color: rgba(0, 123, 255, 0.4); text-decoration-thickness: 1px; transition: text-decoration-color 0.2s ease; color: inherit; } /* Inherit color */
a.pillar-link:hover { text-decoration-color: rgba(0, 123, 255, 0.8); color: #0056b3; } /* Darker blue on hover */

/* Course Links Container & Button Styling */
#course-links-container { margin-top: 25px; padding-top: 20px; border-top: 1px dashed #bce8f1; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.course-link {
    display: inline-block;
    padding: 10px 20px; /* Adjusted padding */
    border: none; /* Remove border */
    border-radius: 25px; /* More rounded */
    text-decoration: none;
    font-size: 1em; /* Slightly larger */
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.07);
    color: #fff; /* Default white text */
}
/* Pillar-specific background colors */
.course-link.course-spirit { background-color: #ffc107; color: #332a00; } /* Yellow with dark text */
.course-link.course-mind { background-color: #0d6efd; } /* Bootstrap blue */
.course-link.course-body { background-color: #198754; } /* Bootstrap green */
.course-link.course-heart { background-color: #dc3545; } /* Bootstrap red */
/* Hover effect - slightly darken/desaturate */
.course-link.course-spirit:hover { background-color: #e0a800; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.course-link.course-mind:hover { background-color: #0b5ed7; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.course-link.course-body:hover { background-color: #157347; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.course-link.course-heart:hover { background-color: #bb2d3b; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }


/* --- Results Action Buttons --- */
.results-actions { margin-top: 30px; padding-top: 20px; border-top: 1px solid #e9ecef; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; align-items: center; }

/* Save Results Button */
#save-results-btn { display: inline-block; padding: 12px 25px; background-color: #6c757d; color: white; border: none; border-radius: 25px; font-size: 1em; font-weight: 500; cursor: pointer; transition: all 0.25s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
#save-results-btn:hover:not(:disabled) { background-color: #5a6268; box-shadow: 0 4px 8px rgba(0,0,0,0.15); transform: translateY(-1px); }
#save-results-btn:disabled { opacity: 0.7; cursor: wait; }
#save-results-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.5); }

/* Save Feedback Message */
.save-feedback-msg { font-size: 0.9em; font-style: italic; padding: 5px 10px; border-radius: 4px; display: none; }
.save-feedback-msg.success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; }
.save-feedback-msg.error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; }

/* Retake Button */
#retake-quiz { display: inline-block; width: auto; min-width: 180px; padding: 14px 30px; background-color: #ffc107; color: #212529; border: none; border-radius: 25px; font-size: 1.1em; font-weight: 600; cursor: pointer; text-align: center; margin: 0; transition: all 0.25s ease; box-shadow: 0 3px 6px rgba(0,0,0,0.1); }
#retake-quiz:hover { background-color: #e0a800; box-shadow: 0 5px 10px rgba(0,0,0,0.15); transform: translateY(-2px); }
#retake-quiz:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5); }

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
     #lcc-pillar-quiz-container h2 { font-size: 1.7em; }
     #lcc-pillar-quiz-container h3.pillar-title { font-size: 1.4em; }
     .quiz-question p { font-size: 1.1em; }
    .results-grid { flex-direction: column; gap: 20px; }
    .chart-column, .scores-column { flex-basis: auto; width: 100%; }
     #pillar-scores { padding: 15px 20px; }
     #pillar-scores p { font-size: 1em; }
     #pillar-scores span { font-size: 1.1em; }
     .accordion-header { font-size: 1.2em; padding: 12px 15px;}
     .accordion-content { padding: 15px 20px; }
     #quiz-summary-statement { font-size: 1.1em; padding: 15px 20px;}
     .course-link { font-size: 0.9em; padding: 8px 16px; } /* Adjust course link padding */
}

@media (max-width: 600px) {
    #lcc-pillar-quiz-container { padding: 15px; }
     #lcc-pillar-quiz-container h2 { font-size: 1.5em; }
     #lcc-pillar-quiz-container h3.pillar-title { font-size: 1.3em; margin-bottom: 20px; }
     .quiz-question { padding: 15px; margin-bottom: 25px; }
     .quiz-question p { font-size: 1em; margin-bottom: 15px; }
    .options-container { gap: 8px; }
    .option-text { min-width: 42px; height: 42px; font-size: 1em; }
     #submit-quiz, #retake-quiz, #save-results-btn { width: 90%; min-width: auto; margin-left: auto; margin-right: auto; display: block; font-size: 1em; padding: 12px 20px; }
     .results-actions button + button { margin-top: 10px; }
     #pillar-scores p { flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
     #pillar-scores p span { margin-top: 4px; }
     #recommendations { padding: 20px; }
     #recommendations h3 { font-size: 1.3em; }
     #recommendations p.recommendations-intro { font-size: 1em; }
     #recommendations h4 { font-size: 1.1em; }
     #recommendations li { padding-left: 25px; }
     #recommendations li::before { font-size: 1.2em; left: 3px; }
     #quick-solutions { padding: 15px; }
     #quick-solutions h4 { font-size: 1.1em; }
     #quick-solutions li:not(.tip-pillar-heading) { padding-left: 25px; }
     #quick-solutions li:not(.tip-pillar-heading)::before { font-size: 1em; left: 4px; }
     .accordion-header { font-size: 1.1em; }
     .accordion-content { padding: 15px; }
     p.journal-prompt { padding: 10px; font-size: 0.95em;}
     #quiz-summary-statement { font-size: 1.05em; padding: 15px;}
     #pillar-evaluation-content p { padding: 8px 12px; }
     .course-link { width: calc(90% - 10px); padding: 10px 15px; /* Adjust stack padding */}
}