/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    line-height: 1.6;
}

header {
    background: url('https://elm.umaryland.edu/announcements/2024/elections_2024_2_0.png') no-repeat center center;
    background-size: contain;
    height: 200px;
    background-color: #002659;
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    background-color: rgba(0, 0, 0, 0.5);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h1,
h2 {
    color: #333;
    margin-bottom: 1rem;
}

button {
    background: #f4f4f4;
    color: #000000;
    border: none;
    padding: 0.25rem 0.5rem;
    margin: 0.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

section {
    background: #fff;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow-x: auto;
}

.candidate-boxes {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.candidate-box {
    background: #fff;
    padding: 2rem;
    flex: 1;
    margin: 0 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

.fw-info-box {
    background: #fff;
    padding: 0.3rem;
    flex: 1;
    margin: 0 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

.cand1 {
    background: #d8e0ff;
}

.cand2 {
    background: #ffdbdb;
}

.candidate-box h3 {
    margin-bottom: 1rem;
    color: #333;
}

.large-number {
    font-size: 4rem;
    margin: 0;
    font-weight: bold;
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table,
th,
td {
    border: 1px solid #ddd;
}

th,
td {
    padding: 1rem;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

.stats-boxes {
    display: flex;
    justify-content: space-between;
}

.stats-box {
    background: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
    flex: 1;
    margin: 0 1rem;
}

.stats-box h3 {
    margin-bottom: 1rem;
    color: #333;
}

.stats-box .large-number {
    font-size: 1rem;
    margin: 0;
    font-weight: bold;
    color: #333;
}

footer {
    background: linear-gradient(90deg, #333, #555);
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
    width: 100%;
    bottom: 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.key {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.key-item {
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

/* Color Box Styling */
.color-box {
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-right: 0.5rem;
    border: 1px solid #ccc;
}

/* Loading Overlay Styling */
#loading-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 1);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Last Updated Text Styling */
.last-updated-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 1rem;
    padding-left: 1.5rem;
}

/* Responsive Table Styling */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table,
th,
td {
    border: 1px solid #ddd;
}

th,
td {
    padding: 1rem;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .candidate-boxes {
        flex-direction: column;
    }

    .candidate-box {
        margin: 1rem 0;
    }

    .stats-boxes {
        flex-direction: column;
    }

    .stats-box {
        margin: 1rem 0;
    }

    table,
    th,
    td {
        padding: 0.5rem;
    }

    th,
    td {
        font-size: 0.8rem;
    }

    .last-updated-text {
        font-size: 0.7rem;
        padding-left: 1rem;
    }

    section {
        background: none;
        padding: 1rem 0rem;
        margin-bottom: 2rem;
        box-shadow: none;
        overflow-x: auto;
    }

    h2 {
        margin-bottom: 2rem;
    }
}