/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Professional Color Palette - Election/News Theme */
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary-color: #dc2626;
    --accent-color: #f97316;

    /* Neutral Colors */
    --white: #ffffff;
    --light-bg: #f9fafb;
    --light-gray: #e5e7eb;
    --gray: #6b7280;
    --dark-gray: #374151;
    --text-dark: #111827;

    /* Status Colors */
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --active: #f97316;

    /* Typography - Medium.com inspired */
    --font-family-serif: 'Lora', 'Georgia', 'Times New Roman', serif;
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family: var(--font-family-sans);
    --font-size-base: 18px;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 4rem 0;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Use sans-serif for UI elements */
button,
input,
select,
textarea,
.nav-menu,
.btn,
.card-tag,
.table-info {
    font-family: var(--font-family-sans);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-sans);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.75rem;
    font-weight: 800;
}

h2 {
    font-size: 2.25rem;
    font-weight: 700;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.375rem;
}

h5 {
    font-size: 1.125rem;
}

p {
    font-family: var(--font-family-serif);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-padding);
}

.section-alt {
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center {
    text-align: center;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 1rem;
    font-family: var(--font-family-sans);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.35);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
    min-width: 200px;
    list-style: none;
    margin-top: 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-dark);
}

.dropdown-menu a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    background-color: var(--light-bg);
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--gray);
    margin-right: 0.5rem;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb a::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--gray);
}

.breadcrumb-active {
    color: var(--primary-color);
    font-weight: 500;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--primary-gradient);
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    background-color: var(--white);
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    border-radius: var(--radius-md);
}

.hero-search button {
    white-space: nowrap;
}

/* ============================================
   CARDS & GRIDS
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: block;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-icon,
.state-icon,
.party-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card h3 {
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.card p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-family-sans);
}

.card-badge.active {
    background-color: var(--active);
    color: var(--white);
}

.card-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-tag {
    padding: 0.375rem 0.875rem;
    background-color: var(--light-bg);
    color: var(--primary-color);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
    color: var(--gray);
    font-size: 0.9rem;
}

.card-footer .arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.card:hover .card-footer .arrow {
    transform: translateX(5px);
}

.card-count {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ============================================
   RECENT UPDATES
   ============================================ */
.recent-updates {
    max-width: 900px;
    margin: 0 auto;
}

.update-item {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.update-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(5px);
}

.update-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 70px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    color: var(--white);
}

.date-day {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.update-content h3 {
    margin-bottom: 0.5rem;
}

.update-content h3 a {
    color: var(--text-dark);
}

.update-content h3 a:hover {
    color: var(--primary-color);
}

.update-content p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.update-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

/* ============================================
   SEARCH & FILTER
   ============================================ */
.search-filter-container {
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    background-color: var(--white);
    transition: var(--transition);
}

.filter-select:focus {
    border-color: var(--primary-color);
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table-container {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    padding: 2rem;
    background: var(--primary-gradient);
    color: var(--white);
}

.table-header h1 {
    margin-bottom: 0.5rem;
}

.table-header p {
    opacity: 0.95;
    margin-bottom: 0;
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--light-bg);
    flex-wrap: wrap;
    gap: 1rem;
}

.table-info {
    color: var(--gray);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.table-wrapper {
    overflow-x: auto;
    padding: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--light-bg);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

th:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    opacity: 0.3;
    font-size: 0.85rem;
}

th.sorted-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary-color);
}

th.sorted-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary-color);
}

