/* Styles pour la section de vote des personnalités politiques */
.politicians-vote-section {
    background-color: #f8f9fa;
    padding: 80px 0;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23e9ecef' fill-opacity='0.4'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.politicians-vote-section .section-header {
    margin-bottom: 40px;
}

.politicians-vote-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-areas:
        "instructions instructions"
        "grid ranking"
        "grid submit";
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.instructions {
    grid-area: instructions;
    text-align: center;
    margin-bottom: 10px;
    font-style: italic;
    color: #666;
    font-size: 1.1rem;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.politicians-grid {
    grid-area: grid;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

.politician-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.politician-card.available {
    cursor: grab;
}

.politician-card.selected {
    cursor: default;
    border-color: var(--primary-color);
}

.politician-card.available:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.politician-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.politician-image-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.politician-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    display: block;
    transition: filter 0.3s ease;
}

/* --- Overlay Styles --- */
.politician-card .status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.4); /* Default dimming */
}

.politician-card .status-overlay i {
    color: white;
    font-size: 3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* Style for SELECTED politician (Positive Checkmark) */
.politician-card.selected .status-overlay {
    opacity: 1;
    background-color: rgba(40, 167, 69, 0.6); /* Green overlay */
}

.politician-card.selected .status-overlay i.fa-check-circle {
    transform: scale(1);
}

.politician-card.selected .politician-image {
    filter: brightness(0.85);
}

/* Style for AVAILABLE but NOT SELECTED politician (when ANY selection is made) */
.politician-card.available.show-cross .status-overlay {
    opacity: 1;
    background-color: rgba(220, 53, 69, 0.6); /* Red overlay */
}

.politician-card.available.show-cross .status-overlay i.fa-times-circle {
    transform: scale(1);
}

.politician-card.available.show-cross .politician-image {
    filter: brightness(0.7) grayscale(50%);
}

/* Hide the irrelevant icon */
.politician-card.selected .status-overlay i.fa-times-circle,
.politician-card.available.show-cross .status-overlay i.fa-check-circle,
.politician-card.available:not(.show-cross) .status-overlay i {
    display: none;
}

/* --- End Overlay Styles --- */

.politician-info {
    padding: 12px;
    text-align: center;
}

.politician-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
    color: var(--dark-color);
}

.politician-party {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.ranking-section {
    grid-area: ranking;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px dashed #ccc;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.ranking-section.drag-over {
    border-color: var(--primary-color);
    background-color: #fff8f8;
}

.ranking-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.3rem;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.ranking-placeholder {
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-top: 20px;
    font-style: italic;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background-color: #fdfdfd;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: grab;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background-color: #f5f5f5;
}

.ranking-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
    background-color: #e0e0e0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ranking-item.drag-over-item {
    border-top: 3px solid var(--accent-color);
    margin-top: 13px;
    padding-top: 7px;
}

.ranking-number {
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 12px;
    color: var(--secondary-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e8f5e9;
    flex-shrink: 0;
}

.ranking-image {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #eee;
    flex-shrink: 0;
}

.ranking-name {
    flex-grow: 1;
    font-weight: 500;
    font-size: 1rem;
}

.remove-politician-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    margin-left: 10px;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.remove-politician-btn:hover {
    opacity: 1;
    color: #a01f24;
}

.submit-ranking {
    grid-area: submit;
    display: block;
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.submit-ranking:hover:not(:disabled) {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.submit-ranking:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.badge-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInUp 0.5s ease forwards;
}

.badge-notification i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.badge-notification strong {
    color: var(--accent-color);
}

.badge-notification button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 15px;
}

.badge-notification button:hover {
    opacity: 1;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 992px) {
    .politicians-vote-container {
        grid-template-areas:
            "instructions"
            "grid"
            "ranking"
            "submit";
        grid-template-columns: 1fr;
    }
    .politicians-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .ranking-section {
        min-height: 200px;
    }
}

@media (max-width: 576px) {
    .politicians-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .politician-image-container {
        height: 140px;
    }
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }
    .ranking-image {
        margin: 10px auto;
    }
    .remove-politician-btn {
        position: absolute;
        top: 5px;
        right: 5px;
    }
}

