/* Page Header - Compact */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary);
}

/* Main Layout */
.results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* Quick Count Section */
.quick-count-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

.total-votes-badge {
    background: var(--gradient-1);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Candidate Quick Count Card */
.candidate-quick-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.candidate-quick-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-1);
}

.candidate-quick-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.candidate-quick-card.leading {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: var(--primary);
}

.candidate-quick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.candidate-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.candidate-number {
    background: var(--gradient-1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.candidate-name-wrap h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 3px 0;
}

.candidate-name-wrap p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.vote-count {
    text-align: right;
}

.vote-count h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 3px 0;
}

.vote-count p {
    font-size: 18px;
    color: #64748b;
    font-weight: 600;
    margin: 0;
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 50px;
    transition: width 1s ease-out;
}

.leading-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

/* Chart Section */
.chart-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chart-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chart-btn.active {
    background: var(--gradient-1);
    border-color: var(--primary);
    color: white;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 350px;
    max-height: 500px;
}


/* Last Updated Footer */
.last-updated-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
}

.last-updated-footer i {
    color: var(--primary);
    font-size: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.last-updated-footer .update-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.last-updated-footer .update-text {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.last-updated-footer .update-time {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 1200px) {
    .results-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chart-container {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 15px;
        height: auto;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .candidate-quick-card {
        padding: 15px;
    }

    .candidate-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .candidate-name-wrap h4 {
        font-size: 14px;
    }

    .vote-count h3 {
        font-size: 20px;
    }

    .chart-controls {
        flex-direction: column;
    }

    .chart-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}