/* InstantVote - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.login-card {
    max-width: 400px;
    margin: 100px auto;
}

h1, h2, h3 {
    color: #2d3748;
    margin-bottom: 20px;
}

h1 {
    font-size: 28px;
    text-align: center;
}

h2 {
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: #f56565;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-success {
    background: #48bb78;
}

.btn-success:hover {
    background: #38a169;
}

.btn-secondary {
    background: #718096;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

.nav {
    background: white;
    padding: 15px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: #4a5568;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-links a:hover {
    background: #f7fafc;
    color: #667eea;
}

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

.candidate-card {
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.candidate-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.candidate-card.selected {
    border-color: #667eea;
    background: #f7fafc;
}

.candidate-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 4px solid #e2e8f0;
}

.candidate-name {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.candidate-description {
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.table tr:hover {
    background: #f7fafc;
}

.result-item {
    margin-bottom: 25px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.result-votes {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    transition: width 0.5s ease;
}

.winner-badge {
    display: inline-block;
    background: #48bb78;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

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

.text-muted {
    color: #718096;
    font-size: 14px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.actions {
    display: flex;
    gap: 10px;
}

.no-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 60px;
    color: #a0aec0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    .nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .candidate-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
