/* WP Voting System - Estilos para Eleição */
.wp-voting-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

/* Cabeçalho da Eleição */
.wp-voting-header {
    background: linear(135deg, #2c3e50, #3498db);
    color: white;
    padding: 30px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    margin-bottom: 30px;
}

.wp-voting-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    font-weight: 700;
}

.wp-voting-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Cargos */
.wp-voting-position {
    background: white;
    margin-bottom: 25px;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 5px solid #3498db;
}

.wp-voting-position h3 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.wp-voting-position p {
    color: #7f8c8d;
    margin: 0 0 20px 0;
    font-size: 0.9em;
}

/* voting.css - Adicione estas regras */

.wp-voting-position {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #f9f9f9;
}

.wp-voting-position h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.max-votes-info {
    background: #e7f3ff;
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #0056b3;
}

.wp-voting-candidate.selected {
    background: #e8f5e8;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.wp-voting-candidate-select {
    display: block;
    text-align: center;
    padding: 8px;
    background: #0073aa;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.wp-voting-candidate-select:hover {
    background: #005a87;
}

.wp-voting-candidate-checkbox {
    margin-right: 5px;
}


/* voting.css - Adicione estas regras */

.wp-voting-rules {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.wp-voting-rules ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.wp-voting-rules li {
    margin-bottom: 5px;
    color: #555;
}

.wp-voting-candidate.already-voted {
    opacity: 0.7;
    background: #f0f0f0;
}

.wp-voting-candidate.already-voted .wp-voting-candidate-checkbox {
    display: none;
}

.vote-status {
    display: block;
    text-align: center;
    background: #28a745;
    color: white;
    padding: 5px;
    border-radius: 3px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: bold;
}

.wp-voting-summary {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #c5e1f5;
}

.position-summary {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.position-summary.complete {
    background: #d4edda;
    color: #155724;
}

.position-summary.partial {
    background: #fff3cd;
    color: #856404;
}

.position-summary.empty {
    background: #f8d7da;
    color: #721c24;
}

.wp-voting-warning {
    color: #856404;
    background: #fff3cd;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
}

.wp-voting-candidate.selected {
    border: 2px solid #28a745;
    background: #f0fff4;
}

.max-votes-info {
    background: #0073aa;
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}

/* voting.css - Adicione estas regras */

/* Container de resultados */
.wp-voting-results-page {
    max-width: 1200px;
    margin: 0 auto;
}

.results-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.wp-voting-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
}

.wp-voting-button.small {
    padding: 8px 15px;
    font-size: 14px;
}

/* Sumário */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #0073aa;
}

.summary-icon {
    font-size: 40px;
}

.summary-content h3 {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
}

/* Resultados por posição */
.position-results {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.position-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.position-header h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.position-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.total-votes-badge,
.max-votes-badge {
    background: #e7f3ff;
    color: #0056b3;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.max-votes-badge {
    background: #e8f5e8;
    color: #28a745;
}

/* Layout de resultados */
.results-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .results-content {
        grid-template-columns: 1fr;
    }
}

/* Gráficos */
.results-chart-column {
    display: flex;
    flex-direction: column;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

.results-chart {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 12px;
}

/* Tabela de resultados */
.results-table-column {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.table-header {
    background: #0073aa;
    color: white;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 80px;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.table-row.top-three {
    background: #f8fff8;
}

.table-row:hover {
    background: #f5f9ff;
}

.table-cell {
    padding: 8px 5px;
}

.position-cell .position-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.position-1 {
    background: #ffd700;
    color: #856404;
}

.position-2 {
    background: #c0c0c0;
    color: #333;
}

.position-3 {
    background: #cd7f32;
    color: white;
}

.candidate-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.candidate-photo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.candidate-name {
    font-weight: 600;
    color: #333;
}

.candidate-number {
    font-size: 12px;
    color: #666;
}

.votes-cell {
    position: relative;
}

.votes-count {
    font-weight: bold;
    margin-bottom: 5px;
}

.votes-bar-container {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.votes-bar {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a8ff);
    border-radius: 5px;
    transition: width 1s ease;
}

.percentage-cell .percentage-value {
    font-weight: bold;
    color: #0073aa;
    text-align: center;
}

/* Pódio */
.position-podium {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.position-podium h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.podium-item {
    flex: 1;
    text-align: center;
}

.podium-item.first {
    order: 2;
}

.podium-item.second {
    order: 1;
}

.podium-item.third {
    order: 3;
}

.podium-platform {
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    border-radius: 10px 10px 0 0;
    padding: 20px 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

.podium-item.first .podium-platform {
    min-height: 250px;
    background: linear-gradient(to bottom, #fff3cd, #ffecb5);
}

.podium-item.second .podium-platform {
    min-height: 220px;
    background: linear-gradient(to bottom, #e9ecef, #dee2e6);
}

.podium-item.third .podium-platform {
    min-height: 180px;
    background: linear-gradient(to bottom, #f5e5d3, #e8d0b3);
}

.podium-medal {
    font-size: 40px;
    margin-bottom: 10px;
}

.podium-candidate {
    padding: 15px 0;
}

.podium-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.podium-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.podium-votes {
    font-size: 14px;
    color: #666;
    margin-bottom: 3px;
}

.podium-percentage {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

/* Loading */
.wp-voting-loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estados vazios/erros */
.wp-voting-empty,
.wp-voting-error {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    margin: 20px 0;
}

.wp-voting-empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}


/* Candidatos */
.wp-voting-candidates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.wp-voting-candidate {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wp-voting-candidate:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.15);
}

.wp-voting-candidate.selected {
    border-color: #27ae60;
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.2);
}

/* Foto do Candidato */
.wp-voting-candidate-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
    flex-shrink: 0;
}

.wp-voting-candidate.selected .wp-voting-candidate-photo {
    border-color: #27ae60;
}

/* Informações do Candidato */
.wp-voting-candidate-info {
    flex: 1;
}

.wp-voting-candidate-number {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

.wp-voting-candidate.selected .wp-voting-candidate-number {
    background: #27ae60;
}

.wp-voting-candidate-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.wp-voting-candidate-bio {
    color: #7f8c8d;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Checkbox Estilizado */
.wp-voting-candidate-select {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.wp-voting-candidate-select:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.wp-voting-candidate-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wp-voting-candidate-select input:checked + span {
    color: #27ae60;
    font-weight: 600;
}

/* Botão de Votar */
.wp-voting-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.wp-voting-button {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    min-width: 200px;
}

.wp-voting-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.wp-voting-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wp-voting-button.submitted {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Estados de Loading e Mensagens */
.wp-voting-loading {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.wp-voting-empty {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.wp-voting-empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.wp-voting-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

.wp-voting-error h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

/* Responsivo */
@media (max-width: 768px) {
    .wp-voting-container {
        padding: 15px;
        margin: 10px;
    }
    
    .wp-voting-header {
        padding: 20px 15px;
    }
    
    .wp-voting-header h1 {
        font-size: 1.8em;
    }
    
    .wp-voting-candidates {
        grid-template-columns: 1fr;
    }
    
    .wp-voting-candidate {
        flex-direction: column;
        text-align: center;
    }
    
    .wp-voting-button {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.wp-voting-position {
    animation: fadeIn 0.5s ease-out;
}