/* styles.css - Estilos principales del sistema */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

* {
    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(--primary-color);
    color: white;
    padding: 40px 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;
}

.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;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.status-card {
    background: var(--secondary-color);
    color: white;
}

.card-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--light-color);
}

.encuesta-status h3 {
    margin-bottom: 15px;
}

#countdown {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    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: white;
    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: var(--light-color);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.candidate:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--secondary-color);
    background: white;
}

.candidate.selected {
    border-color: var(--success-color);
    background: #f0fff0;
}

.candidate input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.candidate-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.candidate-info {
    flex: 1;
}

.candidate-name {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.candidate-party {
    color: #666;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-warning {
    background: var(--warning-color);
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.results-list {
    margin: 30px 0;
}

.result-item {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 10px;
    transition: all 0.3s;
}

.result-item:hover {
    transform: translateX(5px);
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.result-stats {
    color: var(--secondary-color);
}

.results-summary {
    text-align: center;
    padding: 20px;
    background: var(--light-color);
    border-radius: 10px;
    font-size: 1.1rem;
}

.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    color: white;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.admin-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .candidate-list {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .result-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .admin-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .candidate {
        flex-direction: column;
        text-align: center;
    }
    
    .candidate-img {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .candidate input[type="radio"] {
        margin: 0 0 15px 0;
    }
}