tbody tr {
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

tbody tr:hover {
    background-color: var(--light-bg);
}

td {
    padding: 1rem;
    color: var(--text-dark);
}

/* ============================================
   SOCIAL SHARE BUTTONS
   ============================================ */
.social-share {
    padding: 2rem;
    background-color: var(--light-bg);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    text-align: center;
}

.social-share h3 {
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    color: var(--white);
    font-weight: 500;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.share-btn.facebook {
    background-color: #1877f2;
}

.share-btn.twitter {
    background-color: #1da1f2;
}

.share-btn.whatsapp {
    background-color: #25d366;
}

.share-btn.linkedin {
    background-color: #0077b5;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--text-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.footer-column p {
    line-height: 1.8;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: var(--white);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-gradient);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a:hover {
    color: var(--white);
}

/* ============================================
   LISTICAL HOMEPAGE STYLES
   ============================================ */

/* Active Elections Container */
.active-elections-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
}

.election-card-horizontal {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    max-width: 800px;
    width: 100%;
    display: flex;
    align-items: center;
}

.election-card-horizontal:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.election-card-left {
    flex: 1;
    padding: 2rem 2rem 2rem 2rem;
    background: var(--primary-gradient);
    color: var(--white);
}

.election-card-right {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
}

.election-badge {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1rem;
}

.election-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.election-stats-horizontal {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.stat-item-horizontal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider-horizontal {
    width: 1px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
}

.election-link-horizontal {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary-gradient);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    font-size: 1.1rem;
}

.election-link-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.election-link-horizontal svg {
    transition: transform 0.3s ease;
}

.election-link-horizontal:hover svg {
    transform: translateX(4px);
}


/* Featured Lists Responsive Grid */
.featured-lists-two-column {
    margin-top: 2rem;
    margin-bottom: 8rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.featured-list-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
    text-align: center;
    min-height: 80px;
}

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

.featured-list-item .list-icon {
    display: none;
}

.featured-list-item .list-content {
    flex: 1;
}

.featured-list-item .list-text {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-list-item .list-text:hover {
    color: var(--primary-color);
}

.featured-list-item .list-meta {
    color: var(--gray);
    font-size: 0.85rem;
}

/* Browse Grid */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Browse States Text-Only Grid */
.browse-states-text-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.browse-state-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
    text-align: center;
    min-height: 80px;
}

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

.browse-state-item .state-icon {
    display: none;
}

.browse-state-item .state-content {
    flex: 1;
}

.browse-state-item .state-text {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browse-state-item .state-text:hover {
    color: var(--primary-color);
}

.browse-state-item .state-meta {
    color: var(--gray);
    font-size: 0.85rem;
}

/* Browse Parties Text-Only Grid */
.browse-parties-text-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 1rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.browse-party-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
    text-align: center;
    min-height: 80px;
}

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

.browse-party-item .party-icon {
    display: none;
}

.browse-party-item .party-content {
    flex: 1;
}

.browse-party-item .party-text {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browse-party-item .party-text:hover {
    color: var(--primary-color);
}

.browse-party-item .party-meta {
    color: var(--gray);
    font-size: 0.85rem;
}

.browse-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.browse-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.browse-card .browse-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.browse-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.browse-card .browse-stats {
    color: var(--gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.browse-card .browse-count {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Party-specific colors */
.browse-card[data-party="bjp"] .browse-icon {
    background: linear-gradient(135deg, #FF9933 0%, #FF6600 100%);
}

.browse-card[data-party="jdu"] .browse-icon {
    background: linear-gradient(135deg, #00A651 0%, #008040 100%);
}

.browse-card[data-party="ljp-rv"] .browse-icon {
    background: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
}

.browse-card[data-party="aap"] .browse-icon {
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
}

.browse-card[data-party="ham"] .browse-icon {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

/* Tablet optimizations (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 2rem;
    }

    .election-card-horizontal {
        max-width: 90%;
    }

    .featured-lists-two-column {
        max-width: 95%;
        gap: 2rem 2.5rem;
        margin-left: auto;
        margin-right: auto;
    }

    .browse-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
    }
    
    .browse-states-text-grid {
        max-width: 95%;
        gap: 2rem 2.5rem;
        margin-left: auto;
        margin-right: auto;
    }
    
    .browse-parties-text-grid {
        max-width: 95%;
        gap: 0.5rem 0.75rem;
        margin-left: auto;
        margin-right: auto;
        grid-template-columns: repeat(3, 1fr);
    }

    .election-title {
        font-size: 1.6rem;
    }

    .stat-number {
        font-size: 2.25rem;
    }
}

/* Mobile optimizations (up to 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Typography scaling for mobile */
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* Featured Lists Mobile */
    .featured-lists-two-column {
        gap: 1.5rem;
        max-width: 100%;
    }

    .featured-list-item {
        gap: 0.5rem;
        text-align: center;
        padding: 0.75rem 0;
    }

    .featured-list-item .list-text {
        font-size: 0.95rem;
    }

    .featured-list-item .list-meta {
        font-size: 0.8rem;
    }

    /* Browse Grid Mobile */
    .browse-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .browse-states-text-grid {
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .browse-state-item {
        gap: 0.5rem;
        text-align: center;
        padding: 0.75rem 0;
    }
    
    .browse-state-item .state-text {
        font-size: 0.95rem;
    }
    
    .browse-state-item .state-meta {
        font-size: 0.8rem;
    }
    
    .browse-parties-text-grid {
        gap: 0.5rem 0.75rem;
        max-width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .browse-party-item {
        gap: 0.5rem;
        text-align: center;
        padding: 0.75rem 0;
    }
    
    .browse-party-item .party-text {
        font-size: 0.95rem;
    }
    
    .browse-party-item .party-meta {
        font-size: 0.8rem;
    }

    .browse-card {
        padding: 1.25rem;
    }

    .browse-card h3 {
        font-size: 1.1rem;
    }

    .browse-card .browse-stats {
        font-size: 0.85rem;
    }

    /* Election Card Mobile */
    .election-card-horizontal {
        max-width: 100%;
        margin: 0;
        flex-direction: column;
    }

    .election-card-left {
        padding: 1.5rem;
        text-align: center;
    }

    .election-card-right {
        padding: 1.5rem;
    }

    .election-stats-horizontal {
        gap: 1rem;
        justify-content: center;
    }

    .stat-number {
        font-size: 2rem;
    }

    .election-title {
        font-size: 1.4rem;
    }

    .election-link-horizontal {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Active Elections Container Mobile */
    .active-elections-container {
        min-height: 150px;
    }
}

/* Small mobile optimizations (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .election-title {
        font-size: 1.25rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .featured-list-item .list-text {
        font-size: 0.9rem;
    }

    .browse-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .browse-state-item .state-text {
        font-size: 0.9rem;
    }
    
    .browse-party-item .party-text {
        font-size: 0.9rem;
    }
    
    .browse-parties-text-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Very small mobile (up to 400px) */
@media (max-width: 400px) {
    .browse-parties-text-grid {
        grid-template-columns: 1fr;
    }

    .browse-card {
        padding: 1rem;
    }

    .election-card-left,
    .election-card-right {
        padding: 1.25rem;
    }
}

/* Touch-friendly optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Touch devices */
    .election-link-horizontal,
    .browse-card,
    .featured-list-item .list-text {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .election-link-horizontal {
        padding: 1rem 2rem;
    }

    .browse-card {
        padding: 1.5rem;
    }

    .featured-list-item {
        padding: 1rem 0;
    }
}

/* Enhanced mobile hero section */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }

    .hero-content {
        text-align: center;
    }

    .hero-search {
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
    }

    .hero-search input {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    .hero-search button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 968px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        background-color: var(--light-bg);
        margin-top: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-search {
        flex-direction: column;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .update-item {
        flex-direction: column;
        gap: 1rem;
    }

    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    :root {
        --font-size-base: 16px;
        /* Increased from 14px for better readability */
        --section-padding: 2.5rem 0;
    }

    /* Improved heading hierarchy for mobile */
    h1 {
        font-size: 2rem;
        /* 32px */
        line-height: 1.2;
    }

    h2 {
        font-size: 1.5rem;
        /* 24px */
        line-height: 1.3;
    }

    h3 {
        font-size: 1.25rem;
        /* 20px */
        line-height: 1.4;
    }

    h4 {
        font-size: 1.125rem;
        /* 18px */
    }

    h5 {
        font-size: 1rem;
        /* 16px */
    }

    /* Section title optimization */
    .section-title {
        font-size: 1.625rem;
        /* 26px */
        margin-bottom: 1.5rem;
    }

    /* Hero section mobile optimization */
    .hero {
        padding: 2.5rem 0;
    }

    .hero-title {
        font-size: 1.875rem;
        /* 30px */
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        /* 16px */
        line-height: 1.6;
    }

    /* Card optimization */
    .card {
        padding: 1.25rem;
    }

    .card h2,
    .card h3 {
        font-size: 1.25rem;
        /* 20px */
        margin-bottom: 0.75rem;
    }

    .card p {
        font-size: 0.9375rem;
        /* 15px */
        line-height: 1.6;
    }

    /* Table mobile optimization */
    .table-wrapper {
        padding: 0.75rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
        /* 14px */
        line-height: 1.4;
    }

    /* Button text optimization */
    .btn-primary,
    .btn-secondary {
        font-size: 0.9375rem;
        /* 15px */
        padding: 0.75rem 1.25rem;
    }

    /* Footer optimization */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    /* CandidateList (column 1) - Row 1, full width */
    .footer-column:nth-child(1) {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    /* Quick Links (column 2) - Row 2, left side */
    .footer-column:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    /* States (column 3) - Row 3, full width */
    .footer-column:nth-child(3) {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    /* Parties (column 4) - Row 2, right side (same row as Quick Links) */
    .footer-column:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
    }

    .footer h4 {
        font-size: 1.125rem;
        /* 18px */
    }

    /* Input fields optimization */
    input,
    select,
    textarea {
        font-size: 1rem;
        /* 16px - prevents zoom on iOS */
    }

    /* Stat numbers optimization */
    .stat-number {
        font-size: 2rem;
        /* 32px */
    }

    .stat-label {
        font-size: 0.875rem;
        /* 14px */
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy load optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   GOOGLE TRANSLATE WIDGET STYLING
   ============================================ */

/* Container in navigation */
#google_translate_element {
    padding: 0;
    margin: 0;
}

/* Hide Google Translate branding */
.goog-logo-link {
    display: none !important;
}

.goog-te-gadget {
    color: transparent !important;
    font-size: 0 !important;
}

/* Style the select dropdown - Horizontal compact style */
.goog-te-gadget .goog-te-combo {
    margin: 0 !important;
    padding: 0.5rem 2.5rem 0.5rem 2rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23667eea'%3E%3Cpath d='M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.6rem center;
    background-size: 16px 16px;
    color: var(--text-dark);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 160px;
    height: 38px;
    line-height: 1;
}

.goog-te-gadget .goog-te-combo:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.goog-te-gadget .goog-te-combo:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* Hide "Powered by" text - more specific selector */
.goog-te-gadget span:first-child {
    display: none;
}

.goog-te-gadget>div {
    display: inline-block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .goog-te-gadget .goog-te-combo {
        font-size: 0.8rem;
        padding: 0.45rem 1.75rem 0.45rem 1.75rem;
        min-width: 140px;
        height: 36px;
        background-size: 14px 14px;
        background-position: 0.5rem center;
        line-height: 1;
    }

    /* Mobile Footer Layout */
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem;
    }

    /* CandidateList (column 1) - Row 1, full width */
    .footer-column:nth-child(1) {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
    }

    /* Quick Links (column 2) - Row 2, left side */
    .footer-column:nth-child(2) {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    /* States (column 3) - Row 3, full width */
    .footer-column:nth-child(3) {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
    }

    /* Parties (column 4) - Row 2, right side (same row as Quick Links) */
    .footer-column:nth-child(4) {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    /* Party Pages Mobile Responsiveness */

    /* Official Links Section - Better wrapping */
    .card div[style*="display: flex"][style*="flex-direction: column"]>div[style*="display: flex"][style*="align-items: center"] {
        flex-wrap: wrap !important;
        line-height: 1.6 !important;
    }

    /* Social Media and Website links - Better text handling */
    .card div[style*="display: flex"][style*="align-items: center"] span {
        line-height: 1.6 !important;
        word-break: break-word !important;
    }

    /* Candidate Statistics - Single column on mobile */
    .card div[style*="grid-template-columns"][style*="repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }

    /* Search box on party pages */
    .search-filter-container {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .search-box {
        flex-direction: column !important;
        width: 100% !important;
    }

    .search-box input {
        width: 100% !important;
    }

    .search-box button {
        width: 100% !important;
    }

    .filter-options {
        width: 100% !important;
    }

    .filter-select {
        width: 100% !important;
    }
}

/* Hide Google Translate banner at top */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

/* Hide Google Translate top banner frame completely */
body>.skiptranslate:first-child iframe {
    display: none !important;
    height: 0 !important;
}

body {
    top: 0 !important;
    position: relative !important;
}

/* Fix any margin/padding issues from Google Translate */
body.translated-ltr,
body.translated-rtl {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Style for when page is translated */
.translated-ltr {
    margin-top: 0 !important;
}

/* Allow dropdown menu to show - only hide specific iframes */
body>.skiptranslate:first-child {
    display: none;
}

.goog-te-spinner-pos {
    display: none !important;
}

/* Make sure dropdown options are visible */
.goog-te-menu-value {
    display: block !important;
}

.goog-te-menu-frame {
    visibility: visible !important;
    display: block !important;
}

/* Table page translator widget - inline with action buttons */
#google_translate_element_table {
    padding: 0;
    margin: 0;
}

#google_translate_element_table .goog-te-gadget .goog-te-combo {
    padding: 0.5rem 2.5rem 0.5rem 2rem;
    font-size: 0.875rem;
    min-width: 180px;
    height: 38px;
    font-weight: 600;
    line-height: 1;
}

/* Responsive adjustments for table translator */
@media (max-width: 768px) {
    #google_translate_element_table .goog-te-gadget .goog-te-combo {
        min-width: 140px;
        font-size: 0.8rem;
        padding: 0.45rem 1.75rem 0.45rem 1.75rem;
        height: 36px;
        background-size: 14px 14px;
        background-position: 0.5rem center;
        line-height: 1;
    }
}

/* ============================================
   FLOATING TRANSLATE WIDGET
   ============================================ */

.floating-translate-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.floating-translate-widget .goog-te-gadget {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    box-shadow: 0 5px 16px rgba(30, 64, 175, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.floating-translate-widget .goog-te-gadget::before {
    content: '';
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    line-height: 1;
}

.floating-translate-widget .goog-te-gadget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(30, 64, 175, 0.4);
}

.floating-translate-widget .goog-te-gadget .goog-te-combo {
    margin: 0 !important;
    padding: 0.3rem 1.4rem 0.3rem 0.5rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    font-family: var(--font-family);
    font-size: 0.56rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 90px;
    max-width: 115px;
    height: 21px;
    line-height: 1;
}

.floating-translate-widget .goog-te-gadget .goog-te-combo:hover {
    background: var(--white);
}

.floating-translate-widget .goog-te-gadget .goog-te-combo:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Mobile responsive for floating widget */
@media (max-width: 768px) {
    .floating-translate-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .floating-translate-widget .goog-te-gadget {
        padding: 0.32rem 0.64rem;
        gap: 0.4rem;
    }

    .floating-translate-widget .goog-te-gadget::before {
        font-size: 0.72rem;
    }

    .floating-translate-widget .goog-te-gadget .goog-te-combo {
        font-size: 0.52rem;
        padding: 0.25rem 1.1rem 0.25rem 0.4rem;
        min-width: 70px;
        max-width: 90px;
        height: 19px;
    }
}