/* Styles pour le popup de résultats */
.results-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.results-popup.show {
    opacity: 1;
    visibility: visible;
}

.results-popup-content {
    background-color: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.6s ease;
}

.results-popup.show .results-popup-content {
    transform: scale(1);
    opacity: 1;
}

.results-popup-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    position: relative;
    text-align: center;
}

.results-popup-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    padding-left: 60px; /* Ajouté pour éviter le chevauchement avec le drapeau */
}

.results-popup-header .moroccan-flag {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
}

.results-popup-body {
    padding: 30px;
}

.results-popup-chart {
    height: 300px;
    margin-bottom: 30px;
}

.results-popup-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 30px;
    background-color: #f8f9fa;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.legend-item.animate {
    animation: fadeInUp 0.5s forwards;
}

.party-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 8px;
}

.party-pps .party-color { background-color: var(--pps-color); }
.party-rni .party-color { background-color: var(--rni-color); }
.party-pjd .party-color { background-color: var(--pjd-color); }
.party-usfp .party-color { background-color: var(--usfp-color); }
.party-istiqlal .party-color { background-color: var(--istiqlal-color); }
.party-autres .party-color { background-color: var(--autres-color); }

.party-percentage {
    font-weight: bold;
    margin-left: 8px;
}

.results-popup-footer {
    padding: 15px 30px;
    text-align: center;
    border-top: 1px solid #eee;
}

.results-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    color: var(--primary-color);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.results-popup-close:hover {
    transform: rotate(90deg);
    background-color: var(--primary-color);
    color: white;
}

.results-popup-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.results-popup-button {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-popup-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.results-popup-button.secondary {
    background-color: #f8f9fa;
    color: var(--dark-color);
    border: 1px solid #ddd;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 0;
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Styles responsifs */
@media (max-width: 768px) {
    .results-popup-content {
        width: 95%;
    }
    
    .results-popup-header h2 {
        font-size: 1.5rem;
    }
    
    .results-popup-chart {
        height: 250px;
    }
    
    .legend-item {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
}
