/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.6;
    color: #333333;
    background: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: all 0.3s ease;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Accessibility Quickbar */
#accessibility-quickbar {
    background: #2c3e50;
    color: white;
    padding: 10px 0;
    font-size: 14px;
}

#accessibility-quickbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accessibility-controls {
    display: flex;
    gap: 10px;
}

.acc-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.acc-btn:hover {
    background: rgba(255,255,255,0.2);
}

.acc-btn .icon {
    font-weight: bold;
    margin-right: 5px;
}

#skip-to-content {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Header Styles */
#main-header {
    background: white;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 20px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sa-flag-colors {
    display: flex;
    flex-direction: column;
    width: 30px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.flag-strip {
    height: 10px;
}

.flag-strip.black { background: #000000; }
.flag-strip.yellow { background: #FFB612; }
.flag-strip.green { background: #007749; }
.flag-strip.white { background: #FFFFFF; }
.flag-strip.blue { background: #001489; }
.flag-strip.red { background: #E03C31; }

.logo-section h1 {
    font-size: 2.5em;
    color: #2c3e50;
    font-weight: 700;
}

.highlight {
    color: #e74c3c;
}

.tagline {
    color: #7f8c8d;
    font-size: 1.1em;
}

.election-badge {
    background: #e74c3c;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.badge-year {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
}

.badge-text {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Progress Navigation */
#progress-nav {
    background: rgba(255,255,255,0.95);
    padding: 20px 0;
    margin-bottom: 30px;
}

.progress-steps {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 40px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bdc3c7;
    font-weight: 500;
}

.step.active {
    color: #2c3e50;
}

.step-number {
    background: #ecf0f1;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.step.active .step-number {
    background: #3498db;
    color: white;
}

/* Card Components */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
    display: none;
}

.card.active-step {
    display: block;
}

.card-header {
    background: #3498db;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 30px;
}

.card-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

.card-body {
    padding: 40px;
}

/* Form Styles */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-hint {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Party Selection Grid */
.parties-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.party-card {
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.party-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.2);
}

.party-card input[type="radio"] {
    display: none;
}

.party-card input[type="radio"]:checked + label {
    background: #f8f9fa;
    border-color: #27ae60;
}

.party-card input[type="radio"]:checked + label .selection-indicator {
    background: #27ae60;
    border-color: #27ae60;
}

.party-card input[type="radio"]:checked + label .selection-indicator::after {
    content: '✓';
    color: white;
    font-weight: bold;
}

.party-card label {
    display: flex;
    align-items: center;
    padding: 25px;
    cursor: pointer;
    margin: 0;
    transition: all 0.3s ease;
}

.party-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 12px;
}

.anc-logo { background: #008000; }
.da-logo { background: #0000FF; }
.eff-logo { background: #FF0000; }
.ifp-logo { background: #800080; }

.party-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.3em;
}

.party-abbr {
    font-weight: bold;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.party-slogan {
    color: #95a5a6;
    font-style: italic;
}

.selection-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid #bdc3c7;
    border-radius: 50%;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Button Styles */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.btn-primary, .btn-secondary, .btn-confirm {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: #3498db;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-confirm {
    background: #27ae60;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-arrow {
    font-size: 1.2em;
}

.btn-icon {
    font-size: 1.2em;
}

/* Review Section */
.review-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ecf0f1;
}

.review-item:last-child {
    border-bottom: none;
}

.review-item.highlight {
    background: #e8f6f3;
    margin: 0 -30px;
    padding: 20px 30px;
    border-radius: 8px;
    border: 2px solid #27ae60;
}

.review-label {
    font-weight: 600;
    color: #2c3e50;
}

.review-value {
    color: #34495e;
    font-weight: 500;
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.security-icon {
    font-size: 1.5em;
}

.security-text {
    color: #856404;
}

.security-text strong {
    color: #856404;
}

/* Live Dashboard */
#live-dashboard {
    background: rgba(255,255,255,0.1);
    padding: 30px 0;
    margin-top: 40px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.turnout-number {
    font-size: 3em;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

.turnout-label {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.progress-bar {
    background: #ecf0f1;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    background: #27ae60;
    background: linear-gradient(135deg, #27ae60, #229954);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 42%;
}

.progress-text {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Footer */
#main-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    text-align: center;
    color: #bdc3c7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.modal-content.success {
    background: #27ae60;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.vote-reference {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: monospace;
}

/* Accessibility Modes */
body.large-text {
    font-size: 18px;
}

body.larger-text {
    font-size: 20px;
}

body.high-contrast {
    background: #000000;
    color: #ffffff;
}

body.high-contrast .card {
    background: #000000;
    border: 2px solid #ffff00;
    color: #ffffff;
}

body.high-contrast .card-header {
    background: #ffff00;
    color: #000000;
}

body.dark-mode {
    background: #1a1a1a;
    color: #ffffff;
}

body.dark-mode .card {
    background: #2d2d2d;
    color: #ffffff;
}

body.dark-mode .card-header {
    background: #34495e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .parties-grid {
        grid-template-columns: 1fr;
    }
    
    .party-card label {
        flex-direction: column;
        text-align: center;
    }
    
    .party-logo {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-primary, .btn-secondary, .btn-confirm {
        width: 100%;
        justify-content: center;
    }
    
    #accessibility-quickbar .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .accessibility-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 20px;
    }
    
    .card-header {
        padding: 20px;
    }
    
    .card-header h2 {
        font-size: 1.5em;
    }
    
    .turnout-number {
        font-size: 2em;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
}