/* Election Page Styles */
:root {
    --primary-color: #2c3e50;
    /* Deep Blue/Grey */
    --secondary-color: #3498db;
    /* Bright Blue */
    --accent-color: #e74c3c;
    /* Red for accents */
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #ffffff;
    --bg-alt: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

[data-theme="dark"] {
    --text-dark: #f0f0f0;
    --text-light: #b0b0b0;
    --bg-light: #1a1a1a;
    --bg-alt: #2d2d2d;
    --border-color: #444;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    --primary-color: #34495e;
    --secondary-color: #5dade2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: var(--transition);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--gradient);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation */
nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 16px;
}

nav a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: white;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to top, var(--bg-light), transparent);
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 20px;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
}

/* News Ticker Section */
.news-ticker-section {
    background: var(--bg-alt);
    padding: 40px 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.news-ticker-container {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.news-ticker-container:hover {
    animation-play-state: paused;
}

.news-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin: 0 15px;
    width: 300px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}

.news-card h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 16px;
}

.news-card p {
    font-size: 14px;
    color: var(--text-light);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Section Styles */
section {
    padding: 60px 20px;
    border-bottom: 1px solid var(--border-color);
}

section:last-child {
    border-bottom: none;
}

h2 {
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--text-dark);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
    display: inline-block;
}

h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.section-description {
    margin-bottom: 30px;
    font-size: 18px;
    color: var(--text-light);
}

/* Constituency Grid & Tiles */
.constituency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.constituency-card {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.constituency-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.card-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
}

.card-header h4 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.constituency-card.active .toggle-icon {
    transform: rotate(180deg);
}

.card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: var(--bg-light);
}

.constituency-card.active .card-details {
    max-height: 800px;
    /* Increased height for more content */
    transition: max-height 0.5s ease-in;
}

.details-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--text-light);
}

.detail-value {
    font-weight: 500;
    color: var(--text-dark);
    text-align: right;
}

/* New Result Styles */
.election-year-header {
    font-size: 16px;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 20px 0 10px 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

.election-year-header:first-child {
    margin-top: 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

.result-row.winner {
    border-left: 3px solid #27ae60;
    /* Green for winner */
}

.result-row.runner-up {
    border-left: 3px solid var(--text-light);
}

.result-name {
    font-weight: 600;
    font-size: 15px;
}

.result-stats {
    font-size: 13px;
    color: var(--text-light);
    text-align: right;
}

.result-stats span {
    display: block;
}

/* Popular Sections */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.popular-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-alt);
    border-radius: 12px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.popular-card:hover {
    transform: translateY(-10px);
    background: var(--gradient);
    color: white;
}

.popular-card:hover h3,
.popular-card:hover p,
.popular-card:hover .icon {
    color: white;
}

.popular-card .icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--secondary-color);
    transition: var(--transition);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 0;
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--secondary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 999;
    font-size: 24px;
    border: none;
    box-shadow: var(--shadow);
}

.scroll-to-top.show {
    opacity: 1;
}

.scroll-to-top:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    nav {
        justify-content: center;
    }

    .hero h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 28px;
    }
}