/* ===== BRANDING COLORS - EASY TO CHANGE ===== */
:root {
    /* PRIMARY BRAND COLOR - Change this single line to change the entire color scheme! */
    --primary-color: #4A7C59; /* Fern Green */
    
    /* Auto-generated variations (don't need to change these) */
    --primary-light: #6B9B7A;
    --primary-dark: #3A6348;
    --primary-pale: #E8F3ED;
    
    /* Supporting colors */
    --text-dark: #2C3E50;
    --text-light: #6C757D;
    --bg-light: #F8F9FA;
    --border-color: #DEE2E6;
    --white: #FFFFFF;
    
    /* Virtue colors */
    --wisdom: #9DC3E6;
    --courage: #F4B084;
    --humanity: #C5E0B4;
    --justice: #FFD966;
    --temperance: #B4C7E7;
    --transcendence: #D9D2E9;
    
    /* Score colors */
    --score-high: #63BE7B;
    --score-mid: #FFEB84;
    --score-low: #F8696B;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-pale) 0%, var(--white) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== WELCOME SCREEN ===== */
.welcome-content {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.intro {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    line-height: 1.8;
}

.info-card {
    background: var(--primary-pale);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.info-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.participant-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.email-section {
    background: var(--primary-pale);
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid var(--primary-color);
}

.email-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.email-info {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.email-privacy {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
    display: block;
    line-height: 1.4;
}

.privacy-icon {
    margin-right: 5px;
}

.checkbox-group {
    margin: 20px 0;
    padding: 15px;
    background: var(--white);
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    vertical-align: middle;
}

.checkbox-group label {
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    font-weight: 600;
    color: var(--text-dark);
}

.checkbox-group label .email-privacy {
    font-weight: normal;
    margin-top: 8px;
    padding-left: 28px;
}

.email-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.email-status.success {
    background: var(--score-high);
    color: var(--white);
}

.email-status.error {
    background: var(--score-low);
    color: var(--white);
}

.email-status.sending {
    background: var(--primary-pale);
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-pale);
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== ASSESSMENT ===== */
.assessment-content {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.question-container {
    margin-bottom: 30px;
}

/* ===== PAGE TRANSITION ANIMATIONS ===== */
.question-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-indicator {
    text-align: center;
    color: var(--white);
    background: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin: -30px -30px 25px -30px;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    animation: pageFlash 0.6s ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

@keyframes pageFlash {
    0% {
        background: #FFD700;
        transform: scale(1.05);
    }
    50% {
        background: var(--primary-light);
    }
    100% {
        background: var(--primary-color);
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Alternating page background colors for visual distinction */
.assessment-content {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

/* Page-specific subtle background tints */
body[data-page="0"] .question-card,
body[data-page="2"] .question-card,
body[data-page="4"] .question-card,
body[data-page="6"] .question-card {
    background: #F5F9F5; /* Very subtle green tint */
}

body[data-page="1"] .question-card,
body[data-page="3"] .question-card,
body[data-page="5"] .question-card,
body[data-page="7"] .question-card {
    background: #F8FAFB; /* Very subtle blue tint */
}

.question-item {
    margin-bottom: 35px;
    padding: 25px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--primary-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: questionSlideIn 0.4s ease-out backwards;
}

.question-item:nth-child(odd) {
    background: linear-gradient(135deg, #F5F9F5 0%, #FFFFFF 100%);
}

.question-item:nth-child(even) {
    background: linear-gradient(135deg, #F8FAFB 0%, #FFFFFF 100%);
}

.question-item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

@keyframes questionSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger the animation for each question */
.question-item:nth-child(2) { animation-delay: 0.05s; }
.question-item:nth-child(3) { animation-delay: 0.1s; }
.question-item:nth-child(4) { animation-delay: 0.15s; }
.question-item:nth-child(5) { animation-delay: 0.2s; }
.question-item:nth-child(6) { animation-delay: 0.25s; }
.question-item:nth-child(7) { animation-delay: 0.3s; }

.question-number {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.question-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
}

.rating-scale {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.rating-option {
    flex: 1;
    min-width: 80px;
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    text-align: center;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    min-height: 80px;
    justify-content: center;
}

.rating-number {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
}

.rating-label {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--text-light);
}

.rating-option label:hover {
    border-color: var(--primary-light);
    background: var(--primary-pale);
}

.rating-option input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.rating-option input[type="radio"]:checked + label .rating-number,
.rating-option input[type="radio"]:checked + label .rating-label {
    color: var(--white);
}

.rating-labels {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.navigation-buttons .btn {
    flex: 1;
    max-width: 200px;
}

/* ===== RESULTS ===== */
.results-content {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.results-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--bg-light);
}

.results-section:last-child {
    border-bottom: none;
}

.results-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.section-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--primary-pale);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

/* Top 5 Strengths */
.top-5-container {
    display: grid;
    gap: 20px;
}

.strength-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    transition: transform 0.3s;
}

.strength-card:hover {
    transform: translateX(5px);
}

.strength-rank {
    background: var(--primary-color);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
}

.strength-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.strength-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

.strength-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-left: 20px;
}

.strength-description {
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.6;
}

.strength-tip {
    background: var(--primary-pale);
    padding: 15px;
    border-radius: 6px;
    color: var(--text-dark);
    border-left: 3px solid var(--primary-color);
}

.strength-tip strong {
    color: var(--primary-color);
}

/* Virtues */
.virtues-container {
    display: grid;
    gap: 25px;
}

.virtue-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 8px;
}

.virtue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--white);
}

.virtue-title-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.virtue-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.virtue-description {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
    font-style: italic;
}

.virtue-avg {
    font-size: 1.5rem;
    font-weight: bold;
}

.virtue-strengths {
    display: grid;
    gap: 10px;
}

.virtue-strength-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--white);
    border-radius: 6px;
}

.virtue-strength-name {
    color: var(--text-dark);
}

.virtue-strength-score {
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    color: var(--white);
}

/* Virtue-specific colors */
.virtue-wisdom { background-color: var(--wisdom); }
.virtue-courage { background-color: var(--courage); }
.virtue-humanity { background-color: var(--humanity); }
.virtue-justice { background-color: var(--justice); }
.virtue-temperance { background-color: var(--temperance); }
.virtue-transcendence { background-color: var(--transcendence); }

/* Score colors */
.score-high { background-color: var(--score-high); }
.score-mid { background-color: var(--score-mid); color: var(--text-dark) !important; }
.score-low { background-color: var(--score-low); }

/* All Strengths Table */
.all-strengths-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.all-strength-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
}

.all-strength-name {
    font-weight: 600;
    color: var(--text-dark);
}

.all-strength-score {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    color: var(--white);
}

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin: 20px auto;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--bg-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .welcome-content,
    .assessment-content,
    .results-content {
        padding: 20px;
    }
    
    .rating-scale {
        flex-direction: column;
    }
    
    .rating-option {
        min-width: 100%;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .navigation-buttons .btn {
        max-width: 100%;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .all-strengths-container {
        grid-template-columns: 1fr;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }
    
    /* Hide navigation and action buttons */
    .navigation-buttons,
    .action-buttons {
        display: none !important;
    }
    
    /* Optimize header for print - super compact */
    .header {
        padding: 5px 10px !important;
        margin-bottom: 5px !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
        box-shadow: none !important;
        background: white !important;
    }
    
    .header h1 {
        font-size: 1.3rem !important;
        margin-bottom: 2px !important;
        color: #2F5496 !important;
    }
    
    .subtitle,
    .email-status {
        font-size: 0.75rem !important;
        margin: 0 !important;
    }
    
    /* Force content to start immediately after header */
    .results-content {
        padding: 0 15px !important;
        margin-top: 0 !important;
        page-break-before: avoid !important;
    }
    
    /* Section descriptions - keep but make compact */
    .section-description {
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        padding: 6px 8px !important;
        background: #f5f5f5 !important;
        border-left: 2px solid #666 !important;
        page-break-after: avoid !important;
    }
    
    .results-section {
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
        page-break-inside: avoid;
        border-bottom: 1px solid #ddd !important;
    }
    
    /* CRITICAL: Force first section to stay with header */
    .results-section:first-of-type {
        page-break-before: avoid !important;
        page-break-after: avoid !important;
    }
    
    .results-section h2 {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
        margin-top: 0 !important;
        page-break-after: avoid !important;
    }
    
    /* Top 5 - Make very compact */
    .top-5-container {
        gap: 6px !important;
    }
    
    .strength-card {
        padding: 8px !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid;
    }
    
    .strength-rank {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.9rem !important;
        margin-right: 8px !important;
    }
    
    .strength-name {
        font-size: 1rem !important;
    }
    
    .strength-score {
        font-size: 1.2rem !important;
    }
    
    .strength-description {
        font-size: 0.75rem !important;
        margin-bottom: 5px !important;
        line-height: 1.3 !important;
    }
    
    .strength-tip {
        padding: 5px !important;
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }
    
    .strength-tip strong {
        display: none; /* Hide "Action This Week:" label to save space */
    }
    
    /* Hide chart sections completely in print */
    .print-hide-charts {
        display: none !important;
    }
    
    /* Hide radar charts (too large for print) */
    .chart-container {
        display: none !important;
    }
    
    /* Compact virtues section */
    .virtues-container {
        gap: 6px !important;
    }
    
    .virtue-card {
        padding: 6px !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid;
    }
    
    .virtue-header {
        margin-bottom: 5px !important;
        padding-bottom: 4px !important;
        flex-wrap: wrap !important;
    }
    
    .virtue-title-block {
        flex: 1;
        gap: 2px !important;
    }
    
    .virtue-name {
        font-size: 0.95rem !important;
    }
    
    .virtue-description {
        font-size: 0.65rem !important;
        line-height: 1.2 !important;
    }
    
    .virtue-avg {
        font-size: 0.95rem !important;
    }
    
    .virtue-strength-item {
        padding: 3px 6px !important;
        font-size: 0.75rem !important;
    }
    
    .virtue-strength-name {
        font-size: 0.75rem !important;
    }
    
    .virtue-strength-score {
        font-size: 0.8rem !important;
        padding: 2px 8px !important;
    }
    
    /* Compact all strengths - 3 columns for more density */
    .all-strengths-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 4px !important;
        column-gap: 8px !important;
    }
    
    .all-strength-item {
        padding: 4px 6px !important;
        font-size: 0.7rem !important;
    }
    
    .all-strength-name {
        font-size: 0.7rem !important;
    }
    
    .all-strength-score {
        font-size: 0.8rem !important;
        padding: 2px 6px !important;
    }
    
    /* Force page breaks at strategic points */
    .results-section:nth-child(1) {
        /* Top 5 section */
        page-break-after: avoid;
    }
    
    .results-section:nth-child(3) {
        /* Virtues section - start on new page if needed */
        page-break-before: auto;
    }
    
    .results-section:nth-child(5) {
        /* All strengths - try to keep together */
        page-break-inside: auto;
    }
    
    /* Email status - hide in print */
    .email-status {
        display: none !important;
    }
    
    /* Ensure good print margins - tighter for more content */
    @page {
        margin: 0.8cm;
        size: A4;
    }
    
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Hide sections we don't need in print */
    #email-status {
        display: none !important;
    }
}
