* {
    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;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Gen Z Inspired Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%),
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, 0.03) 35px, rgba(255, 255, 255, 0.03) 70px);
    z-index: -2;
    animation: backgroundShift 20s ease infinite;
}

@keyframes backgroundShift {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Floating geometric shapes for Gen Z aesthetic */
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 107, 107, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(78, 205, 196, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 195, 113, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: floatingShapes 15s ease-in-out infinite;
}

@keyframes floatingShapes {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 30px;
    backdrop-filter: blur(10px);
    position: relative;
}

.disclaimer {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

.disclaimer-footer {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 40px;
    color: #495057;
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
}

.disclaimer-footer p {
    margin: 10px 0;
}

.disclaimer-footer strong {
    color: #333;
    font-size: 16px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.2em;
}

#logoutBtn {
    position: absolute;
    top: 0;
    right: 0;
}

nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

nav a {
    text-decoration: none;
    color: #667eea;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
}

nav a:hover {
    background: #667eea;
    color: white;
}

/* Top Results Preview */
.top-results-preview {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.top-results-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.preview-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.9em;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-parties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 1;
}

.party-preview-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    border-radius: 20px;
    padding: 1px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    position: relative;
    overflow: hidden;
}

.party-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.party-preview-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.25);
}

.party-preview-card:hover::before {
    transform: scaleX(1);
}

.party-preview-card.rank-1 {
    background: linear-gradient(145deg, #fffef0 0%, #fff9e6 100%);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.2);
}

.party-preview-card.rank-1::before {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
}

.party-preview-card.rank-2 {
    background: linear-gradient(145deg, #f8f9fa 0%, #eceff1 100%);
    box-shadow: 0 10px 40px rgba(192, 192, 192, 0.2);
}

.party-preview-card.rank-2::before {
    background: linear-gradient(90deg, #c0c0c0 0%, #d5d5d5 100%);
}

.party-preview-card.rank-3 {
    background: linear-gradient(145deg, #fff8f0 0%, #ffe8d6 100%);
    box-shadow: 0 10px 40px rgba(205, 127, 50, 0.2);
}

.party-preview-card.rank-3::before {
    background: linear-gradient(90deg, #cd7f32 0%, #e8a05d 100%);
}

.rank-badge-preview {
    font-size: 2em;
    font-weight: 800;
    text-align: center;
    margin-bottom: 15px;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.party-name-preview {
    font-size: 1.4em;
    font-weight: 700;
    text-align: center;
    color: #2d3748;
    margin-bottom: 20px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.party-stats-preview {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
}

.stat-item {
    text-align: center;
    flex: 1;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-label {
    font-size: 0.8em;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 800;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-message, .no-results-message, .error-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 1.1em;
}

.error-message {
    color: #dc3545;
}

.step {
    margin-bottom: 25px;
}

.step h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.form-select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.form-select:focus {
    border-color: #667eea;
}

.candidates-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.candidate-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.candidate-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.candidate-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ddd;
}

.candidate-info {
    flex: 1;
}

.candidate-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.candidate-party {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.candidate-marka {
    color: #888;
    font-style: italic;
}

.vote-btn {
    padding: 12px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.vote-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.vote-btn:active {
    transform: scale(0.95);
}

.message-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    display: none;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-box.success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    display: block;
}

.message-box.error {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    display: block;
}

/* Results Page */
.results-section {
    margin-top: 30px;
}

.total-votes {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
}

.total-votes h2 {
    font-size: 2em;
}

.party-results h2 {
    color: #333;
    margin-bottom: 20px;
}

.party-result-item {
    background: #f8f9fa;
    border-left: 5px solid #667eea;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.party-result-item.top {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.party-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

.party-votes {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

.rank-badge {
    background: #ffc107;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin-right: 10px;
}

/* Admin Login */
.login-form {
    max-width: 400px;
    margin: 50px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.form-group input:focus {
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c82333;
}

/* Admin Dashboard */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.admin-form input,
.admin-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.admin-form button {
    width: 100%;
}

.items-list {
    margin-top: 20px;
}

.item-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.item-details {
    color: #666;
    font-size: 14px;
}

.candidate-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.candidate-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .candidate-card {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        flex-direction: column;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
}