/* Main Wrapper */
.wsl-map-wrapper,
.wsl-map-wrapper * {
    box-sizing: border-box;
}

.wsl-map-wrapper {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: none !important;
}

#wsl-map {
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
}

/* Floating UI */
.wsl-floating-ui {
    position: absolute;
    top: 20px;
    left: 50px;
    z-index: 100;
    width: 320px;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
}

.wsl-controls-card {
    pointer-events: auto;
    /* Enable clicks on controls */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100% - 40px);
}

.wsl-search-box input {
    width: 100%;
    padding: 10px 30px 10px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.wsl-search-box {
    position: relative;
}

.wsl-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    display: none;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 10;
}

.wsl-search-clear:hover {
    color: #475569;
}

.wsl-search-box input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wsl-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-top: 5px;
}

.wsl-filters-row select {
    flex: 1 1 140px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wsl-filters-row select#wsl-radius-filter {
    flex: 1 1 100%;
}

.wsl-filters-row select#wsl-radius-filter {
    grid-column: span 2;
}

/* Sidebar in Floating Card */
.wsl-sidebar-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 5px;
}

.wsl-sidebar-header {
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #1e293b;
    display: flex;
    justify-content: space-between;
}

.wsl-sidebar-list {
    overflow-y: auto;
    max-height: 400px;
    margin-right: -10px;
    padding-right: 10px;
}

/* Custom Scrollbar */
.wsl-sidebar-list::-webkit-scrollbar {
    width: 4px;
}

.wsl-sidebar-list::-webkit-scrollbar-track {
    background: transparent;
}

.wsl-sidebar-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.wsl-store-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.wsl-store-item:last-child {
    border-bottom: none;
}

.wsl-store-item:hover {
    transform: translateX(4px);
}

.wsl-store-item h4 {
    margin: 0 0 3px 0;
    font-size: 13px;
    color: #1e293b;
}

.wsl-store-item p {
    margin: 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* Skeleton */
.wsl-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: #f1f5f9;
}

.wsl-skeleton-animation {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: wsl-skeleton-loading 1.5s infinite;
}

@keyframes wsl-skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Balloon Styles */
.wsl-balloon {
    padding: 5px;
    max-width: 250px;
}

.wsl-balloon h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.wsl-btn {
    display: inline-block;
    padding: 8px 12px;
    background: #3b82f6;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.wsl-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 5px;
    display: inline-block;
}

.wsl-status-open {
    background: #dcfce7;
    color: #166534;
}

.wsl-status-closed {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .wsl-floating-ui {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }

    .wsl-controls-card {
        background: #fff;
        backdrop-filter: none;
        max-height: none;
    }

    .wsl-sidebar-list {
        max-height: 300px;
    }
}

/* Searchable Select Styles */
.wsl-searchable-select {
    position: relative;
    flex: 1 1 140px;
    min-width: 140px;
}

.wsl-searchable-trigger {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.wsl-searchable-trigger::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -2px;
    border-width: 5px 4px 0 4px;
    border-style: solid;
    border-color: #666 transparent transparent transparent;
}

.wsl-searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 4px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    padding: 8px;
    box-sizing: border-box;
}

.wsl-searchable-dropdown.active {
    display: block;
}

.wsl-searchable-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 6px;
    box-sizing: border-box;
    outline: none;
}

.wsl-searchable-input:focus {
    border-color: #3b82f6;
}

.wsl-searchable-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.wsl-searchable-list li {
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
}

.wsl-searchable-list li:hover {
    background: #f1f5f9;
}

.wsl-searchable-list li.selected {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 500;
}

/* Scrollbar for list */
.wsl-searchable-list::-webkit-scrollbar {
    width: 4px;
}

.wsl-searchable-list::-webkit-scrollbar-track {
    background: transparent;
}

.wsl-searchable-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Mobile Toggle Button & Responsive Overrides */
.wsl-mobile-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    position: relative;
    z-index: 1002;
}

.wsl-mobile-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.wsl-mobile-toggle .wsl-chevron {
    color: #94a3b8;
    transition: transform 0.2s;
}

.wsl-floating-ui.expanded .wsl-mobile-toggle .wsl-chevron {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .wsl-floating-ui {
        position: absolute;
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        padding: 0;
        z-index: 1000;
        height: auto;
        display: block;
    }

    .wsl-mobile-toggle {
        display: flex;
    }

    .wsl-controls-card {
        background: #fff;
        backdrop-filter: none;
        max-height: 60vh;
        overflow-y: auto;
        display: none;
        /* Hidden by default on mobile */
        width: 100%;
        position: relative;
        z-index: 1001;
    }

    .wsl-floating-ui.expanded .wsl-controls-card {
        display: flex;
        animation: wsl-slide-down 0.3s ease-out;
    }

    .wsl-sidebar-list {
        max-height: 250px;
    }
}

@keyframes wsl-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}