<!DOCTYPE html>
<html>
<head>
    <title>Results</title>
    <style>
        body {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        .score-card {
            background-color: #f8f9fa;
            padding: 20px;
            margin: 15px 0;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .dominant {
            color: #28a745;
            font-size: 1.5em;
            margin: 20px 0;
        }
        .advice {
            background-color: #e9f5ff;
            padding: 20px;
            border-radius: 8px;
            margin-top: 30px;
        }
    </style>
</head>
<body>
    <h1 style="text-align: center; color: #2c3e50;">Your DISC Results</h1>
    
    <div class="score-card">
        <h2>Detailed Scores:</h2>
        {% for trait, score in scores.items() %}
        <div class="score">
            <strong>{{ trait }}:</strong> {{ score }} ({{ "%.1f"|format(score/total*100) }}%)
        </div>
        {% endfor %}
    </div>

    <div class="dominant" style="text-align: center;">
        Dominant Trait: {{ dominant }}
    </div>

    <div class="advice">
        <h3>Personality Insights:</h3>
        {% if dominant == 'D' %}
        <p>Dominant (D): You're decisive and results-oriented. You excel in leadership roles and prefer taking charge of situations. Your natural confidence helps you make tough decisions quickly. Strengths: Decisive, goal-oriented, thrives on challenges.  Ideal Roles: CEO, entrepreneur, project manager, or roles in law/politics. Challenges: Impatience with routine; may overlook details. Tip: Seek leadership opportunities but delegate detail-oriented tasks. Leadership: Visionary but may need to collaborate. Marriage/Relationships Compatibility: Pairs well with S (calm) or C (structured). Value directness; avoid micromanaging.</p>
        {% elif dominant == 'I' %}
        <p>Influential (I): You're social and enthusiastic. You thrive in collaborative environments and have a natural ability to motivate others. Your optimism and energy make you great at building relationships. Strengths: Charismatic, persuasive, collaborative.  Ideal Roles: Sales, PR, event planning, teaching, or entertainment.  Challenges: May struggle with follow-through; dislikes monotony.  Tip: Leverage networking skills; pair with structured colleagues. Leadership: Motivational but requires accountability. Marriage/Relationships Compatibility: Matches with S (loyal) or C (grounding). Encourage enthusiasm but discuss practicalities.</p>
        {% elif dominant == 'S' %}
        <p>Steady (S): You're reliable and team-focused. You excel in supportive roles and prefer stable, predictable environments. Your patience and listening skills make you a valued team member. Strengths: Reliable, team-oriented, calm under pressure.  Ideal Roles: HR, nursing, administration, or customer service.  Challenges: Resists change; may avoid conflict.  Tip: Excel in supportive roles; seek gradual growth opportunities. Leadership: Consensus-building but may need assertiveness. Marriage/Relationships Compatibility: Compatible with C (dependable) or D (decisive). Prioritize empathy; give time to process emotions.</p>
        {% else %}
        <p>Conscientious (C): You're analytical and detail-oriented. You succeed in structured environments and prefer working with facts and data. Your systematic approach ensures high-quality results. Strengths: Analytical, detail-focused, systematic.  Ideal Roles: Engineering, accounting, data analysis, or research.  Challenges: Perfectionism; may overanalyze decisions.  Tip: Thrive in precision-driven fields; balance high standards with flexibility. Leadership: Process-driven but should encourage creativity. Marriage/Relationships Compatibility: Aligns with S (patient) or another C (shared values).  Appreciate their thoughtfulness; avoid criticism.</p>
        {% endif %}
    </div>
</body>
</html>