:root {
    --cor-principal: #2c3e50;
    --cor-secundaria: #e74c3c;
    --cor-fundo: #f8f9fa;
    --cor-texto: #333;
    --sombra: 0 4px 6px rgba(0,0,0,0.1);
    --transicao: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--cor-texto);
}

/* Header */
.header-votacao {
    background: var(--cor-principal);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--sombra);
    position: relative;
    overflow: hidden;
}

.header-votacao::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.logo-empresa {
    max-height: 80px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Container Principal */
.container-votacao {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards de Candidatos */
.candidatos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card-candidato {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: var(--transicao);
    position: relative;
    border: 3px solid transparent;
}

.card-candidato:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.card-candidato.selecionado {
    border-color: var(--cor-secundaria);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.2);
}

.card-candidato .foto-candidato {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 4px solid var(--cor-principal);
}

.card-candidato .info-candidato {
    padding: 1.5rem;
    text-align: center;
}

.card-candidato .nome {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--cor-principal);
    margin-bottom: 0.5rem;
}

.card-candidato .funcao {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.card-candidato .empresa {
    display: inline-block;
    background: var(--cor-principal);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.checkbox-selecao {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: var(--transicao);
}

.checkbox-selecao i {
    color: #ddd;
    font-size: 1.2rem;
}

.card-candidato.selecionado .checkbox-selecao {
    background: var(--cor-secundaria);
}

.card-candidato.selecionado .checkbox-selecao i {
    color: white;
}

/* Formulário de Categoria */
.form-categoria {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--sombra);
    margin-bottom: 2rem;
    text-align: center;
}

.form-categoria h3 {
    color: var(--cor-principal);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.input-categoria {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: var(--transicao);
}

.input-categoria:focus {
    outline: none;
    border-color: var(--cor-principal);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.btn-continuar {
    background: var(--cor-principal);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transicao);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.btn-continuar:hover {
    background: var(--cor-secundaria);
    transform: scale(1.05);
}

/* Botão de Voto */
.btn-votar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cor-secundaria);
    color: white;
    border: none;
    padding: 1.2rem 4rem;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    transition: var(--transicao);
    z-index: 1000;
    display: none;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-votar:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.6);
}

.btn-votar:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Contador de Seleção */
.contador-selecao {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--cor-principal);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: var(--sombra);
    z-index: 1000;
}

/* Mensagens */
.mensagem {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.mensagem.erro {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.mensagem.sucesso {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Admin Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cor-principal) 0%, #34495e 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: var(--cor-principal);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transicao);
}

.form-control:focus {
    outline: none;
    border-color: var(--cor-principal);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--cor-principal);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transicao);
    font-weight: bold;
}

.btn-login:hover {
    background: var(--cor-secundaria);
}

/* Dashboard Admin */
.sidebar {
    background: var(--cor-principal);
    min-height: 100vh;
    color: white;
    padding: 2rem 0;
    position: fixed;
    width: 250px;
}

.sidebar .logo {
    text-align: center;
    padding: 0 1rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu a {
    display: block;
    padding: 1rem 2rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transicao);
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--cor-secundaria);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
}

.main-content {
    margin-left: 250px;
    padding: 2rem;
    background: #f5f6fa;
    min-height: 100vh;
}

/* Cards Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    transition: var(--transicao);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.orange { background: #fff3e0; color: #f57c00; }
.stat-icon.red { background: #ffebee; color: #d32f2f; }

.stat-info h3 {
    font-size: 2rem;
    color: var(--cor-texto);
    margin-bottom: 0.2rem;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Tabelas */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: var(--sombra);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    background: var(--cor-principal);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--cor-principal);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background: #f8f9fa;
}

td img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Botões de Ação */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transicao);
    text-decoration: none;
    display: inline-block;
    margin: 0 2px;
}

.btn-primary {
    background: var(--cor-principal);
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: var(--cor-principal);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Filtros */
.filtros {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: var(--sombra);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.filtro-group {
    flex: 1;
    min-width: 200px;
}

.filtro-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .candidatos-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-votar {
        width: 90%;
        padding: 1rem;
    }
    
    .contador-selecao {
        top: auto;
        bottom: 100px;
        right: 50%;
        transform: translateX(50%);
    }
}

/* Animações */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Gráficos simples */
.grafico-barra {
    background: #eee;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.grafico-preenchimento {
    height: 100%;
    background: linear-gradient(90deg, var(--cor-principal), var(--cor-secundaria));
    border-radius: 15px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}