/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: block;
}

/* Login Page Styles */
.login-container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.login-form {
    padding: 40px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

/* Verification Methods */
.method-tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
}

.tab-btn:hover {
    background: #45a049;
    color: white;
}

.method {
    display: none;
}

.method.active {
    display: block;
}

/* Biometric Scanner */
.biometric-scanner {
    text-align: center;
    padding: 40px 20px;
}

.scanner-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.scan-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.scan-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* OTP Form */
.otp-form {
    padding: 20px 0;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.otp-btn, .verify-btn {
    width: 100%;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.otp-btn:hover, .verify-btn:hover {
    background: #45a049;
}

/* Voter Info */
.voter-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.voter-info h3 {
    margin-bottom: 20px;
    color: #333;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: #666;
}

.disclaimer {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.disclaimer i {
    color: #2196F3;
    font-size: 1.2rem;
}

.proceed-btn {
    width: 100%;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.proceed-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Voting Flow Styles */
.voting-flow {
    background: white;
    border-radius: 20px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Progress Indicator */
.voting-progress {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 16.67%;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #4CAF50;
    color: white;
}

.step.completed .step-number {
    background: #4CAF50;
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
    font-size: 1.2rem;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

/* Voting Screens */
.voting-container {
    padding: 40px;
    min-height: 500px;
}

.voting-screen {
    display: none;
}

.voting-screen.active {
    display: block;
}

.screen-header {
    text-align: center;
    margin-bottom: 40px;
}

.screen-header h2 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 10px;
}

.location-info {
    font-size: 1.1rem;
    color: #666;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

/* Candidate Cards */
.candidates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.candidate-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.candidate-card:hover {
    border-color: #4CAF50;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.candidate-card.selected {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
}

.candidate-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #666;
    overflow: hidden;
}

.candidate-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.party-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.party-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.party-name {
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
}

.deputy-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #666;
}

.select-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.select-btn:hover {
    background: #45a049;
}

.select-btn.selected {
    background: #2e7d32;
}

.select-btn.selected::after {
    content: ' ✓';
    font-size: 1.2rem;
}

/* Voting Controls */
.voting-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.nav-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prev-btn {
    background: #6c757d;
    color: white;
}

.prev-btn:hover:not(:disabled) {
    background: #5a6268;
}

.next-btn {
    background: #4CAF50;
    color: white;
}

.next-btn:hover:not(:disabled) {
    background: #45a049;
}

.skip-btn {
    background: #ffc107;
    color: #333;
}

.skip-btn:hover {
    background: #e0a800;
}

.nav-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* Review Page */
.review-container {
    max-width: 800px;
    margin: 50px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.review-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 30px;
    text-align: center;
}

.review-header h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.votes-summary {
    padding: 40px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

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

.summary-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.summary-table tr:hover {
    background: #f8f9fa;
}

.review-controls {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.edit-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #5a6268;
}

.submit-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Confirmation Page */
.confirmation-container {
    max-width: 600px;
    margin: 50px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    padding: 40px;
}

.success-icon {
    font-size: 5rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.confirmation-container h2 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.confirmation-container p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
}

.receipt-info {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.receipt-info h3 {
    margin-bottom: 20px;
    color: #333;
}

.receipt-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: left;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.receipt-item:last-child {
    border-bottom: none;
}

.receipt-item label {
    font-weight: 600;
    color: #666;
}

.final-message {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 10px;
    color: #2e7d32;
}

/* Accessibility Controls */
.accessibility-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.access-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.access-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page {
        padding: 10px;
    }
    
    .login-container {
        margin: 20px auto;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .login-form {
        padding: 20px;
    }
    
    .voting-flow {
        margin: 10px;
    }
    
    .voting-container {
        padding: 20px;
    }
    
    .candidates-container {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .step {
        min-width: 60px;
    }
    
    .voting-controls {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .accessibility-controls {
        position: relative;
        flex-direction: row;
        justify-content: center;
        margin: 20px 0;
    }
}

/* Large Font Size Mode */
body.large-font {
    font-size: 1.2rem;
}

body.large-font .candidate-name {
    font-size: 1.6rem;
}

body.large-font .screen-header h2 {
    font-size: 2.5rem;
}

/* High Contrast Mode */
body.high-contrast {
    background: #000;
    color: #fff;
}

body.high-contrast .page {
    background: #000;
    color: #fff;
}

body.high-contrast .candidate-card {
    background: #333;
    border-color: #fff;
    color: #fff;
}

body.high-contrast .candidate-card:hover {
    background: #444;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}