* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8e6e8 0%, #e8f4f0 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    padding: 40px 20px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Card Container */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.card p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1em;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.btn-primary {
    background: linear-gradient(135deg, #f42a41 0%, #c41e3a 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c41e3a 0%, #f42a41 100%);
    transform: scale(1.05);
}

.btn-success {
    background: linear-gradient(135deg, #006a4e 0%, #004d3a 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #004d3a 0%, #006a4e 100%);
    transform: scale(1.05);
}

.btn-info {
    background: linear-gradient(135deg, #f42a41 0%, #006a4e 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #006a4e 0%, #f42a41 100%);
    transform: scale(1.05);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 15px;
    font-size: 0.85em;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.2em;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 40px;
    opacity: 0.8;
}

/* Login Box */
.login-box {
    max-width: 450px;
    margin: 50px auto;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.login-box h2 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.login-box p {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #f42a41;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1f5e8;
    color: #004d3a;
    border: 1px solid #006a4e;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #f42a41 0%, #006a4e 100%);
    padding: 20px 0;
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(244, 42, 65, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.navbar h2 {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 8px;
}

.navbar a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Premium Upgrade Button */
.premium-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.3);
}

.premium-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
    transform: translateY(-3px) scale(1.05);
}

/* Admin Navigation */
.admin-nav, .user-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.admin-nav a, .user-nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.admin-nav a:hover, .user-nav a:hover {
    background: #f3f4f6;
}

.admin-nav a.active, .user-nav a.active {
    background: linear-gradient(135deg, #f42a41 0%, #c41e3a 100%);
    color: white;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #f42a41;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-card p {
    color: #666;
    font-size: 1em;
}

/* Tables */
.section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section h3 {
    color: #333;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #f9fafb;
}

table th {
    padding: 12px;
    text-align: left;
    color: #374151;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

table tbody tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-active {
    background: #d1f5e8;
    color: #004d3a;
}

.badge-completed {
    background: #e5e7eb;
    color: #374151;
}

.badge-upcoming {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: #d1f5e8;
    color: #004d3a;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Form Card */
.form-card {
    background: #f9fafb;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e5e7eb;
}

.form-card h3 {
    margin-bottom: 20px;
    color: #333;
}

/* Candidates Grid */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.candidate-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.candidate-photo {
    margin-bottom: 15px;
}

.candidate-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f42a41 0%, #006a4e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5em;
    font-weight: bold;
}

.candidate-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.candidate-card p {
    color: #666;
    margin-bottom: 20px;
    min-height: 60px;
}

.radio-btn {
    display: block;
    cursor: pointer;
}

.radio-btn input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-btn span {
    font-weight: 600;
    color: #f42a41;
}

/* Success Box */
.success-box {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.success-icon {
    width: 100px;
    height: 100px;
    background: #006a4e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    margin: 0 auto 20px;
}

.success-box h2 {
    color: #333;
    margin-bottom: 15px;
}

.success-box p {
    color: #666;
    margin-bottom: 10px;
}

/* Results Page */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.results-header h1 {
    color: #333;
}

.election-info {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.election-info h2 {
    color: #333;
    margin-bottom: 10px;
}

.election-info p {
    color: #666;
    margin-bottom: 8px;
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.chart-section, .results-table-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-section h3, .results-table-section h3 {
    color: #333;
    margin-bottom: 20px;
}

.results-table {
    width: 100%;
}

.rank-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
}

.rank-badge.gold {
    background: #fbbf24;
    color: #78350f;
}

.rank-badge.silver {
    background: #d1d5db;
    color: #374151;
}

.rank-badge.bronze {
    background: #fdba74;
    color: #7c2d12;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f3f4f6;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f42a41 0%, #006a4e 100%);
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 20px;
}

.mb-3 {
    margin-bottom: 20px;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
}

.action-card h3 {
    color: #333;
    margin-bottom: 15px;
}

.action-card p {
    color: #666;
    margin-bottom: 20px;
}

/* Elections Grid */
.elections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.election-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.election-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.election-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.election-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .card-container {
        grid-template-columns: 1fr;
    }
    
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .admin-nav, .user-nav {
        flex-direction: column;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
    }
}
