/* Variables et reset */
:root {
    --indifferent-color: #6b7280;
    --sceptique-color: #ef4444;
    --pragmatique-color: #059669;
    --pionnier-color: #3b82f6;
    --background-color: #f3f4f6;
    --card-color: #ffffff;
    --text-color: #1f2937;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #e0f2fe, #ede9fe);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Conteneurs principaux */
.screen {
    width: 100%;
    max-width: 800px;
    animation: fadeIn 0.5s ease-in-out;
}

.container {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
}

.hidden {
    display: none;
}

/* Écran d'accueil */
h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 15px;
    color: #2d3748;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 1.1rem;
}

.profiles-preview {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.profile-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: white;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

input[type="text"] {
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.primary-btn {
    background-color: #3b82f6;
    color: white;
}

.primary-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: #e5e7eb;
    color: #4b5563;
}

.secondary-btn:hover {
    background-color: #d1d5db;
    transform: translateY(-2px);
}

.disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Écran du quiz */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

#progress-fill {
    height: 100%;
    background-color: #3b82f6;
    width: 5%;
    transition: width 0.5s ease;
}

#question-counter {
    text-align: right;
    font-size: 0.9rem;
    color: #6b7280;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.answer-btn {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.answer-btn:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
}

.answer-btn.selected {
    border-width: 2px;
    transform: translateY(-2px);
}

.answer-btn.indifferent {
    border-color: var(--indifferent-color);
    background-color: rgba(107, 114, 128, 0.1);
}

.answer-btn.sceptique {
    border-color: var(--sceptique-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.answer-btn.pragmatique {
    border-color: var(--pragmatique-color);
    background-color: rgba(5, 150, 105, 0.1);
}

.answer-btn.pionnier {
    border-color: var(--pionnier-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Écran des résultats */
.results-container {
    max-width: 800px;
}

#result-name {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: normal;
}

/* Profils principaux */
.profiles-result {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 600px) {
    .profiles-result {
        flex-direction: column;
    }
}

.profile-result-card {
    flex: 1;
    background-color: #f9fafb;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.profile-result-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #4b5563;
}

.profile-badge-large {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
}

.profile-icon-main, .profile-icon-secondary {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 15px;
}

.profile-title {
    text-align: left;
}

.profile-title h3 {
    margin: 0;
    font-size: 1.2rem;
}

.profile-title span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4b5563;
}

.result-description, .overall-results, .theme-results {
    margin-bottom: 30px;
}

.result-description h3, .overall-results h3, .theme-results h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #374151;
}

#profile-description {
    line-height: 1.6;
    white-space: pre-line;
    text-align: justify;
}

/* Graphique en donut */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Répartition par thème */
.theme-section {
    margin-bottom: 20px;
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 15px;
}

.theme-section h4 {
    margin-bottom: 12px;
    color: #4b5563;
}

.theme-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-bar-container {
    width: 100%;
}

.theme-bar-label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.profile-icon-mini {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    color: white;
    margin-right: 8px;
}

.theme-percentage {
    margin-left: auto;
    font-weight: bold;
}

.theme-progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.theme-progress-fill {
    height: 100%;
    transition: width 1s ease;
}

/* Section des explications */
.explanations-section {
    margin-bottom: 30px;
}

#toggle-explanations {
    margin-bottom: 15px;
}

#answer-explanations {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 15px;
}

.explanation-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.explanation-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.explanation-item h4 {
    margin-bottom: 10px;
    color: #4b5563;
}

.answer-text, .explanation-text {
    margin-bottom: 10px;
    line-height: 1.5;
}

.profile-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.footer-logo {
    max-width: 120px;
    margin-bottom: 5px;
}

.footer p {
    font-size: 12px;
    color: #6b7280;
}

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

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

.slide-in {
    animation: slideIn 0.5s ease forwards;
}

.slide-out {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.3s ease-in-out;
}

/* Indicateur de chargement pour la génération du PDF */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Conteneur caché pour la génération du PDF */
#pdf-container {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* Styles pour l'impression */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .container {
        box-shadow: none;
        padding: 10px;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .action-buttons, #toggle-explanations {
        display: none;
    }
    
    #answer-explanations {
        display: block !important;
    }
    
    .footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        padding: 10px 0;
        margin-top: 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .profiles-preview {
        gap: 10px;
    }
    
    .icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}