body {
    font-family: 'Inter', 'Arial', sans-serif; /* Prioritize Inter, fallback to Arial */
    background: linear-gradient(to bottom, #E3F2FD, #BBDEFB); /* Light blue gradient */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px; /* Slightly more rounded */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 1200px; /* Wider container */
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
}

h1 {
    color: #1976D2; /* Deep blue */
    margin-bottom: 16px;
    font-size: 32px;
    font-weight: 700;
}

h2 {
    color: #1a2533;
    font-size: 24px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    color: #1a2533;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

p {
    color: #5a6e87;
    margin-bottom: 16px;
    font-size: 16px;
}

.small-text {
    font-size: 14px;
    color: #757575;
}

#zip-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto 32px auto;
}

#zip-input {
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #BDC3C7;
    border-radius: 8px; /* Rounded input */
    text-align: center;
    transition: border-color 0.3s ease;
}

#zip-input:focus {
    border-color: #1976D2;
    outline: none;
}

button[type="submit"] {
    background-color: #2196F3; /* Blue pill button */
    color: white;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px; /* Pill shape */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button[type="submit"]:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
}

#results {
    margin-top: 32px;
    text-align: left;
}

.loading, .error {
    color: #F44336; /* Red for errors */
    font-style: italic;
    text-align: center;
    font-size: 18px;
    padding: 20px;
}

/* Report Summary Section */
#report-summary {
    margin-bottom: 40px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #E3F2FD; /* Very light blue */
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

.exceeds-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exceeds-count {
    background-color: #F44336; /* Red circle */
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.exceeds-text {
    color: #F44336; /* Red text */
    font-size: 20px;
    font-weight: bold;
}

.total-contaminants {
    font-size: 20px;
    font-weight: bold;
    color: #1a2533;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.summary-card h4 {
    margin: 0;
    font-size: 16px;
    color: #1a2533;
}

.summary-card p {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #1976D2;
}

.icon-blue {
    color: #1976D2;
    font-size: 28px;
}

/* Contaminant Cards Section */
#report-details h2 {
    text-align: center;
}

.contaminant-toggle-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.toggle-btn {
    background-color: #E0E0E0;
    color: #757575;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.toggle-btn.active {
    background-color: #2196F3; /* Blue background for active */
    color: white;
}

.toggle-btn:hover:not(.active) {
    background-color: #BBDEFB; /* Lighter blue for hover */
}

.select-other-system-btn {
    background-color: #2196F3; /* Deep blue */
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.select-other-system-btn:hover {
    background-color: #1976D2;
}

.contaminant-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 20px; /* Add some horizontal padding */
}

.contaminant-card {
    background-color: #FFFFFF;
    padding: 25px;
    padding-top: 30px; /* Added padding to make space for the badge */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.contaminant-card h3 {
    margin-top: 0;
    font-size: 20px;
    color: #1a2533;
}

.health-risk {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.multiplier-badge {
    background-color: #F44336; /* Reverted to original harsh red */
    color: white;
    border-radius: 50%;
    display: inline-flex; /* Use inline-flex for dynamic sizing */
    justify-content: center;
    align-items: center;
    padding: 5px 10px; /* Use padding for sizing */
    min-width: 40px; /* Minimum circular size */
    min-height: 40px; /* Minimum circular size */
    font-size: 18px; /* Adjusted font size */
    font-weight: bold;
    position: absolute;
    top: -25px; /* Adjusted position */
    right: -25px; /* Adjusted position */
    border: 3px solid white;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.contaminant-levels {
    margin-top: 20px;
    border-top: 1px solid #E0E0E0; /* Separator line */
    padding-top: 15px;
}

.contaminant-levels p {
    margin: 5px 0;
    font-size: 14px;
    color: #5a6e87;
}

.contaminant-levels p strong {
    color: #333;
}

.contaminant-levels span {
    font-weight: bold;
    color: #1976D2; /* Blue for values */
}

/* Other Water Systems Nearby Section */
#other-systems-container {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

#other-systems-container h3 {
    font-size: 20px;
    color: #1a2533;
    margin-bottom: 25px;
}

.other-system-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow-x: auto; /* Enable horizontal scrolling */
    gap: 15px;
    justify-content: flex-start; /* Align items to start */
    padding-bottom: 10px; /* Space for scrollbar */
}

.other-system-item {
    flex: 0 0 auto; /* Prevent items from growing/shrinking */
    background-color: #FFFFFF;
    padding: 15px 20px;
    border-radius: 25px; /* Rounded pill shape */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    border: 1px solid #E0E0E0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.other-system-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    border-color: #1976D2;
}

.other-system-item span {
    font-weight: 600;
    color: #333;
    white-space: nowrap; /* Prevent text wrapping */
}

.select-other-system-btn {
    background-color: #1976D2; /* Deep blue */
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.select-other-system-btn:hover {
    background-color: #115293;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
    }

    .summary-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .exceeds-text, .total-contaminants {
        font-size: 18px;
    }

    .summary-cards {
        grid-template-columns: 1fr; /* Stack on mobile */
    }

    .contaminant-cards-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
        padding: 0;
    }

    .other-system-list {
        justify-content: initial; /* Allow scroll from start */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    p {
        font-size: 14px;
    }

    button[type="submit"] {
        font-size: 14px;
        padding: 10px 20px;
    }

    .exceeds-count {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .exceeds-text, .total-contaminants {
        font-size: 16px;
    }

    .toggle-btn {
        font-size: 14px;
        padding: 8px 15px;
    }

    .contaminant-card {
        padding: 20px;
    }

    .multiplier-badge {
        width: 50px;
        height: 50px;
        font-size: 20px;
        top: -10px;
        right: -10px;
    }
}

.more-info-btn {
    display: inline-block;
    background-color: #2196F3; /* Blue color */
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 15px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.more-info-btn:hover {
    background-color: #1976D2;
}

body {
    font-family: 'Inter', 'Arial', sans-serif; /* Prioritize Inter, fallback to Arial */
    background: #FFFFFF; /* White background */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

