/* Reset e estilos globais */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Classes utilitárias */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Estilos específicos do plugin */
.vcpf-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.vcpf-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.vcpf-form {
    margin-bottom: 20px;
}

.vcpf-field {
    margin-bottom: 15px;
}

.vcpf-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.vcpf-field input,
.vcpf-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.vcpf-button {
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.vcpf-button:hover {
    background-color: #005177;
}

.vcpf-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.vcpf-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.vcpf-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vcpf-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.vcpf-candidato {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vcpf-candidato:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.vcpf-candidato.selected {
    border-color: #0073aa;
    background-color: #f0f9ff;
}

.vcpf-candidato img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.vcpf-candidato h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* Estilos para tabela responsiva */
.vcpf-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.vcpf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.vcpf-table th,
.vcpf-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.vcpf-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.vcpf-table tr:hover {
    background-color: #f9f9f9;
}

/* Estilos para resultados */
.vcpf-resultado-categoria {
    margin-bottom: 40px;
}

.vcpf-resultado-categoria h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.vcpf-resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.vcpf-resultado-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #fff;
}

.vcpf-resultado-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.vcpf-resultado-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.vcpf-votos-info {
    margin-top: 10px;
}

.vcpf-barra-progresso {
    height: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.vcpf-barra {
    height: 100%;
    background-color: #0073aa;
    transition: width 0.3s ease;
}

.vcpf-votos-info p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
}

/* Estilos para opções de categoria desabilitadas */
#vcpf-categoria option:disabled {
    color: #999;
    font-style: italic;
    background-color: #f5f5f5;
}

/* Estilo para o select quando uma opção inválida é selecionada */
#vcpf-categoria.invalid {
    border-color: #dc3545;
}

/* Estilos para o grid de categorias */
.vcpf-categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.vcpf-categoria-item {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.vcpf-categoria-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.vcpf-categoria-item.selected {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.vcpf-categoria-imagem {
    margin-bottom: 10px;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 4px;
}

.vcpf-categoria-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vcpf-categoria-nome {
    font-weight: bold;
    color: #333;
}

.vcpf-categoria-item.votada {
    opacity: 0.7;
    cursor: not-allowed;
}

.vcpf-categoria-votada {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 768px) {
    .vcpf-container {
        padding: 10px;
    }
    
    .vcpf-table th,
    .vcpf-table td {
        padding: 8px;
    }
    
    .vcpf-resultados-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para o WordPress admin */
.wp-admin .vcpf-admin-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wp-admin .vcpf-admin-title {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Correções de conflito com temas WordPress */
.vcpf-container button {
    line-height: normal;
    height: auto;
}

.vcpf-container input,
.vcpf-container select {
    max-width: none;
    width: 100%;
}

/* Estilos do Modal */
.vcpf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    will-change: opacity, visibility;
}

.vcpf-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.vcpf-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin: 20px;
    will-change: transform, opacity;
}

.vcpf-modal.active .vcpf-modal-content {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.vcpf-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.vcpf-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.vcpf-modal-body {
    padding: 20px;
}

.vcpf-candidato-preview {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.vcpf-candidato-preview img {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vcpf-modal-alert {
    display: flex;
    align-items: center;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.vcpf-icon-alert {
    margin-right: 10px;
    font-size: 1.2em;
}

.vcpf-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.vcpf-button {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    font-weight: 500;
}

.vcpf-button-primary {
    background-color: #007bff;
    color: white;
}

.vcpf-button-primary:hover {
    background-color: #0056b3;
}

.vcpf-button-secondary {
    background-color: #6c757d;
    color: white;
}

.vcpf-button-secondary:hover {
    background-color: #545b62;
}

/* Garantir que o modal fique acima de tudo */
body.modal-open {
    overflow: hidden;
}

.vcpf-modal * {
    box-sizing: border-box;
}