/* Voting System Frontend Styles - Version: <?php echo time(); ?> */

.voting-system-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header Styles */
.voting-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.voting-title {
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.voting-description {
    font-size: 1.2rem;
    margin: 0 0 25px 0;
    opacity: 0.9;
    line-height: 1.6;
}

.campaign-status {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
}

.campaign-status.active {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.campaign-status.inactive {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

.status-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Candidates Grid */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.candidate-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.candidate-card.selected {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.candidate-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.candidate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.candidate-card:hover .candidate-image img {
    transform: scale(1.05);
}

.candidate-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.candidate-info {
    padding: 20px;
}

.candidate-name {
    font-size: 1.4rem;
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-weight: 600;
}

.candidate-position {
    color: #667eea;
    font-weight: 500;
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.candidate-description {
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.candidate-selection {
    padding: 0 20px 20px;
}

.candidate-selection input[type="radio"] {
    display: none;
}

.vote-button {
    display: block;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
}

.vote-button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.candidate-card input[type="radio"]:checked + .vote-button {
    background: #4CAF50;
    transform: scale(1.02);
}

/* Voter Info Section */
.voter-info-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.voter-info-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.voter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Submit Button */
.form-submit {
    text-align: center;
    margin-bottom: 30px;
}

.submit-vote-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.submit-vote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.submit-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Voting Rules */
.voting-rules {
    background: #e8f4fd;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.voting-rules h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.voting-rules ul {
    margin: 0;
    padding-left: 20px;
}

.voting-rules li {
    margin-bottom: 8px;
    color: #34495e;
    line-height: 1.5;
    font-size: 15px;
}

/* Campaign Inactive */
.campaign-inactive {
    text-align: center;
    padding: 60px 20px;
}

.inactive-message h3 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.inactive-message p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* No Candidates */
.no-candidates {
    text-align: center;
    padding: 60px 20px;
}

.no-candidates-message h3 {
    color: #f39c12;
    margin-bottom: 20px;
}

.no-candidates-message p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Voting Message */
.voting-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 9999;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.voting-message.success {
    background: #4CAF50;
}

.voting-message.error {
    background: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Results Styles */
.voting-results-container {
    margin-top: 40px;
}

.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.total-votes {
    text-align: center;
}

.total-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
}

.total-label {
    color: #7f8c8d;
    font-size: 1rem;
}

.top-candidate {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    padding: 20px;
    border-radius: 15px;
    color: #2c3e50;
}

.top-badge {
    font-size: 3rem;
    margin-right: 20px;
}

.top-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.top-position {
    margin: 0 0 5px 0;
    color: #667eea;
}

.top-votes {
    margin: 0;
    font-weight: 600;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.result-card.top-1 {
    border: 3px solid #ffd700;
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
}

.result-card.top-2 {
    border: 3px solid #c0c0c0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.result-card.top-3 {
    border: 3px solid #cd7f32;
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
}

.result-rank {
    margin-right: 20px;
    text-align: center;
}

.rank-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

.rank-medal {
    font-size: 1.5rem;
}

.result-content {
    flex: 1;
}

.candidate-details h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.candidate-position {
    margin: 0 0 15px 0;
    color: #667eea;
}

.vote-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vote-count {
    text-align: center;
}

.count-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.count-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.percentage-value {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.vote-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* Chart Styles */
.results-chart {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.results-chart h4 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    text-align: center;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bar-label {
    min-width: 150px;
    font-weight: 600;
    color: #2c3e50;
}

.bar-container {
    flex: 1;
    position: relative;
    height: 30px;
    background: #e1e8ed;
    border-radius: 15px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.8s ease;
    border-radius: 15px;
}

.bar-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .voting-system-container {
        padding: 15px;
    }
    
    .voting-title {
        font-size: 2rem;
    }
    
    .candidates-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .voter-fields {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .bar-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .voting-header {
        padding: 20px;
    }
    
    .voting-title {
        font-size: 1.8rem;
    }
    
    .candidate-card {
        margin: 0 10px;
    }
    
    .submit-vote-btn {
        min-width: 100%;
    }
}
