/* Estilos do Sistema de Eleição */

/* Container Principal */
.sistema-eleicao-votacao,
.sistema-eleicao-resultados {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Título */
.sistema-eleicao-votacao h2,
.sistema-eleicao-resultados h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* Descrição */
.eleicao-descricao {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Informações */
.eleicao-info {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

/* Grid de Candidatos */
.candidatos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Card do Candidato */
.candidato-card {
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.candidato-card:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.candidato-card label {
    display: block;
    cursor: pointer;
    padding: 0;
}

.candidato-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.candidato-card input[type="radio"]:checked + .candidato-foto,
.candidato-card input[type="radio"]:checked ~ .candidato-info {
    background: #0073aa;
    color: #fff;
}

/* Foto do Candidato */
.candidato-foto {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.candidato-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info do Candidato */
.candidato-info {
    padding: 15px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.candidato-numero {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.candidato-card input[type="radio"]:checked ~ .candidato-info .candidato-numero {
    color: #fff;
}

.candidato-nome {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.candidato-card input[type="radio"]:checked ~ .candidato-info .candidato-nome {
    color: #fff;
}

/* Detalhes do Candidato */
.candidato-detalhes {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

.candidato-biografia,
.candidato-proposta {
    margin-bottom: 10px;
}

.candidato-detalhes strong {
    display: block;
    margin-bottom: 5px;
    color: #0073aa;
    font-size: 14px;
}

.candidato-detalhes p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
}

/* Ações */
.eleicao-acoes {
    text-align: center;
    margin: 30px 0;
}

.btn-votar {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-votar:hover {
    background: #005a87;
    transform: scale(1.05);
}

.btn-votar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Mensagens */
.eleicao-mensagem {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.eleicao-mensagem.sucesso {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.eleicao-mensagem.erro {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.eleicao-mensagem.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Resultados */
.resultados-info {
    text-align: center;
    margin-bottom: 30px;
    font-size: 18px;
}

.resultados-lista {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.resultado-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.resultado-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.resultado-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.resultado-posicao {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    min-width: 50px;
    text-align: center;
}

.resultado-foto {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.resultado-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resultado-candidato {
    flex: 1;
}

.resultado-numero {
    font-size: 16px;
    font-weight: bold;
    color: #0073aa;
}

.resultado-nome {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.resultado-votos {
    text-align: right;
}

.votos-numero {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.votos-percentual {
    font-size: 16px;
    color: #666;
}

/* Barra de Progresso */
.resultado-barra {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
}

.barra-progresso {
    height: 100%;
    background: linear-gradient(90deg, #0073aa 0%, #005a87 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #fff;
    font-weight: 600;
}

/* Responsivo */
@media (max-width: 768px) {
    .candidatos-grid {
        grid-template-columns: 1fr;
    }
    
    .resultado-header {
        flex-wrap: wrap;
    }
    
    .resultado-posicao {
        font-size: 24px;
        min-width: 40px;
    }
    
    .resultado-votos {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

/* Loading */
.eleicao-loading {
    text-align: center;
    padding: 20px;
}

.eleicao-loading::after {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
