:root {
    --primary-color: #8e44ad; /* Violet */
    --secondary-color: #ff36b4; /* Rose néon */
    --dark-color: #111111; /* Noir */
    --light-color: #ffffff; /* Blanc */
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #1d0e2e;
    color: var(--light-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    text-shadow: 0 0 10px rgba(255, 54, 180, 0.5);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
}

.section {
    background: rgba(17, 17, 17, 0.7);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(142, 68, 173, 0.2);
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

p {
    margin-bottom: 1.5rem;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 54, 180, 0.1);
}

.hidden {
    display: none;
}

/* Quiz section */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--secondary-color);
    border-radius: 4px;
    width: 5%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: right;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.category-tag {
    display: none;
}

#questionText {
    margin-bottom: 1.5rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.option.selected {
    background: rgba(142, 68, 173, 0.2);
    border-color: var(--primary-color);
}

/* Results section */
.score-display {
    text-align: center;
    margin: 0 auto 2rem;
    padding: 1rem;
}

.score-number {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(255, 54, 180, 0.3);
}

.score-label {
    font-size: 1.6rem;
    text-align: center;
    padding: 0 0.75rem;
    font-weight: 600;
}

/* Supprimer ou commenter les styles de score-circle qui ne sont plus utilisés */
/* .score-circle {
    ...ancien style supprimé...
} */

.stats-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.category-stats {
    margin-top: 1.5rem;
}

.category-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.category-name {
    flex: 1;
    font-size: 0.95rem;
}

.category-value {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
    color: var(--secondary-color);
}

.category-bar-container {
    flex: 2;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 1rem;
}

.category-bar {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease;
}

.category-bar.safe {
    background: #4CAF50;
}

.category-bar.warning {
    background: #FFC107;
}

.category-bar.danger {
    background: #FF5252;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}

.category-header h4 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.category-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.legend-color.safe {
    background: #4CAF50;
}

.legend-color.warning {
    background: #FFC107;
}

.legend-color.danger {
    background: #FF5252;
}

/* Styles pour les groupes de catégories */
.category-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-group-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.category-group-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.category-group-bar {
    height: 100%;
    border-radius: 5px;
    width: 0%;
    transition: width 0.8s ease;
}

.category-group-bar.safe {
    background: #4CAF50;
}

.category-group-bar.warning {
    background: #FFC107;
}

.category-group-bar.danger {
    background: #FF5252;
}

.category-group-value {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.group-score {
    font-weight: 600;
}

/* Styles pour les insights */
.toxicity-insights {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.insight-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid;
}

.insight-item.positive {
    border-color: #4CAF50;
}

.insight-item.warning {
    border-color: #FFC107;
}

.insight-item.negative {
    border-color: #FF5252;
}

.insight-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.insight-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Styles pour le bouton de navigation entre questions */
.navigation-container {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn-navigation {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Styles pour les boutons de partage social - Version simplifiée */
.sharing {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    text-align: center;
}

.share-preview-container {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    display: block;
}

#shareCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-options {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-download:hover {
    background: var(--secondary-color);
}

/* Toast notifications - simplifiées */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-error {
    border-left: 4px solid #FF5252;
}

footer {
    text-align: center;
    opacity: 0.5;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 767px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .score-number {
        font-size: 3.5rem;
    }
    
    .score-label {
        font-size: 1.3rem;
    }
    
    .social-share-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .social-btn {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }
    
    .download-options {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    /* Amélioration des stats par groupe sur mobile */
    .category-group-name {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .category-group-value {
        font-size: 0.8rem;
    }
    
    /* Amélioration des stats par catégorie sur mobile */
    .category-stat {
        margin-bottom: 0.8rem;
        flex-wrap: wrap;
    }
    
    .category-name {
        flex: 0 0 100%;
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .category-bar-container {
        flex: 0 0 80%;
        margin: 0;
        order: 3;
    }
    
    .category-value {
        flex: 0 0 20%;
        padding-left: 0.5rem;
        order: 4;
        min-width: auto;
    }
    
    /* Amélioration des insights sur mobile */
    .insight-item {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .insight-title {
        font-size: 1rem;
    }
    
    .insight-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Légendes plus compactes */
    .category-legend {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
    
    /* Partage et téléchargement */
    .download-options {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem;
    }
    
    /* Réduction des marges entre sections */
    .stats-container, .toxicity-insights {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    /* Header plus compact dans l'analyse */
    .category-header {
        margin: 1rem 0 0.5rem;
    }
    
    .category-header h4 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
}

/* Ajout d'un breakpoint pour les très petits écrans */
@media (max-width: 380px) {
    .container {
        padding: 0.8rem;
    }
    
    .section {
        padding: 1.2rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .score-number {
        font-size: 3rem;
    }
    
    .score-label {
        font-size: 1.1rem;
    }
    
    .category-name {
        font-size: 0.85rem;
    }
    
    /* Optimiser l'espace sur petits écrans */
    .category-bar-container {
        height: 5px;
    }
    
    .category-group-bar-container {
        height: 6px;
    }
    
    .insight-item {
        padding: 0.7rem;
    }
}

/* Pour les écrans très étroits */
@media (max-width: 320px) {
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-number {
        font-size: 1.8rem;
    }
    
    .score-label {
        font-size: 0.7rem;
    }
}
