/* ============================================
   Kerala Election Poll — Light Theme
   Font: Noto Serif Malayalam
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif+Malayalam:wght@100..900&display=swap');

:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: rgba(0, 0, 0, 0.02);
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-1: #4f46e5;
    --accent-2: #7c3aed;
    --accent-3: #6366f1;
    --gradient-1: linear-gradient(135deg, #4f46e5, #7c3aed);
    --gradient-2: linear-gradient(135deg, #f59e0b, #ef4444);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Chart colors */
    --chart-1: #4f46e5;
    --chart-2: #7c3aed;
    --chart-3: #f59e0b;
    --chart-4: #10b981;
    --chart-5: #ef4444;
    --chart-6: #06b6d4;
    --chart-7: #f97316;
    --chart-8: #ec4899;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif Malayalam', 'Inter', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Background
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(79, 70, 229, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ============================================
   Header / Hero
   ============================================ */
.hero {
    text-align: center;
    padding: 40px 0 24px;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.85rem;
    color: var(--accent-1);
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* --- Hero Slider --- */
.hero-slider-wrap {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #000;
}

.hero-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    /* Widescreen ratio */
    display: flex;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide::after {
    /* Dark gradient overlay so text is readable */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.hero-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 24px;
    z-index: 2;
    text-align: center;
}

.hero-content-overlay h1 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-content-overlay .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}


.hero h1 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.hero .location-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-1);
    color: #fff;
    padding: 8px 22px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 14px;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
    font-family: 'Inter', sans-serif;
}

.hero .location-tag svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card:hover::before {
    opacity: 1;
}

.card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--gradient-1);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 14px;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.card h2 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.8;
    white-space: pre-line;
}

.question-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.7;
    padding: 10px 14px;
    background: #f8fafc;
    border-left: 3px solid var(--accent-1);
    border-radius: 0 8px 8px 0;
}

.optional-badge {
    display: inline-block;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.other-input-wrap {
    margin-top: 10px;
    padding-left: 34px;
}

.other-text-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Noto Serif Malayalam', 'Inter', serif;
    transition: var(--transition);
    outline: none;
}

.other-text-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.other-text-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Poll Options (Radio Buttons)
   ============================================ */
.poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-options.with-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.poll-option {
    position: relative;
}

.poll-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.poll-option label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.92rem;
}

.poll-option label:hover {
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.3);
}

.poll-option input[type="radio"]:checked+label {
    background: rgba(79, 70, 229, 0.06);
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Image option cards */
.poll-option.has-image label {
    flex-direction: column;
    text-align: center;
    padding: 16px 14px;
    gap: 10px;
}

.poll-option.has-image .option-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    transition: var(--transition);
}

.poll-option.has-image input[type="radio"]:checked+label .option-image {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.poll-option.has-image .option-text {
    font-size: 0.82rem;
    line-height: 1.5;
}

.radio-dot {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: var(--transition);
}

.poll-option input[type="radio"]:checked+label .radio-dot {
    border-color: var(--accent-1);
    background: var(--accent-1);
    box-shadow: inset 0 0 0 3px #fff;
}

/* ============================================
   Form Inputs
   ============================================ */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.form-section h3 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Noto Serif Malayalam', 'Inter', serif;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Noto Serif Malayalam', 'Inter', serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Alerts / Messages
   ============================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-info {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
}

/* ============================================
   Scoreboard
   ============================================ */
.scoreboard-header {
    text-align: center;
    padding: 36px 0 16px;
}

.scoreboard-header h1 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stats-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.stat-card .stat-value {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-1);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.chart-card h3 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
    line-height: 1.6;
}

.chart-container {
    position: relative;
    height: 280px;
    margin-bottom: 14px;
}

.result-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.result-bar-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.result-bar-label .name {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-bar-label .name img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.result-bar-label .count {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
}

.result-bar-track {
    height: 10px;
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.result-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

.refresh-indicator {
    text-align: center;
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.refresh-indicator .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Already Voted / Success
   ============================================ */
.voted-message {
    text-align: center;
    padding: 50px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.voted-message .check-icon {
    width: 72px;
    height: 72px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.8rem;
}

.voted-message h2 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.voted-message p {
    color: var(--text-secondary);
    margin-bottom: 18px;
}

/* ============================================
   District / Mandal Listing
   ============================================ */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 24px 0;
}

.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-card);
}

.listing-card:hover {
    border-color: var(--accent-1);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.listing-card .icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.listing-card h3 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 0.85rem;
    font-weight: 600;
}

.listing-card p {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Inline Scoreboard on Vote Page
   ============================================ */
.inline-scoreboard {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.inline-scoreboard h2 {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ============================================
   Indian Flag — Fixed Background
   ============================================ */
.flag-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.06;
}

.flag-bg img {
    width: 90%;
    max-width: 600px;
    height: auto;
}

body.has-flag-bg .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   Floating Vote FAB (Mobile)
   ============================================ */
.vote-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 500;
    background: #dc2626;
    color: #fff;
    width: auto;
    padding: 14px 22px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.45);
    animation: fab-pulse 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

.vote-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(220, 38, 38, 0.55);
}

@keyframes fab-pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(220, 38, 38, 0.7);
    }
}

