:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--dark-color);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
    border: none;
}

.status-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.status-card .alert {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
}

.card-title {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--light-color);
    font-weight: 600;
}

.encuesta-status h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

#countdown {
    font-weight: bold;
    font-size: 1.4rem;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 10px;
    display: inline-block;
}

.progress-bar {
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #00b09b, #96c93d);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.candidate-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.candidate {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.candidate:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--secondary-color);
    background: white;
}

.candidate input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.candidate input[type="radio"]:checked + .candidate-img {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

.candidate input[type="radio"]:checked ~ .candidate-info .candidate-name {
    color: var(--success-color);
}

.candidate-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid var(--light-color);
    transition: all 0.3s ease;
}

.candidate-info {
    flex: 1;
}

.candidate-name {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.candidate-party {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.g-recaptcha {
    display: none;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, var(--secondary-color));
}

.btn-block {
    display: block;
    width: 100%;
}

.alert {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-weight: 600;
    border: none;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 5px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 5px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 5px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 5px solid var(--info-color);
}

.results-container {
    margin-top: 20px;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 40px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.results-list {
    margin-bottom: 30px;
}

.result-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.candidate-result-name {
    font-size: 1.1rem;
}

.candidate-result-name small {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: normal;
}

.result-stats {
    color: var(--secondary-color);
    font-weight: bold;
}

.results-summary {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 1.1rem;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.status-no_iniciada {
    background: #fff3cd;
    color: #856404;
}

.status-en_progreso {
    background: #d1ecf1;
    color: #0c5460;
}

.status-finalizada {
    background: #d4edda;
    color: #155724;
}

.nav-tabs {
    display: flex;
    list-style: none;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-tabs li {
    margin-right: 5px;
}

.nav-tabs a {
    display: block;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--dark-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.nav-tabs a.active {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.nav-tabs a:hover:not(.active) {
    background: #f8f9fa;
    color: var(--secondary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    color: white;
    font-size: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Estilos para el panel de administración */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.admin-header {
    background: linear-gradient(135deg, var(--dark-color), #34495e);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.admin-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.admin-nav {
    margin: 25px 0 0 0;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.candidatos-list {
    margin-top: 40px;
}

.candidato-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.3s ease;
}

.candidato-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.candidato-info {
    flex: 1;
}

.candidato-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, var(--danger-color));
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, var(--warning-color));
}

.current-photo {
    max-width: 120px;
    border-radius: 8px;
    margin-top: 10px;
    border: 3px solid #e9ecef;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading:after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .candidate-list {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tabs li {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .result-name {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-stats {
        margin-top: 5px;
    }
    
    .candidato-item {
        flex-direction: column;
        text-align: center;
    }
    
    .candidato-actions {
        margin-top: 15px;
        justify-content: center;
    }
    
    .candidate {
        flex-direction: column;
        text-align: center;
    }
    
    .candidate-img {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .admin-header h1 {
        font-size: 1.8rem;
    }
}