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

/* Popup Styling */
.popup-container {
    position: fixed;
    bottom: 50%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 280px;
    text-align: center;
    font-family: 'GT-America', sans-serif;
    animation: fadeIn 0.5s ease-out;
}

.popup-content h3 {
    font-size: 16px;
    color: #000;
    margin: 0;
}

.popup-content p {
    font-size: 14px;
    color: #555;
    margin: 8px 0;
}

.popup-close {
    background: #003E6D;
    color: white;
    font-size: 14px;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.popup-close:hover {
    background: #0056b3;
}

/* Animation for smoother appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}




#first-legend-item {
    margin-top: -1.1em;
}

#geocoder-container .mapboxgl-ctrl-geocoder {
    width: 100% !important;
    max-width: none !important;
}

#geocoder-container .mapboxgl-ctrl-geocoder input {
    width: 100% !important;
}

.gmapboxgl-ctrl-geocoder mapboxgl-ctrl{
    width: 100% !important;
}

.mapboxgl-ctrl-geocoder {
    position: relative;
}

.mapboxgl-ctrl-geocoder .suggestions {
    bottom: 100% !important; /* Move dropdown above the input */
    top: auto !important;  /* Prevent default downward positioning */
    max-height: 200px; /* Adjust height as needed */
    overflow-y: auto; /* Enable scrolling */
    border-radius: 8px 8px 0 0; /* Rounded corners on top */
}


.note-box {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column-reverse; /* Ensures new items appear at the top */
    align-items: flex-start; /* Align tooltips to the left */
    gap: 4px; /* Adds spacing between tooltips */
    background-color: transparent;
    z-index: 1000;
    max-width: 30%;
}


.note-box:has(.note-box-content) {
    background: transparent; /* Remove background */
    box-shadow: none; /* Remove shadow if needed */
}

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



.note-box-content {
    font-family: 'GT-America', sans-serif;
    font-size: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95); 
    border-radius: 0.25em; /* Ensure rounding */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: #333;
    /* max-width: 250px; */
    position: relative;
    box-sizing: border-box;
    overflow: hidden; /* Ensure content follows border-radius */
    display: flex;
    flex-direction: column;
}


/* Remove container background and unnecessary padding */
.school-select {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

/* Style the label in a minimal manner */
.school-select label {
    display: block;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 4px;
}

/* Modern, sleek styling for the select element */
.school-select select {
    width: 250px;
    padding: 10px 14px;
    font-size: 1rem;
    color: #333;
    background: transparent; /* No background */
    border: none;            /* Remove all borders */
    border-bottom: 2px solid #ccc;  /* Add only a bottom border */
    outline: none;
    transition: border-color 0.3s ease;
    
    /* Remove default styling for consistent look across browsers */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Add a custom dropdown arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* Change the border color on focus for visual feedback */
.school-select select:focus {
    border-bottom-color: #007BFF;
}

/* Optional: Change border color on hover */
.school-select select:hover {
    border-bottom-color: #999;
}


/* Styles for the external selected school labels */
.selected-school-box {
    position: absolute;
    top: 10px; /* Keep it aligned with the dropdown */
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Space between labels */
    pointer-events: none;
    max-width: calc(100% - 300px); /* Prevents overlapping the dropdown */
    min-width: auto;
}





#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: 1em; /* 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: #003E6D; /* 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: 1;
}

.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 */
}

/* Hover Effect for Inactive Buttons */
.button:not(.active):hover {
    background-color: #003E6D; /* Lighten background on hover */
    opacity: 0.5; /* 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%;
}


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

.small-note-box {
    position: absolute;
    top: 10px;
    right: 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-header {
    display: flex;
    align-items: baseline;
    font-family: 'GT-America', sans-serif;
    font-size: 0.95em;
    margin-bottom: 0.3rem; /* Adjust this to control spacing below the header */
}

.legend-header h2 {
    margin: 0;
    font-size: 1.15em;
}

.legend-header button {
    margin-left: auto;
    padding: 0.15rem 0.65rem;
    font-size: 0.85em;
    line-height: 1;
    position: relative;
    top: -0.15rem;
}




.legend {
    position: absolute;
    bottom: 0.5em;
    right: 0.5em;
    background-color: white;
    padding: 1em;
    padding-top: 0; /* Adjusted to match the top padding */ 
    border-radius: .15em;
    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-top: 0.5rem;
}

.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;
}

/* Adjust the popup container */
.my-popup .mapboxgl-popup-content {
    padding: 3px 6px; /* Keep it tight */
    background: rgba(255, 255, 255, 0.9); /* Match the popup tip */
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    font-family: "GT-America", sans-serif;
    font-size: 10px;
    color: #333;
    overflow: visible; /* Ensure arrow (tip) is not cut off */
}

