/* Página de Apurações Eleitorais - Layout Profissional */

/* Container principal */
.apuracoes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Banner superior */
.apuracoes-banner {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.apuracoes-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.apuracoes-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.apuracoes-banner p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Cabeçalho da página */
.apuracoes-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #1e3c72;
}

.apuracoes-header .page-title {
    color: #1e3c72;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.apuracoes-header .page-title i {
    color: #2a5298;
}

.apuracoes-header .page-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
}

/* Filtros de Eleição */
.election-filters {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.election-filters h3 {
    color: #1e3c72;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.election-filters .form-control {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.election-filters .form-control:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.election-filters .btn {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    justify-content: center;
}

.election-filters .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.3);
}

.election-filters .btn:active {
    transform: translateY(0);
}

.election-filters .btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: none;
}

.election-filters .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

/* Loading */
#loading {
    background: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

#loading .spinner-border {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #2a5298;
    color: #2a5298;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loading h3 {
    color: #2a5298;
    font-size: 1.3rem;
    margin: 0 0 10px 0;
}

#loading p {
    color: #6c757d;
    margin: 0;
}

/* Informações da Eleição */
.election-info .card {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    border-left: 5px solid #28a745;
}

.election-info .card-header {
    background: #28a745;
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 20px 25px;
}

.election-info .card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.election-info .card-body {
    padding: 30px 25px;
}

.election-info .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.election-info p {
    margin: 0 0 10px 0;
    font-size: 1rem;
    line-height: 1.5;
}

.election-info p strong {
    color: #495057;
    font-weight: 600;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.stat-box h4 {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-box p {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* Resultados dos Candidatos */
.candidates-results {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #dc3545;
}

.candidates-results h3 {
    color: #dc3545;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.candidate-card .card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.candidate-card .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #2a5298;
}

.candidate-card .card.border-success {
    border-color: #28a745 !important;
    background: linear-gradient(135deg, #f8fff9, #ffffff);
}

.candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.candidate-header h4 {
    color: #1e3c72;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.candidate-number {
    background: #2a5298;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    min-width: 50px;
    text-align: center;
}

.candidate-card .border-success .candidate-number {
    background: #28a745;
}

.candidate-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.candidate-party {
    font-size: 0.9rem;
    margin: 0;
}

.candidate-info p {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #495057;
}

.candidate-info p strong {
    color: #212529;
    font-weight: 600;
}

.vote-info {
    text-align: center;
}

.vote-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.vote-percentage {
    font-size: 1.1rem;
    font-weight: 600;
    color: #007bff;
    margin-top: 15px;
}

.candidate-card .border-success .vote-percentage {
    color: #28a745;
}

.percentage-bar {
    background: #e9ecef;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.percentage-fill {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    position: relative;
}

.percentage-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.percentage-text {
    font-weight: 700;
    color: #28a745;
    font-size: 1.1rem;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
}

.badge-success {
    background-color: #28a745;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 15px;
}

/* Mensagens de Estado */
#initial-message {
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

#initial-message i {
    color: #6c757d;
}

#error-message {
    border-radius: 8px;
    border: none;
    background: #f8d7da;
    color: #721c24;
}

/* Alertas informativos */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Widget de eleições */
.elections-widget {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.elections-widget h3 {
    color: #1e3c72;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

/* Responsividade */
@media (max-width: 768px) {
    .apuracoes-container {
        padding: 15px;
    }
    
    .apuracoes-banner {
        padding: 30px 20px;
    }
    
    .apuracoes-banner h1 {
        font-size: 2rem;
    }
    
    .apuracoes-header,
    .election-filters,
    .election-info,
    .candidates-results {
        padding: 20px;
    }
    
    .apuracoes-header .page-title {
        font-size: 1.5rem;
    }
    
    .election-filters {
        padding: 20px;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .election-filters .form-control,
    .election-filters .btn {
        margin-bottom: 10px;
    }
    
    .candidates-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .candidate-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .candidate-number {
        align-self: flex-end;
    }
    
    .stat-box {
        margin-bottom: 20px;
    }
    
    .stat-box h4 {
        font-size: 1.5rem;
    }
    
    .candidate-card .row {
        text-align: center;
    }
    
    .candidate-card .col-md-4 {
        margin-top: 15px;
    }
    
    .vote-info {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .apuracoes-banner h1 {
        font-size: 1.5rem;
    }
    
    .apuracoes-header .page-title {
        font-size: 1.3rem;
    }
    
    .election-filters h3,
    .election-info h3,
    .candidates-results h3 {
        font-size: 1.3rem;
    }
    
    .election-filters .btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .candidate-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .candidate-name {
        font-size: 1.1rem;
    }
    
    .vote-count {
        font-size: 1.3rem;
    }
}

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

.candidate-card {
    animation: fadeIn 0.5s ease-out;
}

.election-info {
    animation: fadeIn 0.5s ease-out;
}

/* Cores do tema */
.text-primary {
    color: #007bff !important;
}

.bg-primary {
    background-color: #007bff !important;
}

.border-primary {
    border-color: #007bff !important;
}