body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.container {
    display: flex;
    height: 100vh;
}

#locations-list {
    width: 400px;
    height: 100vh;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2000;
}

.search-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 0;
}

#search-input, #province-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-sizing: border-box;
}

#province-select {
    margin-bottom: 10px;
}

.filter-button {
    padding: 8px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.filter-button-group {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.filter-button.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.locations-container {
    flex-grow: 1;
    padding: 15px;
}

.location-item {
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    position: relative;
    padding-bottom: 35px;  /* Slightly increased to accommodate new content */
}

.location-item:hover {
    background: #f1f3f5;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.location-name {
    font-weight: 600;
    word-wrap: break-word;
    font-size: 1em;
    flex: 1;
}

.no-coords-tag {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    white-space: nowrap;
    flex-shrink: 0;
}

.location-address {
    font-size: 0.85em;
    color: #555;
    line-height: 1.3;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 3px;
    padding: 4px 8px;
    margin-top: 2px;
    box-sizing: border-box;
    width: 100%;
}

.location-address i {
    color: #666;
    margin-right: 5px;
}

.location-contact {
    font-size: 0.9em;
    color: #0d6efd;
    margin-bottom: 5px;
}

#map {
    flex-grow: 1;
    height: 100vh;
}

.province-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 12px;
    font-size: 0.8em;
    font-weight: 500;
    border-radius: 0 0 4px 4px;
    color: #444;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 2002;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    color: #333;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.active {
    background-color: #e9ecef;
    color: #0d6efd;
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 0.8em;
    margin-left: 5px;
}

.locations-count {
    font-size: 0.85em;
    color: #666;
    text-align: right;
    margin-top: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 10px;
    display: inline-block;
    margin-left: auto;
    min-width: 4em;
    text-align: center;
}

.toggle-list-button {
    display: none;  /* Hidden by default */
    position: fixed;
    top: 80px;
    left: 10px;
    z-index: 999;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 0.9em;
    align-items: center;
    gap: 6px;
    transition: background-color 0.3s ease;
}

.toggle-list-button i {
    font-size: 1em;
}

.toggle-list-button.active {
    background-color: #e9ecef;
}

.location-details {
    font-size: 0.85em;
    color: #555;
    margin: 8px 0;
}

.location-details div {
    margin: 4px 0;
}

.location-details i {
    width: 16px;
    color: #666;
    margin-right: 8px;
}

.location-details a {
    color: #0d6efd;
    text-decoration: none;
    word-break: break-all;
}

.location-details a:hover {
    text-decoration: underline;
}

.search-header {
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
}

.close-button {
    display: none;  /* Hidden by default */
    width: 32px;
    height: 32px;
    padding: 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    font-size: 1.2em;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    color: #333;
    background: #e9ecef;
}

@media (max-width: 768px) {
    .container {
        position: relative;
    }

    #locations-list {
        position: absolute;
        left: -100%;
        width: 100%;
        max-width: 100%;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    #locations-list.active {
        left: 0;
    }

    .toggle-list-button {
        display: flex;  /* Only show on mobile */
    }

    .toggle-list-button.active {
        background-color: #e9ecef;
    }

    .search-container {
        padding: 8px;
        gap: 8px;
    }

    #search-input, #province-select {
        padding: 6px;
        font-size: 0.9em;
    }

    #province-select {
        margin-bottom: 8px;
    }

    .filter-button-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-button {
        font-size: 0.8em;
        padding: 6px 8px;
        flex: 1;
        min-width: calc(50% - 6px);  /* Two buttons per row with gap */
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-toggle {
        width: 100%;
        text-align: center;
    }

    .dropdown-content {
        width: 100%;
        min-width: unset;
        position: relative;
        box-shadow: none;
        border: 1px solid #dee2e6;
        margin-top: 4px;
    }

    .locations-count {
        width: 100%;
        margin: 4px 0;
        text-align: center;
        background: transparent;
        border: none;
        padding: 2px 0;
        color: #666;
    }

    .location-item {
        padding: 8px;
        margin-bottom: 8px;
        font-size: 0.95em;
    }

    .location-header {
        margin-bottom: 4px;
    }

    .location-name {
        font-size: 1em;
        line-height: 1.3;
    }

    .location-contact {
        margin-bottom: 4px;
        font-size: 0.85em;
    }

    .location-address {
        padding: 4px 6px;
        font-size: 0.8em;
        margin-top: 4px;
    }

    .location-details {
        margin: 6px 0;
        font-size: 0.8em;
    }

    .location-details div {
        margin: 3px 0;
        display: flex;
        align-items: center;
    }

    .location-details i {
        width: 12px;
        margin-right: 6px;
        font-size: 0.9em;
    }

    .location-details a {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .province-tag {
        padding: 3px 8px;
        font-size: 0.75em;
    }

    .toggle-list-button {
        padding: 8px;
        font-size: 1.1em;
    }

    .search-header {
        width: 100%;
        margin-bottom: 8px;
    }

    .close-button {
        display: flex;  /* Show only on mobile and use flex for centering */
    }

    #search-input {
        width: auto;
        flex: 1;
    }

    #status-filter {
        padding: 6px;
        font-size: 0.9em;
        margin-bottom: 8px;
    }
}

/* Additional optimizations for very small screens */
@media (max-width: 480px) {
    .filter-button {
        min-width: 100%;  /* Full width buttons on very small screens */
    }

    .location-details a {
        font-size: 0.95em;
    }

    .no-coords-tag {
        font-size: 0.75em;
        padding: 1px 4px;
    }

    .locations-container {
        padding: 8px;
    }

    /* Improve touch targets */
    .location-details div {
        padding: 2px 0;
    }

    .location-item {
        padding-bottom: 30px;
    }
}

/* Add these styles to control Leaflet layers */
.leaflet-container {
    z-index: 1 !important;  /* Base layer */
}

.leaflet-control-container {
    z-index: 1 !important;  /* Controls container */
}

.status-select {
    padding: 4px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8em;
    background: white;
    cursor: pointer;
}

.custom-marker {
    position: relative;
}

.custom-marker div {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 30px;
    background: currentColor;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: translate(-50%, -50%) rotate(-45deg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

/* Add these styles */
#status-filter {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.location-item.highlighted {
    background-color: #e9ecef;
    border-color: #0d6efd;
    box-shadow: 0 0 0 1px #0d6efd;
} 