* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient);
    min-height: 100vh;
    padding: 2rem;
    color: var(--text-primary);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

h2 {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    border-radius: 2px;
}

.cargo-section {
    background: white;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
    transition: all 0.3s ease;
    position: relative;
}

.cargo-section:nth-child(2) { animation-delay: 0.1s; }
.cargo-section:nth-child(3) { animation-delay: 0.2s; }
.cargo-section:nth-child(4) { animation-delay: 0.3s; }
.cargo-section:nth-child(5) { animation-delay: 0.4s; }

.cargo-section:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
}

.cargo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--warning-color));
}

h3 {
    font-size: 1.8rem;
    font-weight: 600;
    padding: 2rem 2rem 1rem;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin-bottom: 0;
    position: relative;
}

h3::before {
    content: '🏆';
    margin-right: 0.5rem;
    font-size: 1.5rem;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

li:last-child {
    border-bottom: none;
}

li:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transform: translateX(10px);
    padding-left: 3rem;
}

li:first-child {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    font-weight: 600;
    color: var(--dark-color);
    position: relative;
    overflow: hidden;
}

li:first-child::before {
    content: '👑';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}



.candidate-name {
    font-weight: 500;
    color: var(--text-primary);
    flex-grow: 1;
}

.vote-count {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

li:hover .vote-count {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.cerrar-btn {
    display: block;
    margin: 3rem auto 2rem;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.cerrar-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.cerrar-btn:hover::before {
    width: 300px;
    height: 300px;
}

.cerrar-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.cerrar-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.stats-bar {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.total-votes {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-label {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .cargo-section {
        margin-bottom: 1.5rem;
    }

    h3 {
        font-size: 1.4rem;
        padding: 1.5rem 1rem 0.75rem;
    }

    li {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    li:hover {
        transform: none;
        padding-left: 1rem;
    }

    .vote-count {
        align-self: flex-end;
        min-width: 60px;
    }

    .cerrar-btn {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: loading 1s ease-in-out infinite alternate;
}

@keyframes loading {
    to {
        opacity: 1;
    }
}

/* Particle effect for background */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}