@media (min-width: 769px) {
    .vote-fab {
        display: none;
    }
}

/* ============================================
   Party Result Cards (Q1 — Mandal Rule)
   ============================================ */
.party-result-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.party-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.party-result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.party-result-card.is-leader {
    border-color: var(--party-color);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.03));
}

.party-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.party-card-body {
    flex: 1;
    min-width: 0;
}

.party-card-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.party-card-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.party-card-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    min-width: 2px;
}

.party-card-score {
    text-align: right;
    flex-shrink: 0;
    min-width: 52px;
}

.party-card-score .pct {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.party-card-score .votes {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.leader-crown {
    position: absolute;
    top: -8px;
    left: -6px;
    font-size: 1.2rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* ============================================
   Homepage Scoreboard Sections
   ============================================ */
.scoreboard-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.section-title {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-subtitle {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.total-votes-label {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 16px;
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Candidate Cards (Q2 — Kerala Rule)
   ============================================ */
.candidate-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.candidate-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    text-align: center;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.candidate-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.candidate-photo {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #e0f2fe, #ddd6fe);
}

.candidate-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.candidate-photo.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.candidate-photo.no-photo span {
    font-size: 2.5rem;
    font-weight: 800;
    color: #94a3b8;
    font-family: 'Noto Serif Malayalam', serif;
}

.score-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc2626;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    border: 2px solid #fff;
    line-height: 1;
}

.candidate-info {
    padding: 10px 8px 4px;
}

.candidate-name {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.candidate-votes {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.party-label {
    background: #0f766e;
    color: #fff;
    padding: 8px;
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* ============================================
   Party Score Table (Q1 — Mandal Rule)
   ============================================ */
.party-score-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.party-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.party-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.party-name-col {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 60px;
}

.party-votes-col {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right;
}

.party-pct-col {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-bar-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.party-pct-col span {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 38px;
    text-align: right;
}

/* ============================================
   Site Header (Public Nav)
   ============================================ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
}

.site-logo {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-logo span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 6px;
}

.nav-links a {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links a:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--accent-1);
}

/* ============================================
   Site Footer (Public)
   ============================================ */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-content {
    text-align: center;
    padding: 28px 0;
}

.footer-brand {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.footer-links a {
    font-family: 'Noto Serif Malayalam', serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-1);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.footer-copy a {
    color: var(--accent-1);
    text-decoration: none;
}

.visitor-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding: 6px 16px;
    background: rgba(79, 70, 229, 0.06);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.visitor-count strong {
    color: var(--accent-1);
    font-weight: 700;
}

/* Old inline footer (backward compat) */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
    font-family: 'Inter', sans-serif;
}

.footer a {
    color: var(--accent-1);
    text-decoration: none;
}

/* ============================================
   Public Form Elements
   ============================================ */
.public-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Noto Serif Malayalam', 'Inter', serif;
    transition: var(--transition);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.public-select:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.public-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Noto Serif Malayalam', 'Inter', serif;
    transition: var(--transition);
    outline: none;
    resize: vertical;
}

.public-textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.badge-inactive {
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* ============================================
   404 Page
   ============================================ */
.page-404 {
    text-align: center;
    padding: 80px 20px;
}

.page-404 h1 {
    font-family: 'Inter', sans-serif;
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent-1);
}

.page-404 p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .scoreboard-header h1 {
        font-size: 1.5rem;
    }

    .stats-row {
        flex-direction: column;
    }

    .card,
    .form-section,
    .chart-card {
        padding: 20px;
    }

    .container {
        padding: 0 14px;
    }

    .chart-container {
        height: 200px;
    }

    .btn {
        padding: 12px 24px;
    }

    .poll-options.with-images {
        grid-template-columns: repeat(2, 1fr);
    }

    .candidate-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .scoreboard-section {
        padding: 18px 14px;
    }

    .section-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .poll-options.with-images {
        grid-template-columns: 1fr 1fr;
    }

    .candidate-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .candidate-name {
        font-size: 0.75rem;
    }

    .score-badge {
        width: 38px;
        height: 38px;
        font-size: 0.65rem;
    }

    .party-name-col {
        font-size: 0.82rem;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

.animate-in:nth-child(1) {
    animation-delay: 0.05s;
}

.animate-in:nth-child(2) {
    animation-delay: 0.1s;
}

.animate-in:nth-child(3) {
    animation-delay: 0.15s;
}

.animate-in:nth-child(4) {
    animation-delay: 0.2s;
}

.animate-in:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s ease-in forwards;
    z-index: 1000;
    pointer-events: none;
}