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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f9f9f9;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    background: #003087; /* NJ flag blue */
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    font-family: 'Roboto', sans-serif;
    font-size: 1.8rem;
    color: #f5c518; /* NJ flag buff */
    text-decoration: none;
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

header nav ul li {
    margin-left: 5px;
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

header nav ul li a:hover {
    color: #f5c518;
}

/* Intro Section */
#intro {
    background: linear-gradient(135deg, #003087 0%, #0040b0 100%);
    color: white;
    text-align: center;
    padding: 3rem 0;
}

#intro h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

#intro p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Elections Section */
#elections {
    padding: 3rem 0;
}

#elections h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    color: #003087;
    text-align: center;
    margin-bottom: 2rem;
}

.election-group {
    margin-bottom: 3rem;
}

.election-group h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    border-left: 4px solid #f5c518;
    padding-left: 1rem;
}

.election-group p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.election-group ul {
    list-style: disc;
    margin-left: 2rem;
    color: #666;
}

.election-group ul li {
    margin-bottom: 0.5rem;
}

.candidate-group {
    margin-bottom: 2rem;
}

.candidate-group h4 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    color: #003087;
    margin-bottom: 1rem;
}

.candidate-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.candidate {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.candidate:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.candidate-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    border: 3px solid #f5c518;
}

.candidate h5 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    color: #003087;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    min-height: 24px;
}

.social-links a {
    color: #666;
    font-size: 1.2rem;
    transition: color 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.social-links a:hover {
    color: #f5c518;
}

.social-links i {
    font-size: 1.2rem;
}

.social-links .fallback-text {
    display: none;
    font-size: 0.9rem;
    color: #666;
    margin-left: 0.3rem;
}

.candidate .details {
    display: none;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.8;
    text-align: left;
    padding-top: 1rem;
}

.candidate .details p {
    margin-bottom: 1.2rem;
}

.candidate .details strong {
    color: #003087;
    font-weight: 700;
}

.candidate .positions {
    margin-bottom: 1.2rem;
}

.candidate .positions p {
    margin-bottom: 0.5rem;
}

.candidate .positions ul {
    list-style: disc;
    margin-left: 1.5rem;
}

.candidate .positions li {
    margin-bottom: 0.6rem;
    color: #555;
}

.candidate.active .details {
    display: block;
}

/* Predictions Section */
#predictions {
    padding: 3rem 0;
    background: #f4f4f4;
}

#predictions h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    color: #003087;
    text-align: center;
    margin-bottom: 2rem;
}

#predictions h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    border-left: 4px solid #f5c518;
    padding-left: 1rem;
}

#predictions p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.chart-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.chart-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Timeline Section */
#timeline {
    padding: 3rem 0;
    background: #f4f4f4;
}

#timeline h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    color: #003087;
    text-align: center;
    margin-bottom: 2rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background: #003087;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 45%;
}

.timeline-item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    text-align: right;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #f5c518;
    border-radius: 50%;
    top: 1.5rem;
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -8px;
}

.timeline-item:nth-child(even)::before {
    left: -8px;
}

.timeline-item .date {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    color: #003087;
    font-weight: 600;
}

.timeline-item p {
    font-size: 0.9rem;
    color: #666;
}

/* Past Results Section */
#past-results {
    padding: 3rem 0;
}

#past-results h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    color: #003087;
    text-align: center;
    margin-bottom: 2rem;
}

/* About Section */
#about {
    padding: 3rem 0;
    text-align: center;
}

#about h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2rem;
    color: #003087;
    margin-bottom: 1rem;
}

#about p {
    font-size: 1.1rem;
    color: #666;
    
    margin: 0 auto;
}

/* Footer */
footer {
    background: #003087;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
}

footer p {
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    header nav ul {
        flex-direction: column;
        margin-top: 1rem;
    }

    header nav ul li {
        margin: 0.5rem 0;
    }

    .candidate-list {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        margin-left: 40px !important;
        margin-right: 0 !important;
        text-align: left !important;
    }

    .timeline-item::before {
        left: -28px !important;
        right: auto !important;
    }

    .chart-container {
        max-width: 100%;
    }
}