/* Location Search Plugin - Frontend Styles */

.lsp-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    color: #1a1a2e;
}

.lsp-widget-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #1a1a2e;
}

/* ── Search Bar ── */
.lsp-search-bar {
    position: relative;
    margin-bottom: 24px;
}

.lsp-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.lsp-search-inner:focus-within {
    border-color: #5cba7e;
    box-shadow: 0 2px 16px rgba(92, 186, 126, 0.18);
}

.lsp-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e8f7ef;
    color: #2d7a4f;
    border: none;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 50px 0 0 50px;
    transition: background 0.2s;
}

.lsp-search-btn:hover {
    background: #d0f0df;
}

.lsp-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 0.95rem;
    color: #374151;
    background: transparent;
    min-width: 0;
}

.lsp-search-input::placeholder {
    color: #9ca3af;
}

.lsp-search-clear {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1rem;
    padding: 14px 16px;
    cursor: pointer;
    display: none;
}

.lsp-search-clear:hover { color: #374151; }

/* Search Results Dropdown */
.lsp-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
}

.lsp-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f4f6;
}

.lsp-result-item:last-child { border-bottom: none; }
.lsp-result-item:hover { background: #f0fdf4; }

.lsp-result-icon { color: #5cba7e; flex-shrink: 0; }

.lsp-result-text {
    display: flex;
    flex-direction: column;
    font-size: 0.88rem;
    color: #374151;
}

.lsp-result-text strong { font-weight: 600; color: #1a1a2e; }
.lsp-result-text span { font-size: 0.78rem; color: #6b7280; }

.lsp-result-none {
    padding: 16px 18px;
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
}

/* ── Location Group ── */
.lsp-location-group {
    background: #fff;
    border: 1.5px solid #e8ecf0;
    border-radius: 16px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.lsp-location-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.lsp-location-header:hover { background: #f9fafb; }

.lsp-location-icon {
    width: 44px;
    height: 44px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2d7a4f;
}

.lsp-location-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lsp-location-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.lsp-location-desc {
    font-size: 0.82rem;
    color: #6b7280;
}

.lsp-toggle-btn {
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #6b7280;
    transition: background 0.15s, transform 0.2s;
}

.lsp-toggle-btn:hover { background: #e5e7eb; }
.lsp-toggle-btn.active { background: #e8f7ef; border-color: #a7f3c4; color: #2d7a4f; }

.lsp-chevron {
    transition: transform 0.25s ease;
}

.lsp-toggle-btn.active .lsp-chevron {
    transform: rotate(180deg);
}

/* ── Sub-locations Grid ── */
.lsp-sublocations-grid {
    display: grid;
    gap: 2px;
    padding: 0 2px 2px;
    background: #f3f4f6;
}

.lsp-cols-4 { grid-template-columns: repeat(4, 1fr); }
.lsp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.lsp-cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
    .lsp-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .lsp-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .lsp-cols-4, .lsp-cols-3, .lsp-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

.lsp-sublocation-card {
    background: #fff center/cover no-repeat;
    min-height: 90px;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.lsp-sublocation-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(220,240,230,0.3) 0%, rgba(200,230,215,0.5) 100%);
    transition: opacity 0.2s;
}

.lsp-sublocation-card:hover::before {
    background: linear-gradient(to bottom, rgba(92,186,126,0.15) 0%, rgba(45,122,79,0.25) 100%);
}

.lsp-sublocation-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1;
}

.lsp-sublocation-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a3a28;
    width: 100%;
}

.lsp-pin-icon { color: #2d7a4f; flex-shrink: 0; }

.lsp-no-locations {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 0.95rem;
}
