:root {
    --primary: #1a237e;
    --primary-dark: #000051;
    --accent: #ff6f00;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text: #1c1c1c;
    --shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
    --btn-shadow: 0 4px 15px rgba(26, 35, 126, 0.3);
}

/* --- HIGH CONTRAST MODE --- */
body.high-contrast {
    --primary: #000000;
    --glass-bg: #ffffff;
    --glass-border: #000000;
    --text: #000000;
    --shadow: none;
}
body.high-contrast .glass, 
body.high-contrast .card, 
body.high-contrast .btn-primary,
body.high-contrast input {
    border: 2px solid #000 !important;
    box-shadow: none !important;
}
body.high-contrast .background-mesh { display: none; }

body {
    background: #f0f2f5;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    padding-top: 80px;
    margin: 0;
    overflow-x: hidden;
}

/* --- ANIMATED BACKGROUND --- */
.background-mesh {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
    overflow: hidden;
}
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.6;
    animation: float 10s infinite alternate;
}
.b1 { width: 400px; height: 400px; background: #a6c0fe; top: -50px; left: -100px; }
.b2 { width: 300px; height: 300px; background: #f68084; bottom: -50px; right: -50px; animation-delay: 2s; }
.b3 { width: 350px; height: 350px; background: #fff1eb; top: 40%; left: 40%; animation-delay: 4s; }

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

/* --- LAYOUT --- */
.main-wrapper { width: 100%; max-width: 900px; margin: 0 auto; padding: 20px; }

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

/* --- TOP BAR --- */
.top-bar {
    position: fixed; top: 15px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 860px;
    padding: 10px 20px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000;
}
.lang-btn { background: none; border: none; padding: 6px 12px; cursor: pointer; color: #555; }
.lang-btn.active { background: var(--primary); color: white; border-radius: 20px; font-weight: 600; }
.access-btn { background: none; border: 2px solid var(--primary); color: var(--primary); padding: 5px 15px; border-radius: 20px; font-weight: 600; cursor: pointer; }

/* --- HEADER --- */
.header-content { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 25px; text-align: center; }
.logo-box { width: 70px; height: 70px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
h1 { font-size: 28px; color: var(--primary); font-weight: 800; margin: 0; }

.progress-container {
    display: flex; justify-content: center; align-items: center; margin-bottom: 30px;
}
.step { text-align: center; color: #999; font-size: 12px; font-weight: 600; position: relative; z-index: 2; }
.step-circle {
    width: 30px; height: 30px; background: #ddd; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 5px auto; color: #fff;
}
.step.active .step-circle { background: var(--primary); box-shadow: 0 0 10px rgba(26, 35, 126, 0.4); }
.step.active { color: var(--primary); }
.line { width: 50px; height: 2px; background: #ddd; margin: 0 10px; margin-bottom: 20px; }

.queue-status {
    width: fit-content; margin: 0 auto 30px auto; padding: 8px 25px;
    display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--primary);
    border-radius: 30px;
}
.pulse-dot {
    width: 10px; height: 10px; background: #00c853; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7);
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 200, 83, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}

/* --- FORMS --- */
.card { max-width: 500px; margin: 0 auto; overflow: hidden; }
.card-header { background: linear-gradient(135deg, var(--primary), #303f9f); padding: 25px; color: white; text-align: center; }
.card-body { padding: 35px; }
.input-group { position: relative; margin-bottom: 25px; }
.input-group label { display: block; font-weight: 700; font-size: 12px; text-transform: uppercase; color: #555; margin-bottom: 8px; letter-spacing: 0.5px; }
.input-group input {
    width: 100%; padding: 14px 14px 14px 45px;
    border: 2px solid #e0e0e0; border-radius: 10px;
    font-size: 16px; transition: 0.3s; background: rgba(255,255,255,0.7);
}
.input-group input:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 4px rgba(26, 35, 126, 0.1); }
.input-icon { position: absolute; left: 15px; top: 44px; color: #aaa; font-size: 18px; }

.btn-primary, .btn-success {
    width: 100%; padding: 16px; border: none; border-radius: 10px;
    font-size: 16px; font-weight: 600; cursor: pointer; color: white;
    box-shadow: var(--btn-shadow); transition: all 0.2s;
    display: flex; justify-content: center; align-items: center; gap: 10px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #3949ab); }
.btn-success { background: linear-gradient(135deg, #2e7d32, #43a047); }
.btn-primary:hover, .btn-success:hover { transform: translateY(-2px); filter: brightness(110%); }

/* --- VOTING PANEL --- */
.voting-grid { display: grid; grid-template-columns: 2fr 1.2fr; gap: 20px; }
@media (max-width: 768px) { .voting-grid { grid-template-columns: 1fr; } }

.ballot-unit {
    background: #e0e0e0; border: 1px solid #bbb; border-radius: 15px;
    box-shadow: inset 2px 2px 5px rgba(255,255,255,0.7), inset -2px -2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}
.evm-header {
    background: #263238; color: #fff; padding: 15px 25px;
    display: flex; justify-content: space-between; font-family: 'Orbitron'; letter-spacing: 1px;
}
.candidate-row {
    display: flex; align-items: center; padding: 15px 25px;
    border-bottom: 2px solid #ccc; background: #f5f5f5; min-height: 90px;
}

/* 3D Button */
.vote-btn { background: none; border: none; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 15px; }
.blue-btn-3d {
    width: 70px; height: 35px;
    background: linear-gradient(180deg, #2196f3 0%, #0d47a1 100%);
    border-radius: 6px;
    box-shadow: 0 5px 0 #002171, 0 10px 10px rgba(0,0,0,0.2);
    transition: 0.1s; position: relative; border: 1px solid #42a5f5;
}
.blue-btn-3d::after {
    content: ''; position: absolute; top: 5px; left: 5px; right: 5px; height: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    border-radius: 4px;
}
.vote-btn:active .blue-btn-3d, .vote-btn.pressed .blue-btn-3d {
    transform: translateY(5px); box-shadow: 0 0 0 #002171, inset 0 2px 5px rgba(0,0,0,0.3);
}

.led-indicator {
    width: 15px; height: 15px; background: #4a0000; border-radius: 50%;
    border: 2px solid #888; box-shadow: inset 0 2px 3px rgba(0,0,0,0.5);
    transition: 0.2s;
}
.led-indicator.on {
    background: #ff0000; box-shadow: 0 0 20px #ff0000, inset 0 -2px 5px rgba(255,0,0,0.5); border-color: #ff5555;
}

/* --- VVPAT & ANIMATION --- */
.vvpat-unit {
    background: #37474f; border-radius: 12px; padding: 20px;
    display: flex; flex-direction: column; align-items: center;
    border: 4px solid #455a64; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.glass-window {
    width: 140px; height: 160px; background: #111;
    border: 8px solid #222; border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.1);
    position: relative; overflow: hidden;
}
.paper-slip {
    width: 90%; background: #fff; margin: 0 auto; padding: 15px 5px;
    text-align: center; position: absolute; top: -120px; left: 5%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); font-family: monospace;
}

@keyframes printDrop {
    0% { top: -120px; } 15% { top: 20px; } 85% { top: 20px; } 100% { top: 180px; }
}
.animate-slip { animation: printDrop 3s forwards cubic-bezier(0.25, 1, 0.5, 1); }

/* --- CERTIFICATE --- */
.certificate {
    text-align: center; padding: 40px; max-width: 500px; margin: 0 auto;
    background: #fff; position: relative;
    border: 8px solid #c5a059; border-radius: 10px;
    background-image: radial-gradient(#f1f8e9 1px, transparent 1px); background-size: 20px 20px;
}
.check-animation {
    width: 90px; height: 90px; background: #e8f5e9; color: #2e7d32;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 45px; margin: 0 auto 20px auto;
    box-shadow: 0 10px 20px rgba(46, 125, 50, 0.2);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from{ transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- ADMIN PANEL (UPDATED DASHBOARD) --- */
.admin-footer { text-align: center; margin-top: 30px; }

#admin-toggle-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a237e; padding: 8px 24px; border-radius: 50px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: all 0.3s; backdrop-filter: blur(5px);
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    animation: pulseGlow 3s infinite;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(26, 35, 126, 0.2); }
    70% { box-shadow: 0 0 0 10px rgba(26, 35, 126, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 35, 126, 0); }
}

#admin-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.admin-box {
    width: 90%; max-width: 550px; 
    background: rgba(255, 255, 255, 0.95);
    padding: 30px; border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.6);
}
.admin-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #eee; padding-bottom: 15px; margin-bottom: 25px; }
.admin-header h3 { font-size: 20px; color: #333; margin: 0; font-weight: 800; }

/* Login Elements */
#admin-login { text-align: center; padding: 10px 0; }
#admin-login::before {
    content: '\f023'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    font-size: 60px; color: var(--primary); display: block;
    margin-bottom: 20px; text-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

#admin-password {
    text-align: center; font-size: 24px; letter-spacing: 8px;
    font-family: 'Orbitron', monospace; font-weight: bold;
    border: 2px solid #e0e0e0; background: #f1f3f4;
    padding: 15px; border-radius: 12px; width: 100%;
    margin: 0 auto 20px auto; display: block; transition: 0.3s;
}
#admin-password:focus {
    border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 5px rgba(26, 35, 126, 0.1); outline: none;
}
/* Error Animation Class */
.error-shake {
    border-color: #ff1744 !important;
    box-shadow: 0 0 15px rgba(255, 23, 68, 0.3) !important;
    animation: shake 0.4s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* Dashboard Stats */
.stats-row { display: flex; gap: 15px; margin-bottom: 25px; }
.stat-box { 
    flex: 1; background: linear-gradient(135deg, #f5f7fa, #e4e8f0); 
    padding: 20px; border-radius: 12px; text-align: center;
    border: 1px solid #dce1e9; position: relative; overflow: hidden;
}
.stat-box::after {
    content: ''; position: absolute; top: -10px; right: -10px;
    width: 60px; height: 60px; background: rgba(0,0,0,0.03);
    border-radius: 50%; z-index: 0;
}
.stat-box h2 { font-size: 32px; margin: 5px 0 0 0; position: relative; z-index: 1; }
.stat-box.highlight { 
    background: linear-gradient(135deg, #e3f2fd, #bbdefb); 
    color: #0d47a1; border-color: #90caf9;
}

/* Bar Chart */
.bar-row { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; font-weight: 600; }
.progress-bg { height: 14px; background: #eceff1; border-radius: 7px; overflow: hidden; border: 1px solid #cfd8dc; }
.progress-fill { 
    height: 100%; background: repeating-linear-gradient(45deg, var(--primary), var(--primary) 10px, #283593 10px, #283593 20px);
    width: 0%; transition: 1s cubic-bezier(0.25, 1, 0.5, 1);
    background-size: 200% 200%; animation: stripeMove 20s linear infinite;
}
@keyframes stripeMove { 0% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Utilities */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.8s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

#toast-box { position: fixed; bottom: 30px; right: 30px; display: flex; flex-direction: column; gap: 10px; z-index: 5000; }
.toast { background: #333; color: white; padding: 14px 28px; border-radius: 50px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); animation: slideUp 0.3s; }
.toast.success { background: linear-gradient(45deg, #2e7d32, #43a047); }
.toast.error { background: linear-gradient(45deg, #c62828, #e53935); }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }