body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }


.note-box {
    position: absolute;      /* Keeps the position relative to the viewport */
    bottom: 10px;            /* Sets distance from the bottom of the viewport */
    left: 50%;               /* Centers the box horizontally based on its left edge */
    transform: translateX(-50%); /* Moves the box back to the left by half its width */
    display: flex;           /* Continues to use flexbox for internal alignment */
    flex-direction: column;  /* Stacks children vertically */
    align-items: center;     /* Aligns children to the center of the flex container */
    /* padding: 16px;           /* Maintains padding around the content */
    /*background-color: #fff;  /* Keeps the white background */
    /*border: 1px solid #ccc;  /* Maintains the border */
    /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Keeps the shadow for depth */
    /*border-radius: 4px;      /* Keeps the corners rounded */
    font-family: "GT-America", sans-serif; /* Ensures font consistency */
    color: #444;             /* Keeps the text color */
    z-index: 9999;           /* Ensures it stays on top of other content */
    width: 30%;              /* You may adjust based on your design needs */
    max-width: 600px;        /* Adjust maximum width as needed */
    min-width: 165px;        /* Maintains minimum width */
}


#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
}

.note-box a {
    color: #7000FF;
    text-decoration: underline;
}

.button {
    font-family: "GT-America", sans-serif; /* Matching the paragraph font */
    font-size: 1rem; /* Slightly smaller than paragraph text for distinction */
    font-weight: 500; /* Making it bolder than the paragraph for emphasis */
    color: white; /* High contrast text color for readability */
    background-color: gray; /* A vibrant color to make the button stand out */
    border: none; /* No border for a cleaner look */
    border-radius: 1px; /* Slightly rounded corners for a modern appearance */
    padding: 0.4rem .8rem; /* Adequate padding for a comfortable click area */
    text-align: center; /* Centering text inside the button */
    cursor: pointer; /* Cursor changes to pointer to indicate interactivity */
    transition: background-color 0.3s ease; /* Smooth transition for hover effect */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for 3D effect */
    margin-bottom: 1rem; /* Same bottom margin as paragraphs for consistent spacing */
    display: inline-block; /* Ensures the button doesn't take full width */
    border-radius: 3px;
    /* fade it out a bit by default for a disabled look */
    opacity: 0.5;
}

.button:hover {
    background-color: lightgray; /* Darker shade on hover for visual feedback */
}

.button:focus {
    outline: none; /* Removes outline on focus to maintain style */
    /* box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5); /* Blue glow for accessibility */
}

/* Active Button State */
.button.active {
    background-color: rgb(0,0,0); /* Primary color for active state */
    opacity: 1; /* Full opacity for active button */
    color: white; /* Maintain high contrast text */
    box-shadow: 0 4px 6px rgba(112, 0, 255, 0.2); /* Enhanced shadow for depth */
    /* Optional: Add a border or different styling if needed */
}

/* Inactive Button State */
.button:not(.active) {
    background-color: gray; /* Inactive background */
    opacity: 0.5; /* Reduced opacity for inactive buttons */
    color: white; /* Maintain text color */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Hover Effect for Inactive Buttons */
.button:not(.active):hover {
    background-color: lightgray; /* Lighten background on hover */
    opacity: 0.7; /* Slightly increase opacity on hover */
}


#geocoder-container {
    width: 100%;
    font-family: "GT-America", sans-serif;
}

#buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* This spreads out the buttons evenly */
    gap: 2px; /* Adds space between buttons */
    padding: 2px 0; /* Optional: Adds some padding inside the buttons container */
    transition: background-color 0.3s ease, outline 0.3s ease; /* Smooth transitions */
    border-radius: 5%;
}


#resetMap {
    position: absolute;
    bottom: 6.5em;
    left: 50%;
    transform: translateX(-50%);
    /* padding: 10px 20px; */
    z-index: 10; /* Ensure it's above the map layers */
    cursor: pointer;
    display: none; /* Start hidden */
}


.button.disabled, .button:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

.small-note-box {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 9999;
}

.info-icon {
    position: relative;
    display: inline-block;
    color: #2c3e50; /* Dark blue-grey for visibility */
    cursor: help;
}

.info-icon svg {
    fill: #2c3e50; /* SVG fill color, can adjust as needed */
}

.tooltip-text {
    visibility: hidden;
    width: 220px; /* Adjust width based on your content */
    background-color: #fff;
    font-family: "GT-America", sans-serif;
    font-size: 0.8em;
    color: #333;
    text-align: left;
    border-radius: 10px; /* Reduced curvature */
    position: absolute;
    z-index: 1;
    top: 125%; /* Position below the icon */
    left: 0; /* Align to the left of the icon */
    transform: translateX(0); /* No centering needed if aligned to the left */
    opacity: 0;
    transition: opacity 0.6s;
    padding: 1em; /* Adjust padding */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Optional shadow */
}

.info-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}




#zoom-text-box {
    position: absolute;    /* Keeps the element positioned relative to the viewport */
    top: 10px;             /* Positions the box 10px from the top of the screen */
    left: 50%;             /* Positions the left edge of the box at the center of the screen */
    transform: translateX(-50%); /* Moves the box to the left by half its width, centering it */
    background-color: #fff; /* Sets the background color to white */
    padding: 10px;         /* Adds some padding inside the box for content spacing */
    border-radius: 8px;    /* Applies rounded corners */
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Adds a subtle shadow for depth */
    z-index: 100;          /* Ensures the box is above other content but below overlays */
    width: auto;           /* Adjust width automatically based on content */
    max-width: 400px;      /* Ensures the box does not exceed 400px width */
    border: 1px solid #ccc; /* Optional: adds a light border */
    font-family: "GT-America", sans-serif; /* Ensures font consistency */
    display: none;
}  
  .info-icon img {
    display: inline-block; /* Ensures the image is aligned correctly */
    vertical-align: middle; /* Aligns the icon vertically with the text */
  }

  .marker {
    background-color: darkgray;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: block;
}

.legend {
    position: absolute;
    bottom: 1em;
    right: 1em;
    background-color: white;
    padding: 1em;
    border-radius: .5em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* Ensures the legend appears above other map layers */
    font-family: 'GT-America', sans-serif;
}

.legend-item {
    position: relative;
    margin-bottom: 5px;
}

.tick-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    font-size: 0.75em; /* Increased font size for better visibility */
    font-weight: bold; /* Make labels stand out more */
    color: rgba(25, 25, 25, 0.75); /* Changed color for higher contrast */
    margin-bottom: 5px; /* Adds space between the ticks and the gradient */
}

.tick {
    position: absolute;
    transform: translateX(-50%);
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6em; /* Increased font size for better visibility */
    font-weight: bold; /* Bold text for Democrats and Trump */
    color: rgba(25, 25, 25, 0.75); /* Changed color for better contrast */
    margin-top: 5px;
}

.label-left {
    margin: 0;
    text-align: left;
}

.label-right {
    margin: 0;
    text-align: right;
}





/* Media query for devices with a max width of 600px */
@media (max-width: 600px) {
    .legend {
        bottom: 10px; /* Adjust this value based on the height of your search bar */
        right: 10px; /* Align to the right under the search bar on mobile */
        padding: 5px;
        font-size: 12px; /* Smaller font size for mobile devices */
        width: auto; /* Adjust width automatically based on content */
    }
    .legend-circle {
        width: 20px; /* Smaller circles for mobile */
        height: 20px;
    }
    .legend-item {
        margin-bottom: 3px; /* Less space between items for mobile */
    }

    .mapboxgl-ctrl-geocoder {
        width: 90%; /* Adjust the width */
        max-width: 150px; /* Optional maximum width */
        max-height: 50px;
        font-size: 14px; /* Adjust the overall font size */
    }

    .mapboxgl-ctrl-geocoder input {
        font-size: 14px; /* Adjust font size of input */
        padding: 6px 10px 6px 30px; /* Add space for the search icon */
    }

    .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
        position: absolute;
        left: 10px; /* Ensure the icon stays in the correct position */
        top: 50%;
        transform: translateY(-50%); /* Center the icon vertically */
        pointer-events: none; /* Ensure it doesn’t interfere with input */
    }

    @media (max-width: 600px) {
        .legend {
            bottom: 8px;
            right: 8px;
            padding: 6px;
            font-size: 10px; /* Smaller font size for the legend */
            width: auto;
        }
    
        .legend-item {
            margin-bottom: 2px; /* Less spacing between legend items */
        }
    
        .legend-circle {
            width: 12px; /* Smaller legend circles */
            height: 12px;
        }
    
        .tick-container {
            font-size: 1em; /* Smaller tick labels */
            margin-bottom: .5em;
        }
    
        .legend-labels {
            font-size: 1em; /* Even smaller font size for labels */
        }
    
        .legend-toggle-buttons {
            margin-top: 4px;
        }
    
        .button {
            font-size: 0.7rem; /* Smaller font size for buttons */
            padding: 0.2rem 0.4rem; /* Further reduce padding for buttons */
            border-radius: 1px; /* Keep corners minimal */
        }
    
        .button.active {
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* Subtle shadow for smaller buttons */
        }
    }
    