/* Fix popup tip (arrow) visibility */
.my-popup .mapboxgl-popup-tip {
    background: rgba(255, 255, 255, 0.9) !important; /* Ensure it matches */
    border: none !important; /* Remove any unwanted borders */
    box-shadow: none !important; /* Prevent any shading from interfering */
}

/* Optional: reduce padding at the bottom so the tip isn't overlapped */
.my-popup .mapboxgl-popup-content {
    padding-bottom: 4px; /* Adjust as needed */
}

/* Optional: limit the popup width */
.my-popup {
    max-width: 150px;
}


/* */

/* General tooltip styling */
.tooltip-entry {
    background: white;
    color: #333;
    padding: 6px; /* Reduce padding */
    border-radius: 6px; /* Slightly smaller rounded corners */
    width: 100%;
    max-width: 100%; /* Constrain width */
    font-family: 'GT-America', sans-serif;
    font-size: 12px; /* Reduce font size */
    line-height: 1.2; /* Tighter line height */
    box-shadow: 2px 2px 4px rgba(0,0,0,0.15);
    margin-bottom: 6px; /* Reduce margin */
    position: relative;
}

/* Close button */
.tooltip-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

/* Header section */
.tooltip-header {
    display: flex;
    align-items: center;
    padding: 2px 6px; /* Reduce padding */
}

/* School letter circle */
.school-circle {
    width: 18px; /* Reduce size */
    height: 18px;
    font-size: 10px; /* Smaller font */
    margin-right: 6px;
}

/* Title */
.tooltip-title {
    font-size: 12px;
    font-weight: bold;
}

/* Route description */
.tooltip-description {
    margin: 2px 6px;
    font-size: 11px; /* Smaller text */
}

/* Close button */
.tooltip-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

/* Header section */
.tooltip-header {
    display: flex;
    align-items: center;
    padding: 4px 8px;
}

/* School letter circle */
.school-circle {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: #007AFF;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 8px;
}

/* Title */
.tooltip-title {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: #000000;
    flex-grow: 1;
}

/* Route description */
.tooltip-description {
    margin: 4px 8px;
    font-size: 12px;
    color: #555;
}

/* Route steps container */
.route-container {
    margin-top: 4px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    font-size: 11px;
}

/* Step container */
.step-container {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}


/* Step number */
.segment-circle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.15);
}

/* Bus route info container */
.route-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding: 6px 10px;
    background: rgba(200, 200, 200, 0.2); /* Light grey background restored */
    border-radius: 6px;
    font-weight: bold;
}

/* make line really tight */
.other-schools {
    margin: 5px 6px !important;
    font-size: 11px; /* Smaller text */
    line-height: 1em;
}

/* Ensure "On-time" and "Next bus" have their own spacing */
.route-info span {
    flex-grow: 1;
    text-align: center;
}

.legend-width-fixer {
    width: 10em;
}

/* Mobile styles */
@media (max-width: 500px) {

    /* General tooltip styling */
    .tooltip-entry {
        max-width: 100%;
        margin: 0 auto;
        padding: 6px;
    }

    /* School and segment circles */
    .school-circle,
    .segment-circle {
        font-size: 10px;
    }

    .school-circle {
        width: 18px;
        height: 18px;
        margin-right: 4px;
    }

    .segment-circle {
        width: 20px;
        height: 20px;
    }


    /* Ensure .route-container follows .note-box constraints */
    .route-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box; /* Ensures padding doesn't add to width */
        max-height: 20vh;
        overflow-y: auto;
        text-align: left;
        font-size: 11px;
        padding: 0.5em; /* Adds some breathing room inside */
    }
    

    .tooltip-entry {
        left: 0.1em !important;
        right: 0.5em !important;
        width: calc(100% - 1em) !important;
        max-width: calc(100% - 1em) !important;
    }

    /* Note box adjustments */
    .note-box {
        left: 0.5em !important;
        right: 0.5em !important;
        width: calc(100% - 1em) !important;
        max-width: calc(100% - 1em) !important;
        transform: none !important;
    }

    /* Legend styles */
    .legend {
        position: absolute;
        top: 0.5em;
        left: 0.5em;
        width: auto;
        max-width: 100px;
        max-height: 50px;
        padding: 6px;
        padding-top: 0;
        background-color: white;
        display: inline-block;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        border-radius: 3px;
        font-size: 10px;
    }

    .legend-width-fixer {
        width: 5em;
    }

    #first-legend-item {
        margin-top: -1.5em;
    }

    .legend-header {
        margin-bottom: -0.5rem;
        gap: 0.3rem;
    }

    .legend-header h2 {
        font-size: 1em;
        line-height: 1;
    }

    .legend-header button {
        padding: 0.1rem 0.4rem;
        font-size: 0.75em;
        position: relative;
        top: -0.15rem;
    }

    .legend-item {
        margin-bottom: 2px;
    }

    .legend-circle {
        width: 12px;
        height: 12px;
    }

    .tick-container, .legend-labels {
        font-size: 1em;
        margin-bottom: 0.5em;
    }


}
