/* Elections System Styles for United We Rise Frontend */

.elections-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 2rem;
    width: 100%;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: between;
    align-items: center;
    background: linear-gradient(135deg, #8b0000, #dc143c);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

/* Animation for notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced elections display styles */
.elections-enhanced {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.elections-enhanced .level-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.elections-enhanced .level-section h3 {
    color: #8b0000;
    border-bottom: 2px solid #8b0000;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.elections-enhanced .contest-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.elections-enhanced .contest-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #8b0000;
}

.elections-enhanced .contest-name {
    font-weight: 600;
    color: #8b0000;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.elections-enhanced .contest-type {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.elections-enhanced .contest-level {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.elections-enhanced .contest-date {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.elections-enhanced .contest-date strong {
    color: #8b0000;
}

/* Timeline styling for elections */
.election-timeline {
    position: relative;
    padding-left: 2rem;
}

.election-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #8b0000;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1.5rem;
    width: 1rem;
    height: 1rem;
    background: #8b0000;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #8b0000;
}

.timeline-date {
    background: #8b0000;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Contest cards grid */
.contests-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contest-overview-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #8b0000;
    transition: all 0.2s;
}

.contest-overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.contest-overview-card h4 {
    color: #8b0000;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.contest-overview-card .contest-meta {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}

.contest-overview-card .contest-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.contest-status.upcoming {
    background: #fff3cd;
    color: #856404;
}

.contest-status.active {
    background: #d4edda;
    color: #155724;
}

.contest-status.future {
    background: #d1ecf1;
    color: #0c5460;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .modal-container {
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .contests-overview {
        grid-template-columns: 1fr;
    }

    .election-timeline {
        padding-left: 1rem;
    }

    .timeline-item::before {
        left: -0.5rem;
        width: 0.75rem;
        height: 0.75rem;
    }

    .election-timeline::before {
        left: 0.375rem;
    }
}

/* Additional election-specific animations */
.contest-card-enter {
    animation: contestCardEnter 0.3s ease-out;
}

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

/* Election type badges */
.election-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.election-type-badge.primary {
    background: #8b0000;
    color: white;
}

.election-type-badge.general {
    background: #1a365d;
    color: white;
}

.election-type-badge.local {
    background: #6b7280;
    color: white;
}

.election-type-badge.special {
    background: #7c3aed;
    color: white;
}