/* style.css */

.apex-street-ownership-container {
    max-width: 800px; /* Increased max-width for the map */
    margin: 30px auto;
    padding: 25px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
}

.apex-street-ownership-container h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

.apex-street-ownership-container p {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* New Search Group Styles */
.aso-search-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.aso-search-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
    font-size: 1.1em;
}

.aso-search-group input[type="text"] {
    width: 80%; /* Match legend width */
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.aso-search-group input[type="text"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 8px rgba(0, 115, 170, 0.2);
    outline: none;
}


/* Map specific styles */
#aso-map {
    height: 500px; /* Define map height */
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 20px; /* Space between search/legend and map */
    margin-bottom: 20px; /* Space between map and elements below */
}

.aso-legend {
    margin-top: 20px; /* Space between map and legend */
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
    text-align: left;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.aso-legend h3 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    position: relative; /* For positioning the reset button */
}

.aso-legend-reset {
    font-size: 0.8em;
    color: #007bff;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.aso-legend-reset:hover {
    opacity: 1;
    text-decoration: underline;
}


.aso-legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* Spacing between legend items */
}

.aso-legend li {
    display: flex;
    align-items: center;
    font-size: 0.95em;
    color: #555;
    cursor: pointer; /* Indicate clickable */
    padding: 5px 10px;
    border: 1px solid transparent; /* For visual feedback on click */
    border-radius: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.5; /* Default: slightly greyed out when NOT active */
}

.aso-legend li.active {
    opacity: 1; /* Full opacity when active */
    background-color: #e6e6e6; /* Slightly darker background when active */
    border-color: #cccccc;
}

.aso-legend li:hover {
    background-color: #e6e6e6; /* Hover effect */
    opacity: 1; /* Bring to full opacity on hover, even if not active */
}


.aso-legend li span {
    display: inline-block;
    width: 20px;
    height: 10px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.1); /* Subtle border for visibility */
}

.aso-error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .apex-street-ownership-container {
        margin: 20px;
        padding: 20px;
    }
    #aso-map {
        height: 400px; /* Slightly smaller map on mobile */
    }
    .aso-legend ul {
        flex-direction: column; /* Stack legend items vertically on small screens */
        align-items: flex-start;
    }
    .aso-legend-reset {
        position: static; /* Position normally on smaller screens */
        transform: none;
        display: block;
        text-align: center;
        margin-top: 10px;
    }
    .aso-search-group input[type="text"] {
        width: 95%; /* Adjust for mobile */
    }
}

/* NEW: Custom Tooltip Styling */
.aso-road-tooltip {
    background-color: rgba(0, 0, 0, 0.7); /* Darker background */
    color: #fff; /* White text */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Light border */
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap; /* Prevent text wrapping */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Make tooltips non-interactive so clicks go through to roads */
}

.aso-road-tooltip .leaflet-tooltip-tip {
    border-top-color: rgba(0, 0, 0, 0.7) !important; /* Match background color */
}
