/* Map Container */
.map-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

/* Sidebar */
.map-sidebar {
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.map-sidebar.collapsed {
    transform: translateX(-300px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-toggle-sidebar {
    background: var(--surface-light);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-toggle-sidebar:hover {
    background: var(--surface-lighter);
}

/* Filters */
.sidebar-filters {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-group-map {
    margin-bottom: 1rem;
}

.filter-group-map label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.filter-group-map select,
.filter-group-map input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.875rem;
    transition: var(--transition);
}

.filter-group-map select { cursor: pointer; }

.filter-group-map select:focus,
.filter-group-map input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-group-map input[type="text"]::placeholder {
    color: var(--text-muted);
}

.search-with-btn {
    display: flex;
    gap: 0.5rem;
}

.search-with-btn input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 0.75rem;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-with-btn input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

.search-with-btn input[type="text"]::placeholder {
    color: var(--text-muted);
}

.btn-search-city {
    flex-shrink: 0;
    width: 44px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-search-city:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Autocomplete suggestions */
.filter-group-autocomplete {
    position: relative;
}

.autocomplete-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 4px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

.autocomplete-item:hover {
    background: var(--surface-lighter);
}

.autocomplete-item + .autocomplete-item {
    border-top: 1px solid var(--border);
}

.autocomplete-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.autocomplete-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.autocomplete-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-filter-apply,
.btn-filter-reset {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-filter-apply {
    background: var(--primary);
    color: white;
}

.btn-filter-apply:hover {
    background: var(--primary-dark);
}

.btn-filter-reset {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-filter-reset:hover {
    background: var(--surface-lighter);
}

/* Results */
.sidebar-results {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.results-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.results-list {
    flex: 1;
    padding: 1rem;
}

.result-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.result-item:hover {
    background: var(--surface-lighter);
    transform: translateX(4px);
}

.result-item.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.result-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-type {
    font-size: 0.875rem;
    color: var(--primary-light);
    margin-bottom: 0.25rem;
}

.result-distance {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--warning);
}

/* Google Map */
.google-map {
    flex: 1;
    position: relative;
}

/* Custom Info Window */
.custom-info-window {
    padding: 0;
    max-width: 280px;
}

.info-window-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.info-window-content {
    padding: 1rem;
}

.info-window-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.info-window-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.info-window-type {
    font-size: 0.875rem;
    color: var(--primary-light);
}

.info-window-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--warning);
}

.info-window-actions {
    display: flex;
    gap: 0.5rem;
}

.info-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-light);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.info-btn:hover {
    background: var(--surface-lighter);
}

.info-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.info-btn.primary:hover {
    background: var(--primary-dark);
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.map-control-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.map-control-btn:hover {
    background: var(--surface-light);
    transform: scale(1.05);
}

/* ===== Map Search Overlay ===== */

.map-search-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
    max-width: 420px;
}

.map-search-box {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 10px 14px;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.map-search-icon { flex-shrink: 0; }

.map-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
    font-family: Inter, sans-serif;
}

.map-search-input::placeholder { color: #666; }

.map-search-clear {
    background: none;
    border: none;
    color: #555;
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.map-search-clear:hover { color: #888; }

.map-search-results {
    margin-top: 6px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.map-search-section {
    padding: 8px 14px 4px;
    color: #666;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #222;
}

.map-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: background 0.15s;
}

.map-search-item:hover { background: #252525; }

.map-search-item-icon { font-size: 18px; flex-shrink: 0; }

.map-search-item-text { flex: 1; min-width: 0; }

.map-search-item-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-search-item-sub {
    color: #666;
    font-size: 11px;
    margin-top: 1px;
}

.map-search-item-rating {
    color: #aaa;
    font-size: 12px;
    flex-shrink: 0;
}

.map-search-empty {
    padding: 16px;
    text-align: center;
    color: #555;
    font-size: 13px;
}

/* ===== Zoom Controls ===== */

.map-zoom-controls {
    position: absolute;
    right: 12px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 10;
}

.map-zoom-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.map-zoom-btn:hover { background: #252525; }

.map-zoom-btn + .map-zoom-btn { border-top: 1px solid #2a2a2a; }

/* My Location Button */

.map-myloc-btn {
    position: absolute;
    right: 12px;
    bottom: 170px;
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 10;
    transition: background 0.15s;
}

.map-myloc-btn:hover { background: #252525; }

/* Mobile */
@media (max-width: 768px) {
    .map-sidebar {
        width: 100%;
        max-width: 350px;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
    }

    .map-sidebar.collapsed {
        transform: translateX(-100%);
    }
}
